diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-08-10 01:49:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:19:24 -0400 |
commit | 53dacb15705901e14b03dcba27e40364fedd9d09 (patch) | |
tree | ca3b4111465aca9d58024ace0f0072ee7952c11e /Documentation/video4linux | |
parent | 0da2808ca27ab7f65346d4d191569c669db8f628 (diff) |
V4L/DVB (12540): v4l: simplify v4l2_i2c_new_subdev and friends
Rewrite v4l2_i2c_new_subdev as a simplified version of v4l2_i2c_new_subdev_cfg
and remove v4l2_i2c_new_probed_subdev and v4l2_i2c_new_probed_subdev_addr.
This simplifies this API substantially.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux')
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index ba4706afc5fb..e395a9cdc533 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -370,19 +370,20 @@ from the remove() callback ensures that this is always done correctly. | |||
370 | The bridge driver also has some helper functions it can use: | 370 | The bridge driver also has some helper functions it can use: |
371 | 371 | ||
372 | struct v4l2_subdev *sd = v4l2_i2c_new_subdev(v4l2_dev, adapter, | 372 | struct v4l2_subdev *sd = v4l2_i2c_new_subdev(v4l2_dev, adapter, |
373 | "module_foo", "chipid", 0x36); | 373 | "module_foo", "chipid", 0x36, NULL); |
374 | 374 | ||
375 | This loads the given module (can be NULL if no module needs to be loaded) and | 375 | This loads the given module (can be NULL if no module needs to be loaded) and |
376 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. | 376 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. |
377 | If all goes well, then it registers the subdev with the v4l2_device. | 377 | If all goes well, then it registers the subdev with the v4l2_device. |
378 | 378 | ||
379 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to | 379 | You can also use the last argument of v4l2_i2c_new_subdev() to pass an array |
380 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses | 380 | of possible I2C addresses that it should probe. These probe addresses are |
381 | that it should probe. Internally it calls i2c_new_probed_device(). | 381 | only used if the previous argument is 0. A non-zero argument means that you |
382 | know the exact i2c address so in that case no probing will take place. | ||
382 | 383 | ||
383 | Both functions return NULL if something went wrong. | 384 | Both functions return NULL if something went wrong. |
384 | 385 | ||
385 | Note that the chipid you pass to v4l2_i2c_new_(probed_)subdev() is usually | 386 | Note that the chipid you pass to v4l2_i2c_new_subdev() is usually |
386 | the same as the module name. It allows you to specify a chip variant, e.g. | 387 | the same as the module name. It allows you to specify a chip variant, e.g. |
387 | "saa7114" or "saa7115". In general though the i2c driver autodetects this. | 388 | "saa7114" or "saa7115". In general though the i2c driver autodetects this. |
388 | The use of chipid is something that needs to be looked at more closely at a | 389 | The use of chipid is something that needs to be looked at more closely at a |
@@ -410,11 +411,6 @@ the irq and platform_data arguments after the subdev was setup. The older | |||
410 | v4l2_i2c_new_(probed_)subdev functions will call s_config as well, but with | 411 | v4l2_i2c_new_(probed_)subdev functions will call s_config as well, but with |
411 | irq set to 0 and platform_data set to NULL. | 412 | irq set to 0 and platform_data set to NULL. |
412 | 413 | ||
413 | Note that in the next kernel release the functions v4l2_i2c_new_subdev, | ||
414 | v4l2_i2c_new_probed_subdev and v4l2_i2c_new_probed_subdev_addr will all be | ||
415 | replaced by a single v4l2_i2c_new_subdev that is identical to | ||
416 | v4l2_i2c_new_subdev_cfg but without the irq and platform_data arguments. | ||
417 | |||
418 | struct video_device | 414 | struct video_device |
419 | ------------------- | 415 | ------------------- |
420 | 416 | ||