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>
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index da57ffd..e6ed0d9 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -81,11 +81,19 @@
 	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 @@
 	return (!hsync || !vsync || !pclk) ? 0 : common_flags;
 }
 
+extern unsigned long soc_camera_apply_sensor_flags(struct soc_camera_link *icl,
+						   unsigned long flags);
+
 #endif