From 4ec10bacd6bf08de39ebdba9e75060452cc313e0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 20 Jul 2012 10:19:50 -0300 Subject: [media] soc-camera: Add and use soc_camera_power_[on|off]() helper functions Instead of forcing all soc-camera drivers to go through the mid-layer to handle power management, create soc_camera_power_[on|off]() functions that can be called from the subdev .s_power() operation to manage regulators and platform-specific power handling. This allows non soc-camera hosts to use soc-camera-aware clients. Signed-off-by: Laurent Pinchart [g.liakhovetski@gmx.de: fix compile breakage] Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/soc_camera.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/media') diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index d865dcf9879f..982bfc948414 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -254,6 +254,16 @@ unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, unsigned long soc_camera_apply_board_flags(struct soc_camera_link *icl, const struct v4l2_mbus_config *cfg); +int soc_camera_power_on(struct device *dev, struct soc_camera_link *icl); +int soc_camera_power_off(struct device *dev, struct soc_camera_link *icl); + +static inline int soc_camera_set_power(struct device *dev, + struct soc_camera_link *icl, bool on) +{ + return on ? soc_camera_power_on(dev, icl) + : soc_camera_power_off(dev, icl); +} + /* This is only temporary here - until v4l2-subdev begins to link to video_device */ #include static inline struct video_device *soc_camera_i2c_to_vdev(const struct i2c_client *client) -- cgit v1.2.3-55-g7522