diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-03-12 17:34:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:19 -0400 |
commit | 2c79252326421dd49c059aceec0880d2cf15b17a (patch) | |
tree | 843430d8471a54dbe04a6363f7d2e30060ed7499 /Documentation/video4linux | |
parent | 5e585ef15b3633e1b0c022aa14bc88587827acd3 (diff) |
V4L/DVB (10980): doc: improve the v4l2-framework documentation.
Emphasize the need to call i2c_set_adapdata and clarify the use of the
chipid in v4l2_i2c_new_(probed_)device().
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 | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index accc376e93c..51a7b6db118 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -359,8 +359,8 @@ This loads the given module (can be NULL if no module needs to be loaded) and | |||
359 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. | 359 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. |
360 | If all goes well, then it registers the subdev with the v4l2_device. It gets | 360 | If all goes well, then it registers the subdev with the v4l2_device. It gets |
361 | the v4l2_device by calling i2c_get_adapdata(adapter), so you should make sure | 361 | the v4l2_device by calling i2c_get_adapdata(adapter), so you should make sure |
362 | that adapdata is set to v4l2_device when you setup the i2c_adapter in your | 362 | to call i2c_set_adapdata(adapter, v4l2_device) when you setup the i2c_adapter |
363 | driver. | 363 | in your driver. |
364 | 364 | ||
365 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to | 365 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to |
366 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses | 366 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses |
@@ -368,6 +368,14 @@ that it should probe. Internally it calls i2c_new_probed_device(). | |||
368 | 368 | ||
369 | Both functions return NULL if something went wrong. | 369 | Both functions return NULL if something went wrong. |
370 | 370 | ||
371 | Note that the chipid you pass to v4l2_i2c_new_(probed_)subdev() is usually | ||
372 | the same as the module name. It allows you to specify a chip variant, e.g. | ||
373 | "saa7114" or "saa7115". In general though the i2c driver autodetects this. | ||
374 | The use of chipid is something that needs to be looked at more closely at a | ||
375 | later date. It differs between i2c drivers and as such can be confusing. | ||
376 | To see which chip variants are supported you can look in the i2c driver code | ||
377 | for the i2c_device_id table. This lists all the possibilities. | ||
378 | |||
371 | 379 | ||
372 | struct video_device | 380 | struct video_device |
373 | ------------------- | 381 | ------------------- |