[media] s5p-fimc: Don't use platform data for CSI data alignment configuration
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Wed, 21 Mar 2012 09:21:30 +0000 (06:21 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 10 Apr 2012 18:22:26 +0000 (15:22 -0300)
The MIPI-CSI2 data alignment parameter can be derived from media bus
pixel code, so it can be now dropped from the platform data structure.
This is a prerequisite for adding the device tree support. Once this
patch is merged the corresponding fields will be removed from the
drivers' public headers and corresponding board files.

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/mipi-csis.c

index 15466d0529c14907e2cf2716cd49b1f1da03e8f5..ff11f10fea0bfd4acab4392288d6822721456e3b 100644 (file)
@@ -674,6 +674,7 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc,
 {
        u32 cfg, tmp;
        struct fimc_vid_cap *vid_cap = &fimc->vid_cap;
+       u32 csis_data_alignment = 32;
 
        cfg = readl(fimc->regs + S5P_CIGCTRL);
 
@@ -703,7 +704,7 @@ int fimc_hw_set_camera_type(struct fimc_dev *fimc,
                                 vid_cap->mf.code);
                        return -EINVAL;
                }
-               tmp |= (cam->csi_data_align == 32) << 8;
+               tmp |= (csis_data_alignment == 32) << 8;
 
                writel(tmp, fimc->regs + S5P_CSIIMGFMT);
 
index f44f690397f7505b3fa73e024b7b09ddb258c473..1cd6b6bc627928ae19678c10d313508124409eb3 100644 (file)
@@ -127,20 +127,24 @@ struct csis_state {
  *                       multiple of 2^pix_width_alignment
  * @code: corresponding media bus code
  * @fmt_reg: S5PCSIS_CONFIG register value
+ * @data_alignment: MIPI-CSI data alignment in bits
  */
 struct csis_pix_format {
        unsigned int pix_width_alignment;
        enum v4l2_mbus_pixelcode code;
        u32 fmt_reg;
+       u8 data_alignment;
 };
 
 static const struct csis_pix_format s5pcsis_formats[] = {
        {
                .code = V4L2_MBUS_FMT_VYUY8_2X8,
                .fmt_reg = S5PCSIS_CFG_FMT_YCBCR422_8BIT,
+               .data_alignment = 32,
        }, {
                .code = V4L2_MBUS_FMT_JPEG_1X8,
                .fmt_reg = S5PCSIS_CFG_FMT_USER(1),
+               .data_alignment = 32,
        },
 };
 
@@ -239,7 +243,7 @@ static void s5pcsis_set_params(struct csis_state *state)
        s5pcsis_set_hsync_settle(state, pdata->hs_settle);
 
        val = s5pcsis_read(state, S5PCSIS_CTRL);
-       if (pdata->alignment == 32)
+       if (state->csis_fmt->data_alignment == 32)
                val |= S5PCSIS_CTRL_ALIGN_32BIT;
        else /* 24-bits */
                val &= ~S5PCSIS_CTRL_ALIGN_32BIT;