summaryrefslogtreecommitdiff
path: root/include/media/soc_camera.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-09-09 13:39:20 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-03 18:29:03 -0200
commit2f0babb7e43278247df512263581c4738afa4cbc (patch)
treeb09a18f6f7756c9f793e36c26db17f4cfc9a558e /include/media/soc_camera.h
parent1a99b972a86ba9c3984c042f7f641458ad4812d0 (diff)
[media] V4L: soc-camera: make (almost) all client drivers re-usable outside of the framework
The most important change in this patch is direct linking to struct soc_camera_link via the client->dev.platform_data pointer. This makes most of the soc-camera client drivers also usable outside of the soc-camera framework. After this change all what is needed for these drivers to function are inclusions of soc-camera headers for some convenience macros, suitably configured platform data, which is anyway always required, and loaded soc-camera core module for library functions. If desired, these library functions can be made generic in the future and moved to a more neutral location. The only two client drivers, that still depend on soc-camera are: mt9t031: it uses struct video_device for its PM. Since no hardware is available, alternative methods cannot be tested. ov6650: it uses struct soc_camera_device to pass its sense data back to the bridge driver. A generic v4l2-subdevice approach should be developed to perform this. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/soc_camera.h')
-rw-r--r--include/media/soc_camera.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index dac57598ee57..b1377b931eb7 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -253,14 +253,14 @@ unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl,
#include <linux/i2c.h>
static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client)
{
- struct soc_camera_device *icd = client->dev.platform_data;
+ struct v4l2_subdev *sd = i2c_get_clientdata(client);
+ struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id;
return icd ? icd->vdev : NULL;
}
static inline struct soc_camera_link *soc_camera_i2c_to_link(const struct i2c_client *client)
{
- struct soc_camera_device *icd = client->dev.platform_data;
- return icd ? to_soc_camera_link(icd) : NULL;
+ return client->dev.platform_data;
}
static inline struct v4l2_subdev *soc_camera_vdev_to_subdev(const struct video_device *vdev)