[media] s5p-fimc: Convert to use generic media bus polarity flags
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 19 Sep 2011 15:38:35 +0000 (12:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 24 Sep 2011 03:22:31 +0000 (00:22 -0300)
Switch to generic media bus signal polarity flags and allow
configuring the FIELD signal polarity.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/s5p-fimc/fimc-reg.c
drivers/media/video/s5p-fimc/regs-fimc.h
include/media/s5p_fimc.h

index 2a1ae51ad949f10272917a4e46afbd3858469e66..20e664e341632df52877c78ef10ce96f6bc57301 100644 (file)
@@ -533,20 +533,24 @@ int fimc_hw_set_camera_polarity(struct fimc_dev *fimc,
        u32 cfg = readl(fimc->regs + S5P_CIGCTRL);
 
        cfg &= ~(S5P_CIGCTRL_INVPOLPCLK | S5P_CIGCTRL_INVPOLVSYNC |
-                S5P_CIGCTRL_INVPOLHREF | S5P_CIGCTRL_INVPOLHSYNC);
+                S5P_CIGCTRL_INVPOLHREF | S5P_CIGCTRL_INVPOLHSYNC |
+                S5P_CIGCTRL_INVPOLFIELD);
 
-       if (cam->flags & FIMC_CLK_INV_PCLK)
+       if (cam->flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
                cfg |= S5P_CIGCTRL_INVPOLPCLK;
 
-       if (cam->flags & FIMC_CLK_INV_VSYNC)
+       if (cam->flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
                cfg |= S5P_CIGCTRL_INVPOLVSYNC;
 
-       if (cam->flags & FIMC_CLK_INV_HREF)
+       if (cam->flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
                cfg |= S5P_CIGCTRL_INVPOLHREF;
 
-       if (cam->flags & FIMC_CLK_INV_HSYNC)
+       if (cam->flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
                cfg |= S5P_CIGCTRL_INVPOLHSYNC;
 
+       if (cam->flags & V4L2_MBUS_FIELD_EVEN_LOW)
+               cfg |= S5P_CIGCTRL_INVPOLFIELD;
+
        writel(cfg, fimc->regs + S5P_CIGCTRL);
 
        return 0;
index 94d2302698a9f5ff37ebfb67654addb25a4ddbef..c8e3b94bd91d2ca7cf16c66886a33c9afbe1c290 100644 (file)
@@ -61,6 +61,7 @@
 #define S5P_CIGCTRL_CSC_ITU601_709     (1 << 5)
 #define S5P_CIGCTRL_INVPOLHSYNC                (1 << 4)
 #define S5P_CIGCTRL_SELCAM_MIPI                (1 << 3)
+#define S5P_CIGCTRL_INVPOLFIELD                (1 << 1)
 #define S5P_CIGCTRL_INTERLACE          (1 << 0)
 
 /* Window offset 2 */
index 2b589042588d96682408416c8d8788c250f264ce..688fb3f1dc3566913965cd2281d344f40e9c8e59 100644 (file)
@@ -19,11 +19,6 @@ enum cam_bus_type {
        FIMC_LCD_WB, /* FIFO link from LCD mixer */
 };
 
-#define FIMC_CLK_INV_PCLK      (1 << 0)
-#define FIMC_CLK_INV_VSYNC     (1 << 1)
-#define FIMC_CLK_INV_HREF      (1 << 2)
-#define FIMC_CLK_INV_HSYNC     (1 << 3)
-
 struct i2c_board_info;
 
 /**
@@ -37,7 +32,7 @@ struct i2c_board_info;
  * @i2c_bus_num: i2c control bus id the sensor is attached to
  * @mux_id: FIMC camera interface multiplexer index (separate for MIPI and ITU)
  * @clk_id: index of the SoC peripheral clock for sensors
- * @flags: flags defining bus signals polarity inversion (High by default)
+ * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*)
  */
 struct s5p_fimc_isp_info {
        struct i2c_board_info *board_info;