diff options
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 | ||