diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-04-01 02:57:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 20:44:24 -0400 |
commit | e6574f2fbecdb8af807169d345c10131ae060a88 (patch) | |
tree | 9923d1065397b9796a476cac238bacbdf1d820d1 /Documentation | |
parent | 868f985c2fb85b5f32785bb55a349d180a30f3d3 (diff) |
V4L/DVB (11373): v4l2-common: add explicit v4l2_device pointer as first arg to new_(probed)_subdev
The functions v4l2_i2c_new_subdev and v4l2_i2c_new_probed_subdev relied on
i2c_get_adapdata to return the v4l2_device. However, this is not always
possible on embedded platforms. So modify the API to pass the v4l2_device
pointer explicitly.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index c9ae70a37a6c..854808b67fae 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -364,14 +364,12 @@ from the remove() callback ensures that this is always done correctly. | |||
364 | 364 | ||
365 | The bridge driver also has some helper functions it can use: | 365 | The bridge driver also has some helper functions it can use: |
366 | 366 | ||
367 | struct v4l2_subdev *sd = v4l2_i2c_new_subdev(adapter, "module_foo", "chipid", 0x36); | 367 | struct v4l2_subdev *sd = v4l2_i2c_new_subdev(v4l2_dev, adapter, |
368 | "module_foo", "chipid", 0x36); | ||
368 | 369 | ||
369 | This loads the given module (can be NULL if no module needs to be loaded) and | 370 | This loads the given module (can be NULL if no module needs to be loaded) and |
370 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. | 371 | calls i2c_new_device() with the given i2c_adapter and chip/address arguments. |
371 | If all goes well, then it registers the subdev with the v4l2_device. It gets | 372 | If all goes well, then it registers the subdev with the v4l2_device. |
372 | the v4l2_device by calling i2c_get_adapdata(adapter), so you should make sure | ||
373 | to call i2c_set_adapdata(adapter, v4l2_device) when you setup the i2c_adapter | ||
374 | in your driver. | ||
375 | 373 | ||
376 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to | 374 | You can also use v4l2_i2c_new_probed_subdev() which is very similar to |
377 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses | 375 | v4l2_i2c_new_subdev(), except that it has an array of possible I2C addresses |