V4L/DVB (10072): soc-camera: Add signal inversion flags to be used by camera drivers

As reported by Antonio Ospite <ospite@studenti.unina.it> 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 <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Guennadi Liakhovetski
2008-12-23 05:54:45 -03:00
committed by Mauro Carvalho Chehab
parent 5ca11fa3e0
commit bd73b36f0c
6 changed files with 65 additions and 14 deletions

View File

@@ -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