u8 req_bit;
};
+struct mx6s_csi_soc {
+ bool rx_fifo_rst;
+ int baseaddr_switch;
+};
+
struct mx6s_csi_dev {
struct device *dev;
struct video_device *vdev;
bool csi_mipi_mode;
bool csi_two_8bit_sensor_mode;
- const bool *rx_fifo_rst;
+ const struct mx6s_csi_soc *soc;
struct mx6s_csi_mux csi_mux;
};
isr = csi_read(csi_dev, CSI_CSISR);
csi_write(csi_dev, isr, CSI_CSISR);
- /* Ensable csi */
+ cr18 |= csi_dev->soc->baseaddr_switch;
+
+ /* Enable csi */
cr18 |= BIT_CSI_ENABLE;
csi_write(csi_dev, cr18, CSI_CSICR18);
}
csi_write(csi_dev, cr1, CSI_CSICR1);
cr18 = csi_read(csi_dev, CSI_CSICR18);
- cr18 &= BIT_MIPI_DATA_FORMAT_MASK;
+ cr18 &= ~BIT_MIPI_DATA_FORMAT_MASK;
cr18 |= BIT_DATA_FROM_MIPI;
switch (csi_dev->fmt->pixelformat) {
if (status & BIT_RFF_OR_INT) {
dev_warn(csi_dev->dev, "%s Rx fifo overflow\n", __func__);
- if (*csi_dev->rx_fifo_rst)
+ if (csi_dev->soc->rx_fifo_rst)
csi_error_recovery(csi_dev);
}
of_id = of_match_node(mx6s_csi_dt_ids, csi_dev->dev->of_node);
if (!of_id)
return -EINVAL;
- csi_dev->rx_fifo_rst = of_id->data;
+ csi_dev->soc = of_id->data;
snprintf(csi_dev->v4l2_dev.name,
sizeof(csi_dev->v4l2_dev.name), "CSI");
SET_RUNTIME_PM_OPS(mx6s_csi_runtime_suspend, mx6s_csi_runtime_resume, NULL)
};
-static const u8 mx6s_fifo_rst = true;
-static const u8 mx6sl_fifo_rst = false;
+static const struct mx6s_csi_soc mx6s_soc = {
+ .rx_fifo_rst = true,
+ .baseaddr_switch = 0,
+};
+static const struct mx6s_csi_soc mx6sl_soc = {
+ .rx_fifo_rst = false,
+ .baseaddr_switch = 0,
+};
+static const struct mx6s_csi_soc mx8mq_soc = {
+ .rx_fifo_rst = true,
+ .baseaddr_switch = 0x80030,
+};
static const struct of_device_id mx6s_csi_dt_ids[] = {
{ .compatible = "fsl,imx6s-csi",
- .data = &mx6s_fifo_rst,
+ .data = &mx6s_soc,
},
{ .compatible = "fsl,imx6sl-csi",
- .data = &mx6sl_fifo_rst,
+ .data = &mx6sl_soc,
+ },
+ { .compatible = "fsl,imx8mq-csi",
+ .data = &mx8mq_soc,
},
{ /* sentinel */ }
};