diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-10-16 19:49:27 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 17:25:29 -0300 |
commit | 50c616fd0b43f50379aa70da96fd350312367367 (patch) | |
tree | 5cbbbcebc9deac66406a86e53c475e00fb3da6e6 | |
parent | 2a1d245b70f3f966f96767aaea1a2db6823e2f6e (diff) |
V4L/DVB (9241): 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.
Tested-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/soc_camera_platform.c | 20 | ||||
-rw-r--r-- | include/media/soc_camera_platform.h | 1 |
2 files changed, 12 insertions, 9 deletions
diff --git a/drivers/media/video/soc_camera_platform.c b/drivers/media/video/soc_camera_platform.c index 1adc257ebdb..bb7a9d480e8 100644 --- a/drivers/media/video/soc_camera_platform.c +++ b/drivers/media/video/soc_camera_platform.c @@ -18,15 +18,7 @@ #include <linux/videodev2.h> #include <media/v4l2-common.h> #include <media/soc_camera.h> - -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 <media/soc_camera_platform.h> 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/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index 851f1822098..7c81ad32b1e 100644 --- a/include/media/soc_camera_platform.h +++ b/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); }; |