From ed4d56c859ac68c4480862375d42f62cc9cff38e Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Fri, 17 Oct 2008 00:49:27 +0200 Subject: soc-camera: move sensor power management to soc_camera_platform.c Switching sensors on and off is now done by sensor drivers themselves, typically using platform-provided hooks. Update soc_camera_platform.c to do the same. Also remove a refundant struct soc_camera_platform_info definition from soc_camera_platform.c. Signed-off-by: Guennadi Liakhovetski Tested-by: Magnus Damm --- linux/drivers/media/video/soc_camera_platform.c | 20 +++++++++++--------- linux/include/media/soc_camera_platform.h | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) --- linux/drivers/media/video/soc_camera_platform.c | 20 +++++++++++--------- linux/include/media/soc_camera_platform.h | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/soc_camera_platform.c b/linux/drivers/media/video/soc_camera_platform.c index 1adc257eb..bb7a9d480 100644 --- a/linux/drivers/media/video/soc_camera_platform.c +++ b/linux/drivers/media/video/soc_camera_platform.c @@ -18,15 +18,7 @@ #include #include #include - -struct soc_camera_platform_info { - int iface; - char *format_name; - unsigned long format_depth; - struct v4l2_pix_format format; - unsigned long bus_param; - int (*set_capture)(struct soc_camera_platform_info *info, int enable); -}; +#include struct soc_camera_platform_priv { struct soc_camera_platform_info *info; @@ -44,11 +36,21 @@ soc_camera_platform_get_info(struct soc_camera_device *icd) static int soc_camera_platform_init(struct soc_camera_device *icd) { + struct soc_camera_platform_info *p = soc_camera_platform_get_info(icd); + + if (p->power) + p->power(1); + return 0; } static int soc_camera_platform_release(struct soc_camera_device *icd) { + struct soc_camera_platform_info *p = soc_camera_platform_get_info(icd); + + if (p->power) + p->power(0); + return 0; } diff --git a/linux/include/media/soc_camera_platform.h b/linux/include/media/soc_camera_platform.h index 851f18220..7c81ad32b 100644 --- a/linux/include/media/soc_camera_platform.h +++ b/linux/include/media/soc_camera_platform.h @@ -9,6 +9,7 @@ struct soc_camera_platform_info { unsigned long format_depth; struct v4l2_pix_format format; unsigned long bus_param; + void (*power)(int); int (*set_capture)(struct soc_camera_platform_info *info, int enable); }; -- cgit v1.2.3