Commit 0ee00b96 authored by Wu Guoxing's avatar Wu Guoxing Committed by Jason Liu

ENGR00209062-1: mx6dq and mx6dl dual camera support

dual camera support for mx6q and mx6dl:
1. let mipi and parallel camera working on different csi
2. the two camera can work independently and synchronously
3. the two camera will be registered and different video
   device(/dev/video0, /dev/video1)
4. when both camera are working, the can not use the same
   ipu channel, that is, when camera one using PRP_ENC_MEM
   or PRP_VF_MEM channel, the other one can only use CSI_MEM

   this is the arch part changes.
Signed-off-by: default avatarWu Guoxing <b39297@freescale.com>
parent bf51c393
......@@ -585,6 +585,7 @@ static struct fsl_mxc_camera_platform_data camera_data = {
.analog_regulator = "DA9052_LDO7",
.core_regulator = "DA9052_LDO9",
.mclk = 24000000,
.mclk_source = 0,
.csi = 0,
.io_init = mx6_csi0_io_init,
};
......@@ -646,15 +647,15 @@ static void mx6_mipi_sensor_io_init(void)
mxc_iomux_v3_setup_multiple_pads(mipi_sensor_pads,
mipi_sensor_pads_cnt);
if (cpu_is_mx6q())
mxc_iomux_set_gpr_register(1, 19, 1, 0);
/*for mx6dl, mipi virtual channel 1 connect to csi 1*/
if (cpu_is_mx6dl())
mxc_iomux_set_gpr_register(13, 0, 3, 0);
mxc_iomux_set_gpr_register(13, 3, 3, 1);
}
static struct fsl_mxc_camera_platform_data ov5640_mipi_data = {
.mclk = 24000000,
.csi = 0,
.csi = 1,
.mclk_source = 0,
.io_init = mx6_mipi_sensor_io_init,
};
......@@ -1524,6 +1525,21 @@ static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.pixel_clk = "emi_clk",
};
static struct fsl_mxc_capture_platform_data capture_data[] = {
{
.csi = 0,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 0,
}, {
.csi = 1,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 1,
},
};
static void arm2_suspend_enter(void)
{
/* suspend preparation */
......@@ -2076,7 +2092,8 @@ static void __init mx6_arm2_init(void)
imx6q_add_lcdif(&lcdif_data);
imx6q_add_ldb(&ldb_data);
imx6q_add_v4l2_output(0);
imx6q_add_v4l2_capture(0);
imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_imx_snvs_rtc();
......
......@@ -1268,6 +1268,21 @@ static struct mxc_spdif_platform_data mxc_spdif_data = {
.spdif_clk = NULL, /* spdif bus clk */
};
static struct fsl_mxc_capture_platform_data capture_data[] = {
{
.csi = 0,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 0,
}, {
.csi = 1,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 1,
},
};
/*!
* Board specific initialization.
*/
......@@ -1404,7 +1419,8 @@ static void __init mx6_board_init(void)
imx6q_add_lcdif(&lcdif_data);
imx6q_add_ldb(&ldb_data);
imx6q_add_v4l2_output(0);
imx6q_add_v4l2_capture(0);
imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_android_device_buttons();
imx6q_add_imx_snvs_rtc();
......
......@@ -595,6 +595,7 @@ static void mx6q_csi0_io_init(void)
static struct fsl_mxc_camera_platform_data camera_data = {
.mclk = 24000000,
.mclk_source = 0,
.csi = 0,
.io_init = mx6q_csi0_io_init,
};
......@@ -831,6 +832,21 @@ static struct imx_ipuv3_platform_data ipu_data[] = {
},
};
static struct fsl_mxc_capture_platform_data capture_data[] = {
{
.csi = 0,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 0,
}, {
.csi = 1,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 1,
},
};
static void sabrelite_suspend_enter(void)
{
/* suspend preparation */
......@@ -1086,7 +1102,8 @@ static void __init mx6_sabrelite_board_init(void)
imx6q_add_lcdif(&lcdif_data);
imx6q_add_ldb(&ldb_data);
imx6q_add_v4l2_output(0);
imx6q_add_v4l2_capture(0);
imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_mipi_csi2(&mipi_csi2_pdata);
imx6q_add_imx_snvs_rtc();
......
......@@ -510,6 +510,7 @@ static void mx6q_csi0_io_init(void)
static struct fsl_mxc_camera_platform_data camera_data = {
.mclk = 22000000,
.mclk_source = 0,
.csi = 0,
.io_init = mx6q_csi0_io_init,
.pwdn = mx6q_csi0_cam_powerdown,
......@@ -542,16 +543,15 @@ static void mx6q_mipi_sensor_io_init(void)
msleep(1);
gpio_set_value(SABRESD_MIPICSI_PWN, 0);
if (cpu_is_mx6q())
mxc_iomux_set_gpr_register(1, 19, 1, 0);
if (cpu_is_mx6dl()) {
mxc_iomux_set_gpr_register(13, 0, 3, 0);
}
/*for mx6dl, mipi virtual channel 1 connect to csi 1*/
if (cpu_is_mx6dl())
mxc_iomux_set_gpr_register(13, 3, 3, 1);
}
static struct fsl_mxc_camera_platform_data mipi_csi2_data = {
.mclk = 24000000,
.csi = 0,
.mclk_source = 0,
.csi = 1,
.io_init = mx6q_mipi_sensor_io_init,
.pwdn = mx6q_mipi_powerdown,
};
......@@ -1301,6 +1301,21 @@ static struct imx_ipuv3_platform_data ipu_data[] = {
},
};
static struct fsl_mxc_capture_platform_data capture_data[] = {
{
.csi = 0,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 0,
}, {
.csi = 1,
.ipu = 0,
.mclk_source = 0,
.is_mipi = 1,
},
};
static void sabresd_suspend_enter(void)
{
/* suspend preparation */
......@@ -1530,7 +1545,7 @@ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags,
static struct mipi_csi2_platform_data mipi_csi2_pdata = {
.ipu_id = 0,
.csi_id = 0,
.csi_id = 1,
.v_channel = 0,
.lanes = 2,
.dphy_clk = "mipi_pllref_clk",
......@@ -1629,7 +1644,8 @@ static void __init mx6_sabresd_board_init(void)
imx6q_add_lcdif(&lcdif_data);
imx6q_add_ldb(&ldb_data);
imx6q_add_v4l2_output(0);
imx6q_add_v4l2_capture(0);
imx6q_add_v4l2_capture(0, &capture_data[0]);
imx6q_add_v4l2_capture(1, &capture_data[1]);
imx6q_add_mipi_csi2(&mipi_csi2_pdata);
imx6q_add_imx_snvs_rtc();
......
......@@ -123,9 +123,9 @@ extern const struct imx_ldb_data imx6q_ldb_data __initconst;
platform_device_register_resndata(NULL, "mxc_v4l2_output",\
id, NULL, 0, NULL, 0);
#define imx6q_add_v4l2_capture(id) \
#define imx6q_add_v4l2_capture(id, pdata) \
platform_device_register_resndata(NULL, "mxc_v4l2_capture",\
id, NULL, 0, NULL, 0);
id, NULL, 0, pdata, sizeof(*pdata));
extern const struct imx_mxc_hdmi_data imx6q_mxc_hdmi_data __initconst;
#define imx6q_add_mxc_hdmi(pdata) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment