diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2011-04-07 17:52:39 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:16 -0800 |
commit | 071e09f316d41cfaaa5158ec246c2ef0d5ca9923 (patch) | |
tree | 62de621399e511cf0843b04c7b4dfab9bed443a5 /arch/arm/mach-tegra/board-ventana-sensors.c | |
parent | d43a190fabaef8db3121a6770f7716c7d0c11856 (diff) |
ARM: tegra: ventana: updated on/off handlers for left/right ov5650
Bug 809921
Original-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>
Rebase-Id: Ra1606d537d88ec62ee670bd299a7be73a96b66ef
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana-sensors.c')
-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 aaf6518d0683..57af9431f5f9 100644 --- a/arch/arm/mach-tegra/board-ventana-sensors.c +++ b/arch/arm/mach-tegra/board-ventana-sensors.c @@ -61,20 +61,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); @@ -82,37 +83,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) @@ -120,11 +122,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; } @@ -239,15 +241,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), @@ -380,7 +382,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){ |