MLK-16919-7 media: v4l2: capture: add handler for two-8bit-sensor mode
authorRobby Cai <robby.cai@nxp.com>
Wed, 22 Nov 2017 03:32:08 +0000 (11:32 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:55:36 +0000 (15:55 -0500)
Add handling to parse two-8bit-sensor mode

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
drivers/media/platform/mxc/capture/mx6s_capture.c

index b193b84..4b89e04 100644 (file)
@@ -338,6 +338,7 @@ struct mx6s_csi_dev {
        struct v4l2_async_subdev        *async_subdevs[2];
 
        bool csi_mipi_mode;
+       bool csi_two_8bit_sensor_mode;
        const bool *rx_fifo_rst;
        struct mx6s_csi_mux csi_mux;
 };
@@ -576,6 +577,8 @@ static void csi_dmareq_rff_enable(struct mx6s_csi_dev *csi_dev)
        cr3 |= BIT_HRESP_ERR_EN;
        cr3 &= ~BIT_RXFF_LEVEL;
        cr3 |= 0x2 << 4;
+       if (csi_dev->csi_two_8bit_sensor_mode)
+               cr3 |= BIT_TWO_8BIT_SENSOR;
 
        __raw_writel(cr3, csi_dev->regbase + CSI_CSICR3);
        __raw_writel(cr2, csi_dev->regbase + CSI_CSICR2);
@@ -1736,6 +1739,19 @@ static int mx6s_csi_mode_sel(struct mx6s_csi_dev *csi_dev)
        return ret;
 }
 
+static int mx6s_csi_two_8bit_sensor_mode_sel(struct mx6s_csi_dev *csi_dev)
+{
+       struct device_node *np = csi_dev->dev->of_node;
+
+       if (of_get_property(np, "fsl,two-8bit-sensor-mode", NULL))
+               csi_dev->csi_two_8bit_sensor_mode = true;
+       else {
+               csi_dev->csi_two_8bit_sensor_mode = false;
+       }
+
+       return 0;
+}
+
 static int mx6sx_register_subdevs(struct mx6s_csi_dev *csi_dev)
 {
        struct device_node *parent = csi_dev->dev->of_node;
@@ -1838,6 +1854,7 @@ static int mx6s_csi_probe(struct platform_device *pdev)
        csi_dev->dev = dev;
 
        mx6s_csi_mode_sel(csi_dev);
+       mx6s_csi_two_8bit_sensor_mode_sel(csi_dev);
 
        of_id = of_match_node(mx6s_csi_dt_ids, csi_dev->dev->of_node);
        if (!of_id)