diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2011-04-07 17:52:39 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-04-14 21:24:05 -0700 |
commit | 687b35f2d8b2709dc3f6efc7a0079a52de96b790 (patch) | |
tree | 4ffb91a54ee7440eb6a2525610841087c1dabcbe | |
parent | 7cd09b6a4a9bc23f5a5aa0ec2f67b70b7c9a2a4a (diff) |
ARM: tegra: ventana: updated on/off handlers for left/right ov5650
Bug 809921
Change-Id: I3de13b3e53471c2550284b41e52fc191bba87f8b
Reviewed-on: http://git-master/r/27033
Tested-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: George Bauernschmidt <georgeb@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-sensors.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c index 45dfe6fa5a87..874009abb568 100644 --- a/arch/arm/mach-tegra/board-ventana-sensors.c +++ b/arch/arm/mach-tegra/board-ventana-sensors.c @@ -62,20 +62,21 @@ static int ventana_camera_init(void) return 0; } -static int ventana_ov5650_power_on(void) +/* left ov5650 is CAM2 which is on csi_a */ +static int ventana_left_ov5650_power_on(void) { gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 0); gpio_direction_output(AVDD_DSI_CSI_ENB_GPIO, 1); gpio_direction_output(CAM2_PWR_DN_GPIO, 0); - msleep(5); + mdelay(5); gpio_direction_output(CAM2_RST_L_GPIO, 0); - msleep(1); + mdelay(1); gpio_direction_output(CAM2_RST_L_GPIO, 1); - msleep(20); + mdelay(20); return 0; } -static int ventana_ov5650_power_off(void) +static int ventana_left_ov5650_power_off(void) { gpio_direction_output(AVDD_DSI_CSI_ENB_GPIO, 0); gpio_direction_output(CAM2_RST_L_GPIO, 0); @@ -83,37 +84,38 @@ static int ventana_ov5650_power_off(void) return 0; } -struct ov5650_platform_data ventana_ov5650_data = { - .power_on = ventana_ov5650_power_on, - .power_off = ventana_ov5650_power_off, +struct ov5650_platform_data ventana_left_ov5650_data = { + .power_on = ventana_left_ov5650_power_on, + .power_off = ventana_left_ov5650_power_off, }; -static int ventana_ov5650s_power_on(void) +/* right ov5650 is CAM1 which is on csi_b */ +static int ventana_right_ov5650_power_on(void) { - ventana_ov5650_power_on(); + gpio_direction_output(AVDD_DSI_CSI_ENB_GPIO, 1); gpio_direction_output(CAM1_LDO_SHUTDN_L_GPIO, 1); - msleep(5); + mdelay(5); gpio_direction_output(CAM1_PWR_DN_GPIO, 0); - msleep(5); + mdelay(5); gpio_direction_output(CAM1_RST_L_GPIO, 0); - msleep(1); + mdelay(1); gpio_direction_output(CAM1_RST_L_GPIO, 1); - msleep(20); + mdelay(20); return 0; } -static int ventana_ov5650s_power_off(void) +static int ventana_right_ov5650_power_off(void) { + gpio_direction_output(AVDD_DSI_CSI_ENB_GPIO, 0); gpio_direction_output(CAM1_RST_L_GPIO, 0); gpio_direction_output(CAM1_PWR_DN_GPIO, 1); gpio_direction_output(CAM1_LDO_SHUTDN_L_GPIO, 0); - ventana_ov5650_power_off(); return 0; } -struct ov5650_platform_data ventana_ov5650s_data = { - .power_on = ventana_ov5650s_power_on, - .power_off = ventana_ov5650s_power_off, +struct ov5650_platform_data ventana_right_ov5650_data = { + .power_on = ventana_right_ov5650_power_on, + .power_off = ventana_right_ov5650_power_off, }; static int ventana_ov2710_power_on(void) @@ -121,11 +123,11 @@ static int ventana_ov2710_power_on(void) gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 1); gpio_direction_output(AVDD_DSI_CSI_ENB_GPIO, 1); gpio_direction_output(CAM3_PWR_DN_GPIO, 0); - msleep(5); + mdelay(5); gpio_direction_output(CAM3_RST_L_GPIO, 0); - msleep(1); + mdelay(1); gpio_direction_output(CAM3_RST_L_GPIO, 1); - msleep(20); + mdelay(20); return 0; } @@ -245,15 +247,15 @@ static struct i2c_board_info ventana_i2c4_board_info[] = { static struct i2c_board_info ventana_i2c6_board_info[] = { { - I2C_BOARD_INFO("ov5650s", 0x36), - .platform_data = &ventana_ov5650s_data, + I2C_BOARD_INFO("ov5650R", 0x36), + .platform_data = &ventana_right_ov5650_data, }, }; static struct i2c_board_info ventana_i2c7_board_info[] = { { - I2C_BOARD_INFO("ov5650", 0x36), - .platform_data = &ventana_ov5650_data, + I2C_BOARD_INFO("ov5650L", 0x36), + .platform_data = &ventana_left_ov5650_data, }, { I2C_BOARD_INFO("sh532u", 0x72), @@ -446,7 +448,8 @@ int __init ventana_camera_late_init(void) i2c_new_device(i2c_get_adapter(3), ventana_i2c3_board_info_pca9546); ventana_ov2710_power_off(); - ventana_ov5650s_power_off(); + ventana_left_ov5650_power_off(); + ventana_right_ov5650_power_off(); ret = regulator_disable(cam_ldo6); if (ret){ |