Commit 50c616fd authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mauro Carvalho Chehab

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: default avatarMagnus Damm <damm@igel.co.jp>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2a1d245b
...@@ -18,15 +18,7 @@ ...@@ -18,15 +18,7 @@
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/soc_camera.h> #include <media/soc_camera.h>
#include <media/soc_camera_platform.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);
};
struct soc_camera_platform_priv { struct soc_camera_platform_priv {
struct soc_camera_platform_info *info; struct soc_camera_platform_info *info;
...@@ -44,11 +36,21 @@ soc_camera_platform_get_info(struct soc_camera_device *icd) ...@@ -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) 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; return 0;
} }
static int soc_camera_platform_release(struct soc_camera_device *icd) 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; return 0;
} }
......
...@@ -9,6 +9,7 @@ struct soc_camera_platform_info { ...@@ -9,6 +9,7 @@ struct soc_camera_platform_info {
unsigned long format_depth; unsigned long format_depth;
struct v4l2_pix_format format; struct v4l2_pix_format format;
unsigned long bus_param; unsigned long bus_param;
void (*power)(int);
int (*set_capture)(struct soc_camera_platform_info *info, int enable); int (*set_capture)(struct soc_camera_platform_info *info, int enable);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment