diff options
author | Sang-Hun Lee <sanlee@nvidia.com> | 2012-08-17 16:54:05 -0700 |
---|---|---|
committer | Mrutyunjay Sawant <msawant@nvidia.com> | 2012-09-05 03:45:57 -0700 |
commit | 5c13235fdd38404b3b785aa5c2d7e6f51e4bfb53 (patch) | |
tree | 88bd4dc1352553a7592e6ab0c79cf181b5a31daf /arch | |
parent | 6f61e5baa83ef8c75746eabe90be0588f6d86b37 (diff) |
ARM: tegra: kai: adjust ov2710 power sequence
Update the power sequence to match the specification
Bug 1031318
Reviewed-on: http://git-master/r/124496
(cherry picked from commit d2b1e1ddb2e65482eb15698b925471daf573a7ba)
Change-Id: I837cafb494571816ee6ef25ea8159fc0de9fb2f5
Signed-off-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-on: http://git-master/r/128945
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-kai-sensors.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/arch/arm/mach-tegra/board-kai-sensors.c b/arch/arm/mach-tegra/board-kai-sensors.c index 29d1bea2e8a7..048c39c9759f 100644 --- a/arch/arm/mach-tegra/board-kai-sensors.c +++ b/arch/arm/mach-tegra/board-kai-sensors.c @@ -179,8 +179,15 @@ static int kai_camera_init(void) static int kai_ov2710_power_on(void) { - gpio_direction_output(CAM2_POWER_DWN_GPIO, 0); - mdelay(10); + if (kai_1v8_cam3 == NULL) { + kai_1v8_cam3 = regulator_get(NULL, "vdd_1v8_cam3"); + if (WARN_ON(IS_ERR(kai_1v8_cam3))) { + pr_err("%s: couldn't get regulator vdd_1v8_cam3: %d\n", + __func__, (int)PTR_ERR(kai_1v8_cam3)); + goto reg_get_vdd_1v8_cam3_fail; + } + } + regulator_enable(kai_1v8_cam3); if (kai_vdd_cam3 == NULL) { kai_vdd_cam3 = regulator_get(NULL, "vdd_cam3"); @@ -191,43 +198,36 @@ static int kai_ov2710_power_on(void) } } regulator_enable(kai_vdd_cam3); - - if (kai_1v8_cam3 == NULL) { - kai_1v8_cam3 = regulator_get(NULL, "vdd_1v8_cam3"); - if (WARN_ON(IS_ERR(kai_1v8_cam3))) { - pr_err("%s: couldn't get regulator vdd_1v8_cam3: %d\n", - __func__, (int)PTR_ERR(kai_1v8_cam3)); - goto reg_get_vdd_1v8_cam3_fail; - } - } - regulator_enable(kai_1v8_cam3); mdelay(5); + gpio_direction_output(CAM2_POWER_DWN_GPIO, 0); + mdelay(10); + gpio_direction_output(CAM2_RST_GPIO, 1); mdelay(10); return 0; -reg_get_vdd_1v8_cam3_fail: - kai_1v8_cam3 = NULL; - regulator_put(kai_vdd_cam3); - reg_get_vdd_cam3_fail: kai_vdd_cam3 = NULL; + regulator_put(kai_1v8_cam3); + +reg_get_vdd_1v8_cam3_fail: + kai_1v8_cam3 = NULL; return -ENODEV; } static int kai_ov2710_power_off(void) { - gpio_direction_output(CAM2_POWER_DWN_GPIO, 1); - gpio_direction_output(CAM2_RST_GPIO, 0); - if (kai_1v8_cam3) - regulator_disable(kai_1v8_cam3); + gpio_direction_output(CAM2_POWER_DWN_GPIO, 1); + if (kai_vdd_cam3) regulator_disable(kai_vdd_cam3); + if (kai_1v8_cam3) + regulator_disable(kai_1v8_cam3); return 0; } |