summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx6/board-mx6q_sabrelite.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx6/board-mx6q_sabrelite.c')
-rw-r--r--arch/arm/mach-mx6/board-mx6q_sabrelite.c59
1 files changed, 47 insertions, 12 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_sabrelite.c b/arch/arm/mach-mx6/board-mx6q_sabrelite.c
index a5b76d30602c..bc48251d8bd7 100644
--- a/arch/arm/mach-mx6/board-mx6q_sabrelite.c
+++ b/arch/arm/mach-mx6/board-mx6q_sabrelite.c
@@ -215,6 +215,7 @@ static int plt_sd_pad_change(unsigned int index, int clock)
return IOMUX_SETUP(sd_pads[i]);
}
+#ifdef CONFIG_WL12XX_PLATFORM_DATA
static struct esdhc_platform_data mx6_sabrelite_sd2_data = {
.always_present = 1,
.cd_gpio = -1,
@@ -223,6 +224,7 @@ static struct esdhc_platform_data mx6_sabrelite_sd2_data = {
.caps = MMC_CAP_POWER_OFF_CARD,
.platform_pad_change = plt_sd_pad_change,
};
+#endif
static struct esdhc_platform_data mx6_sabrelite_sd3_data = {
.cd_gpio = MX6_SABRELITE_SD3_CD,
@@ -397,24 +399,48 @@ static void mx6_csi0_cam_powerdown(int powerdown)
msleep(2);
}
-static void mx6_csi0_io_init(void)
+static void camera_reset(int power_gp, int reset_gp, int reset_gp2)
{
- IOMUX_SETUP(sabrelite_csi0_sensor_pads);
-
/* Camera power down */
- gpio_request(MX6_SABRELITE_CSI0_PWN, "cam-pwdn");
- gpio_direction_output(MX6_SABRELITE_CSI0_PWN, 1);
+ gpio_request(power_gp, "cam-pwdn");
+ gpio_request(reset_gp, "cam-reset");
+ gpio_request(reset_gp2, "cam-reset2");
+ gpio_direction_output(power_gp, 1);
+ /* Camera reset */
+ gpio_direction_output(reset_gp, 0);
+ gpio_direction_output(reset_gp2, 0);
+ msleep(1);
+ gpio_set_value(power_gp, 0);
msleep(1);
- gpio_set_value(MX6_SABRELITE_CSI0_PWN, 0);
+ gpio_set_value(reset_gp, 1);
+ gpio_set_value(reset_gp2, 1);
+}
- /* Camera reset */
- gpio_request(MX6_SABRELITE_CSI0_RST, "cam-reset");
- gpio_direction_output(MX6_SABRELITE_CSI0_RST, 1);
+#if defined(CONFIG_MXC_CAMERA_OV5640_MIPI) || defined(CONFIG_MXC_CAMERA_OV5640_MIPI_MODULE)
+static void mx6_mipi_sensor_io_init(void)
+{
+ IOMUX_SETUP(sabrelite_mipi_pads);
- gpio_set_value(MX6_SABRELITE_CSI0_RST, 0);
- msleep(1);
- gpio_set_value(MX6_SABRELITE_CSI0_RST, 1);
+ camera_reset(MX6_SABRELITE_CSI0_PWN, IMX_GPIO_NR(2, 5),
+ IMX_GPIO_NR(6, 11));
+/*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 ov5640_mipi_data = {
+ .mclk = 24000000,
+ .csi = 0,
+ .io_init = mx6_mipi_sensor_io_init,
+ .pwdn = mx6_csi0_cam_powerdown,
+};
+#else
+static void mx6_csi0_io_init(void)
+{
+ IOMUX_SETUP(sabrelite_csi0_sensor_pads);
+
+ camera_reset(MX6_SABRELITE_CSI0_PWN, MX6_SABRELITE_CSI0_RST,
+ IMX_GPIO_NR(6, 11));
/* For MX6Q GPR1 bit19 and bit20 meaning:
* Bit19: 0 - Enable mipi to IPU1 CSI0
* virtual channel is fixed to 0
@@ -441,14 +467,23 @@ static struct fsl_mxc_camera_platform_data camera_data = {
.pwdn = mx6_csi0_cam_powerdown,
};
+#endif
+
static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {
{
I2C_BOARD_INFO("mxc_hdmi_i2c", 0x50),
},
+#if defined(CONFIG_MXC_CAMERA_OV5640_MIPI) || defined(CONFIG_MXC_CAMERA_OV5640_MIPI_MODULE)
+ {
+ I2C_BOARD_INFO("ov5640_mipi", 0x3c),
+ .platform_data = (void *)&ov5640_mipi_data,
+ },
+#else
{
I2C_BOARD_INFO("ov5642", 0x3c),
.platform_data = (void *)&camera_data,
},
+#endif
};
static struct tsc2007_platform_data tsc2007_info = {