From bd73b36f0c41b0c02ef4b10a307db1c43537e006 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 23 Dec 2008 05:54:45 -0300 Subject: V4L/DVB (10072): soc-camera: Add signal inversion flags to be used by camera drivers As reported by Antonio Ospite two platforms with a mt9m111 camera require opposite pixel clock polarity, which means one of them inverts it. This patch adds support for inversion flags and switches all available camera drivers to using them. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- include/media/soc_camera.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index da57ffdaec4..e6ed0d94ac1 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h @@ -81,11 +81,19 @@ struct soc_camera_host_ops { unsigned int (*poll)(struct file *, poll_table *); }; +#define SOCAM_SENSOR_INVERT_PCLK (1 << 0) +#define SOCAM_SENSOR_INVERT_MCLK (1 << 1) +#define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) +#define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) +#define SOCAM_SENSOR_INVERT_DATA (1 << 4) + struct soc_camera_link { /* Camera bus id, used to match a camera and a bus */ int bus_id; /* GPIO number to switch between 8 and 10 bit modes */ unsigned int gpio; + /* Per camera SOCAM_SENSOR_* bus flags */ + unsigned long flags; /* Optional callbacks to power on or off and reset the sensor */ int (*power)(struct device *, int); int (*reset)(struct device *); @@ -206,4 +214,7 @@ static inline unsigned long soc_camera_bus_param_compatible( return (!hsync || !vsync || !pclk) ? 0 : common_flags; } +extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl, + unsigned long flags); + #endif -- cgit v1.2.3