summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Huang <chahuang@nvidia.com>2012-08-10 16:26:34 -0700
committerSimone Willett <swillett@nvidia.com>2012-08-20 16:23:15 -0700
commite2862b9cd75bb9f608db0c33bef47f3952df5f26 (patch)
treef6ffda5f923cbc8962c5886f73af74617cf908e0
parent856f955552e8dbdf3b4a25c3eb648bcd5193cacf (diff)
ARM: tegra: cardhu: adjust ov2710 power sequence
To fix an instability issue, the power sequence is updated to match the specification for this device. bug 1031318 Change-Id: I3970af7ae8ed2baa6060f548242b0093040afb53 Signed-off-by: Charlie Huang <chahuang@nvidia.com> Reviewed-on: http://git-master/r/122867 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Patrick Shehane <pshehane@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-cardhu-sensors.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-sensors.c b/arch/arm/mach-tegra/board-cardhu-sensors.c
index bb6a2ae5774d..7e9774f290eb 100644
--- a/arch/arm/mach-tegra/board-cardhu-sensors.c
+++ b/arch/arm/mach-tegra/board-cardhu-sensors.c
@@ -340,7 +340,7 @@ static int cardhu_right_ov5650_power_off(void)
gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 0);
/* Boards E1198 and E1291 are of Cardhu personality
- * and donot have TCA6416 exp for camera */
+ * and do not have TCA6416 for camera */
if ((board_info.board_id == BOARD_E1198) ||
(board_info.board_id == BOARD_E1291)) {
gpio_direction_output(CAM1_POWER_DWN_GPIO, 1);
@@ -387,16 +387,21 @@ static int cardhu_ov2710_power_on(void)
/* CSI-B and front sensor are muxed on cardhu */
gpio_direction_output(CAMERA_CSI_MUX_SEL_GPIO, 1);
+ /* Enable VDD_1V8_Cam3 */
+ if (cardhu_1v8_cam3 == NULL) {
+ cardhu_1v8_cam3 = regulator_get(NULL, "vdd_1v8_cam3");
+ if (WARN_ON(IS_ERR(cardhu_1v8_cam3))) {
+ pr_err("%s: couldn't get regulator vdd_1v8_cam3: %ld\n",
+ __func__, PTR_ERR(cardhu_1v8_cam3));
+ goto reg_alloc_fail;
+ }
+ }
+ regulator_enable(cardhu_1v8_cam3);
+
/* Boards E1198 and E1291 are of Cardhu personality
- * and donot have TCA6416 exp for camera */
+ * and do not have TCA6416 for camera */
if ((board_info.board_id == BOARD_E1198) ||
(board_info.board_id == BOARD_E1291)) {
-
- gpio_direction_output(CAM1_POWER_DWN_GPIO, 0);
- gpio_direction_output(CAM2_POWER_DWN_GPIO, 0);
- gpio_direction_output(CAM3_POWER_DWN_GPIO, 0);
- mdelay(10);
-
if (cardhu_vdd_cam3 == NULL) {
cardhu_vdd_cam3 = regulator_get(NULL, "vdd_cam3");
if (WARN_ON(IS_ERR(cardhu_vdd_cam3))) {
@@ -406,19 +411,17 @@ static int cardhu_ov2710_power_on(void)
}
}
regulator_enable(cardhu_vdd_cam3);
- }
- /* Enable VDD_1V8_Cam3 */
- if (cardhu_1v8_cam3 == NULL) {
- cardhu_1v8_cam3 = regulator_get(NULL, "vdd_1v8_cam3");
- if (WARN_ON(IS_ERR(cardhu_1v8_cam3))) {
- pr_err("%s: couldn't get regulator vdd_1v8_cam3: %ld\n",
- __func__, PTR_ERR(cardhu_1v8_cam3));
- goto reg_alloc_fail;
- }
+ mdelay(5);
+
+ gpio_direction_output(CAM1_POWER_DWN_GPIO, 0);
+ gpio_direction_output(CAM2_POWER_DWN_GPIO, 0);
+ gpio_direction_output(CAM3_POWER_DWN_GPIO, 0);
+ mdelay(10);
+
}
- regulator_enable(cardhu_1v8_cam3);
- mdelay(5);
+
+ mdelay(20);
return 0;
@@ -447,12 +450,12 @@ static int cardhu_ov2710_power_off(void)
gpio_direction_output(CAM1_POWER_DWN_GPIO, 1);
gpio_direction_output(CAM2_POWER_DWN_GPIO, 1);
gpio_direction_output(CAM3_POWER_DWN_GPIO, 1);
+ if (cardhu_vdd_cam3)
+ regulator_disable(cardhu_vdd_cam3);
}
if (cardhu_1v8_cam3)
regulator_disable(cardhu_1v8_cam3);
- if (cardhu_vdd_cam3)
- regulator_disable(cardhu_vdd_cam3);
return 0;
}