diff options
author | Troy Kisky <troy.kisky@boundarydevices.com> | 2012-10-05 14:15:01 -0700 |
---|---|---|
committer | Eric Nelson <eric.nelson@boundarydevices.com> | 2013-02-12 10:46:53 -0700 |
commit | a2c7a9c8f8bb4a2f7e818f0f5fe0b43e770f6c21 (patch) | |
tree | 6355b7c4629cd64eacef2c335ec040254b857d39 | |
parent | c53cd8ba2367f1f1d4b8ac120292bad27dd5987f (diff) |
Nitrogen6 SOM: mipi
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_sabrelite.c | 59 | ||||
-rw-r--r-- | arch/arm/mach-mx6/pads-mx6_sabrelite.h | 10 |
2 files changed, 57 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 = { diff --git a/arch/arm/mach-mx6/pads-mx6_sabrelite.h b/arch/arm/mach-mx6/pads-mx6_sabrelite.h index 0aa5dad9e971..63a556f6f47e 100644 --- a/arch/arm/mach-mx6/pads-mx6_sabrelite.h +++ b/arch/arm/mach-mx6/pads-mx6_sabrelite.h @@ -264,6 +264,14 @@ static iomux_v3_cfg_t MX6NAME(common_pads)[] = { 0 }; +#if defined(CONFIG_MXC_CAMERA_OV5640_MIPI) || defined(CONFIG_MXC_CAMERA_OV5640_MIPI_MODULE) +static iomux_v3_cfg_t MX6NAME(sabrelite_mipi_pads)[] = { + MX6PAD(NANDF_D5__GPIO_2_5), /* Camera Reset, Nitrogen6x */ + MX6PAD(NANDF_CS0__GPIO_6_11), /* Camera Reset, SOM jumpered */ + MX6PAD(GPIO_6__GPIO_1_6), /* Camera GP */ + 0 +}; +#else static iomux_v3_cfg_t MX6NAME(sabrelite_csi0_sensor_pads)[] = { /* IPU1 Camera */ MX6PAD(CSI0_DAT8__IPU1_CSI0_D_8), @@ -284,11 +292,13 @@ static iomux_v3_cfg_t MX6NAME(sabrelite_csi0_sensor_pads)[] = { MX6PAD(CSI0_VSYNC__IPU1_CSI0_VSYNC), MX6PAD(GPIO_6__GPIO_1_6), /* J5 - Camera GP */ MX6PAD(GPIO_8__GPIO_1_8), /* J5 - Camera Reset */ + MX6PAD(NANDF_CS0__GPIO_6_11), /* J5 - Camera Reset */ MX6PAD(SD1_DAT0__GPIO_1_16), /* J5 - Camera GP */ MX6PAD(NANDF_D5__GPIO_2_5), /* J16 - MIPI GP */ MX6PAD(NANDF_WP_B__GPIO_6_9), /* J16 - MIPI GP */ 0 }; +#endif static iomux_v3_cfg_t MX6NAME(sabrelite_hdmi_ddc_pads)[] = { MX6PAD(KEY_COL3__HDMI_TX_DDC_SCL), /* HDMI DDC SCL */ |