aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-12-21 11:01:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 15:32:36 -0400
commit9aea470b399d797e88be08985c489855759c6c60 (patch)
treecbcc6f1c80ee9da8b0da54e2d793f63e920527ee /include
parente9e310491bdbc8c0f33ea0e2ce65eff345a01f71 (diff)
[media] soc-camera: switch I2C subdevice drivers to use v4l2-clk
Instead of centrally enabling and disabling subdevice master clocks in soc-camera core, let subdevice drivers do that themselves, using the V4L2 clock API and soc-camera convenience wrappers. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/soc_camera.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index dfa24df960df..f582323fafb7 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -49,6 +49,7 @@ struct soc_camera_device {
49 /* soc_camera.c private count. Only accessed with .host_lock held */ 49 /* soc_camera.c private count. Only accessed with .host_lock held */
50 int use_count; 50 int use_count;
51 struct file *streamer; /* stream owner */ 51 struct file *streamer; /* stream owner */
52 struct v4l2_clk *clk;
52 union { 53 union {
53 struct videobuf_queue vb_vidq; 54 struct videobuf_queue vb_vidq;
54 struct vb2_queue vb2_vidq; 55 struct vb2_queue vb2_vidq;
@@ -325,14 +326,16 @@ static inline void soc_camera_limit_side(int *start, int *length,
325unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd, 326unsigned long soc_camera_apply_board_flags(struct soc_camera_subdev_desc *ssdd,
326 const struct v4l2_mbus_config *cfg); 327 const struct v4l2_mbus_config *cfg);
327 328
328int soc_camera_power_on(struct device *dev, struct soc_camera_subdev_desc *ssdd); 329int soc_camera_power_on(struct device *dev, struct soc_camera_subdev_desc *ssdd,
329int soc_camera_power_off(struct device *dev, struct soc_camera_subdev_desc *ssdd); 330 struct v4l2_clk *clk);
331int soc_camera_power_off(struct device *dev, struct soc_camera_subdev_desc *ssdd,
332 struct v4l2_clk *clk);
330 333
331static inline int soc_camera_set_power(struct device *dev, 334static inline int soc_camera_set_power(struct device *dev,
332 struct soc_camera_subdev_desc *ssdd, bool on) 335 struct soc_camera_subdev_desc *ssdd, struct v4l2_clk *clk, bool on)
333{ 336{
334 return on ? soc_camera_power_on(dev, ssdd) 337 return on ? soc_camera_power_on(dev, ssdd, clk)
335 : soc_camera_power_off(dev, ssdd); 338 : soc_camera_power_off(dev, ssdd, clk);
336} 339}
337 340
338/* This is only temporary here - until v4l2-subdev begins to link to video_device */ 341/* This is only temporary here - until v4l2-subdev begins to link to video_device */