aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-29 06:59:57 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-17 08:18:29 -0400
commit2249aa5c97a017be4e3b5bb0e9a3ca2d2ed31b27 (patch)
tree4e5449abaf34ece02dee15a52ca789c6f64da63f /Documentation
parentabbec2d401d6698db44e632f5adbef2a47e6e812 (diff)
[media] v4l2-framework: replace g_chip_ident by g_std in the examples
The framework documentation used the g_chip_ident op as an example. This op has been removed, so replace its use in the examples by the g_std op. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/video4linux/v4l2-framework.txt13
-rw-r--r--Documentation/zh_CN/video4linux/v4l2-framework.txt13
2 files changed, 12 insertions, 14 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt
index a300b283a1a0..24353ecab197 100644
--- a/Documentation/video4linux/v4l2-framework.txt
+++ b/Documentation/video4linux/v4l2-framework.txt
@@ -246,7 +246,6 @@ may be NULL if the subdev driver does not support anything from that category.
246It looks like this: 246It looks like this:
247 247
248struct v4l2_subdev_core_ops { 248struct v4l2_subdev_core_ops {
249 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
250 int (*log_status)(struct v4l2_subdev *sd); 249 int (*log_status)(struct v4l2_subdev *sd);
251 int (*init)(struct v4l2_subdev *sd, u32 val); 250 int (*init)(struct v4l2_subdev *sd, u32 val);
252 ... 251 ...
@@ -346,24 +345,24 @@ Afterwards the subdev module can be unloaded and sd->dev == NULL.
346 345
347You can call an ops function either directly: 346You can call an ops function either directly:
348 347
349 err = sd->ops->core->g_chip_ident(sd, &chip); 348 err = sd->ops->core->g_std(sd, &norm);
350 349
351but it is better and easier to use this macro: 350but it is better and easier to use this macro:
352 351
353 err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); 352 err = v4l2_subdev_call(sd, core, g_std, &norm);
354 353
355The macro will to the right NULL pointer checks and returns -ENODEV if subdev 354The macro will to the right NULL pointer checks and returns -ENODEV if subdev
356is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is 355is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_std is
357NULL, or the actual result of the subdev->ops->core->g_chip_ident ops. 356NULL, or the actual result of the subdev->ops->core->g_std ops.
358 357
359It is also possible to call all or a subset of the sub-devices: 358It is also possible to call all or a subset of the sub-devices:
360 359
361 v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip); 360 v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm);
362 361
363Any subdev that does not support this ops is skipped and error results are 362Any subdev that does not support this ops is skipped and error results are
364ignored. If you want to check for errors use this: 363ignored. If you want to check for errors use this:
365 364
366 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); 365 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm);
367 366
368Any error except -ENOIOCTLCMD will exit the loop with that error. If no 367Any error except -ENOIOCTLCMD will exit the loop with that error. If no
369errors (except -ENOIOCTLCMD) occurred, then 0 is returned. 368errors (except -ENOIOCTLCMD) occurred, then 0 is returned.
diff --git a/Documentation/zh_CN/video4linux/v4l2-framework.txt b/Documentation/zh_CN/video4linux/v4l2-framework.txt
index 44c1d934c4e3..0da95dbaef34 100644
--- a/Documentation/zh_CN/video4linux/v4l2-framework.txt
+++ b/Documentation/zh_CN/video4linux/v4l2-framework.txt
@@ -247,7 +247,6 @@ i2c_client 结构体,i2c_set_clientdata() 函数可用于保存一个 v4l2_sub
247这些结构体定义如下: 247这些结构体定义如下:
248 248
249struct v4l2_subdev_core_ops { 249struct v4l2_subdev_core_ops {
250 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
251 int (*log_status)(struct v4l2_subdev *sd); 250 int (*log_status)(struct v4l2_subdev *sd);
252 int (*init)(struct v4l2_subdev *sd, u32 val); 251 int (*init)(struct v4l2_subdev *sd, u32 val);
253 ... 252 ...
@@ -337,24 +336,24 @@ subdev->dev 域就指向了 v4l2_device。
337 336
338注册之设备后,可通过以下方式直接调用其操作函数: 337注册之设备后,可通过以下方式直接调用其操作函数:
339 338
340 err = sd->ops->core->g_chip_ident(sd, &chip); 339 err = sd->ops->core->g_std(sd, &norm);
341 340
342但使用如下宏会比较容易且合适: 341但使用如下宏会比较容易且合适:
343 342
344 err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); 343 err = v4l2_subdev_call(sd, core, g_std, &norm);
345 344
346这个宏将会做 NULL 指针检查,如果 subdev 为 NULL,则返回-ENODEV;如果 345这个宏将会做 NULL 指针检查,如果 subdev 为 NULL,则返回-ENODEV;如果
347subdev->core 或 subdev->core->g_chip_ident 为 NULL,则返回 -ENOIOCTLCMD; 346subdev->core 或 subdev->core->g_std 为 NULL,则返回 -ENOIOCTLCMD;
348否则将返回 subdev->ops->core->g_chip_ident ops 调用的实际结果。 347否则将返回 subdev->ops->core->g_std ops 调用的实际结果。
349 348
350有时也可能同时调用所有或一系列子设备的某个操作函数: 349有时也可能同时调用所有或一系列子设备的某个操作函数:
351 350
352 v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip); 351 v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm);
353 352
354任何不支持此操作的子设备都会被跳过,并忽略错误返回值。但如果你需要 353任何不支持此操作的子设备都会被跳过,并忽略错误返回值。但如果你需要
355检查出错码,则可使用如下函数: 354检查出错码,则可使用如下函数:
356 355
357 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); 356 err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm);
358 357
359除 -ENOIOCTLCMD 外的任何错误都会跳出循环并返回错误值。如果(除 -ENOIOCTLCMD 358除 -ENOIOCTLCMD 外的任何错误都会跳出循环并返回错误值。如果(除 -ENOIOCTLCMD
360外)没有错误发生,则返回 0。 359外)没有错误发生,则返回 0。