diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-05-29 06:59:57 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-17 08:18:29 -0400 |
commit | 2249aa5c97a017be4e3b5bb0e9a3ca2d2ed31b27 (patch) | |
tree | 4e5449abaf34ece02dee15a52ca789c6f64da63f | |
parent | abbec2d401d6698db44e632f5adbef2a47e6e812 (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>
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 13 | ||||
-rw-r--r-- | Documentation/zh_CN/video4linux/v4l2-framework.txt | 13 |
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. | |||
246 | It looks like this: | 246 | It looks like this: |
247 | 247 | ||
248 | struct v4l2_subdev_core_ops { | 248 | struct 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 | ||
347 | You can call an ops function either directly: | 346 | You 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 | ||
351 | but it is better and easier to use this macro: | 350 | but 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 | ||
355 | The macro will to the right NULL pointer checks and returns -ENODEV if subdev | 354 | The macro will to the right NULL pointer checks and returns -ENODEV if subdev |
356 | is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is | 355 | is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_std is |
357 | NULL, or the actual result of the subdev->ops->core->g_chip_ident ops. | 356 | NULL, or the actual result of the subdev->ops->core->g_std ops. |
358 | 357 | ||
359 | It is also possible to call all or a subset of the sub-devices: | 358 | It 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 | ||
363 | Any subdev that does not support this ops is skipped and error results are | 362 | Any subdev that does not support this ops is skipped and error results are |
364 | ignored. If you want to check for errors use this: | 363 | ignored. 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 | ||
368 | Any error except -ENOIOCTLCMD will exit the loop with that error. If no | 367 | Any error except -ENOIOCTLCMD will exit the loop with that error. If no |
369 | errors (except -ENOIOCTLCMD) occurred, then 0 is returned. | 368 | errors (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 | ||
249 | struct v4l2_subdev_core_ops { | 249 | struct 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;如果 |
347 | subdev->core 或 subdev->core->g_chip_ident 为 NULL,则返回 -ENOIOCTLCMD; | 346 | subdev->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。 |