summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2011-05-02 17:19:36 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-05-02 18:04:35 -0700
commit2625b09d0e176c6ae1c4cd779ec1bb9f23c57e0b (patch)
treee81a9deeae11fc1d435f37a872db2db42ef6851d
parentc53b7eb26bee96fd7927e94848055af94baa831b (diff)
arm: tegra: ventana: switch on supply only when camera is opened
LDO_SHDN_L signals control AVDD_2P8V and VDD_AF_2P8V supplies to camera sensor modules. Power on these supplies only when camera is in use. BUG 782390 Change-Id: Ifefbb0b4da0b9213c4a2f76b51bcd3f2bbeb745d Reviewed-on: http://git-master/r/30015 Tested-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-by: Erik M Lilliebjerg <elilliebjerg@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-ventana-sensors.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c
index 6bc3d7d38bcd..666eeb4f8ef3 100644
--- a/arch/arm/mach-tegra/board-ventana-sensors.c
+++ b/arch/arm/mach-tegra/board-ventana-sensors.c
@@ -74,6 +74,8 @@ 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_LDO_SHUTDN_L_GPIO, 1);
+ mdelay(5);
gpio_direction_output(CAM2_PWR_DN_GPIO, 0);
mdelay(5);
gpio_direction_output(CAM2_RST_L_GPIO, 0);
@@ -88,6 +90,7 @@ 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);
gpio_direction_output(CAM2_PWR_DN_GPIO, 1);
+ gpio_direction_output(CAM2_LDO_SHUTDN_L_GPIO, 0);
return 0;
}
@@ -129,6 +132,8 @@ 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_LDO_SHUTDN_L_GPIO, 1);
+ mdelay(5);
gpio_direction_output(CAM3_PWR_DN_GPIO, 0);
mdelay(5);
gpio_direction_output(CAM3_RST_L_GPIO, 0);
@@ -142,6 +147,7 @@ static int ventana_ov2710_power_off(void)
{
gpio_direction_output(CAM3_RST_L_GPIO, 0);
gpio_direction_output(CAM3_PWR_DN_GPIO, 1);
+ gpio_direction_output(CAM3_LDO_SHUTDN_L_GPIO, 0);
gpio_direction_output(AVDD_DSI_CSI_ENB_GPIO, 0);
gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 0);
return 0;
@@ -455,17 +461,17 @@ static struct tegra_camera_gpios ventana_camera_gpio_keys[] = {
[0] = TEGRA_CAMERA_GPIO("en_avdd_csi", AVDD_DSI_CSI_ENB_GPIO, 1),
[1] = TEGRA_CAMERA_GPIO("cam_i2c_mux_rst_lo", CAM_I2C_MUX_RST_GPIO, 1),
- [2] = TEGRA_CAMERA_GPIO("cam2_ldo_shdn_lo", CAM2_LDO_SHUTDN_L_GPIO, 1),
+ [2] = TEGRA_CAMERA_GPIO("cam2_ldo_shdn_lo", CAM2_LDO_SHUTDN_L_GPIO, 0),
[3] = TEGRA_CAMERA_GPIO("cam2_af_pwdn_lo", CAM2_AF_PWR_DN_L_GPIO, 0),
[4] = TEGRA_CAMERA_GPIO("cam2_pwdn", CAM2_PWR_DN_GPIO, 0),
[5] = TEGRA_CAMERA_GPIO("cam2_rst_lo", CAM2_RST_L_GPIO, 1),
- [6] = TEGRA_CAMERA_GPIO("cam3_ldo_shdn_lo", CAM3_LDO_SHUTDN_L_GPIO, 1),
+ [6] = TEGRA_CAMERA_GPIO("cam3_ldo_shdn_lo", CAM3_LDO_SHUTDN_L_GPIO, 0),
[7] = TEGRA_CAMERA_GPIO("cam3_af_pwdn_lo", CAM3_AF_PWR_DN_L_GPIO, 0),
[8] = TEGRA_CAMERA_GPIO("cam3_pwdn", CAM3_PWR_DN_GPIO, 0),
[9] = TEGRA_CAMERA_GPIO("cam3_rst_lo", CAM3_RST_L_GPIO, 1),
- [10] = TEGRA_CAMERA_GPIO("cam1_ldo_shdn_lo", CAM1_LDO_SHUTDN_L_GPIO, 1),
+ [10] = TEGRA_CAMERA_GPIO("cam1_ldo_shdn_lo", CAM1_LDO_SHUTDN_L_GPIO, 0),
[11] = TEGRA_CAMERA_GPIO("cam1_af_pwdn_lo", CAM1_AF_PWR_DN_L_GPIO, 0),
[12] = TEGRA_CAMERA_GPIO("cam1_pwdn", CAM1_PWR_DN_GPIO, 0),
[13] = TEGRA_CAMERA_GPIO("cam1_rst_lo", CAM1_RST_L_GPIO, 1),