summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorFrank Chen <frankc@nvidia.com>2011-04-06 18:36:47 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-04-15 18:35:08 -0700
commita6ac65bb8221f1e6af798215858bcad385c14058 (patch)
tree2e228a4b973048a6284cb2588fc09f5c572a1b89 /arch
parentc20dd5116d966629a88536443121425b2655ef67 (diff)
ARM: tegra: whistler: Add support for AD5820 focuser
Bug 783488 Change-Id: I609ed3c7d87633af53244357bc630fc7de00073c Reviewed-on: http://git-master/r/26973 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-whistler-sensors.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-sensors.c b/arch/arm/mach-tegra/board-whistler-sensors.c
index f077822bb2df..e31a5b20eb1d 100644
--- a/arch/arm/mach-tegra/board-whistler-sensors.c
+++ b/arch/arm/mach-tegra/board-whistler-sensors.c
@@ -91,6 +91,7 @@ static int whistler_ov5650_power_on(void)
regulator_enable(reg_avdd_cam1);
}
mdelay(5);
+
if (!reg_vdd_mipi) {
reg_vdd_mipi = regulator_get(NULL, "vddio_mipi");
if (IS_ERR_OR_NULL(reg_vdd_mipi)) {
@@ -100,6 +101,18 @@ static int whistler_ov5650_power_on(void)
}
regulator_enable(reg_vdd_mipi);
}
+ mdelay(5);
+
+ if (!reg_vdd_af) {
+ reg_vdd_af = regulator_get(NULL, "vdd_vcore_af");
+ if (IS_ERR_OR_NULL(reg_vdd_af)) {
+ pr_err("whistler_ov5650_power_on: vdd_vcore_af failed\n");
+ reg_vdd_af = NULL;
+ return PTR_ERR(reg_vdd_af);
+ }
+ regulator_enable(reg_vdd_af);
+ }
+ mdelay(5);
gpio_set_value(CAMERA1_RESET_GPIO, 1);
mdelay(10);
@@ -107,12 +120,14 @@ static int whistler_ov5650_power_on(void)
mdelay(5);
gpio_set_value(CAMERA1_RESET_GPIO, 1);
mdelay(20);
+ gpio_set_value(CAMERA_AF_PD_GPIO, 1);
return 0;
}
static int whistler_ov5650_power_off(void)
{
+ gpio_set_value(CAMERA_AF_PD_GPIO, 0);
gpio_set_value(CAMERA1_PWDN_GPIO, 1);
gpio_set_value(CAMERA1_RESET_GPIO, 0);
@@ -122,6 +137,12 @@ static int whistler_ov5650_power_off(void)
reg_avdd_cam1 = NULL;
}
+ if (reg_vdd_mipi) {
+ regulator_disable(reg_vdd_mipi);
+ regulator_put(reg_vdd_mipi);
+ reg_vdd_mipi = NULL;
+ }
+
if (reg_vdd_af) {
regulator_disable(reg_vdd_af);
regulator_put(reg_vdd_af);
@@ -141,6 +162,9 @@ static struct i2c_board_info whistler_i2c3_board_info[] = {
I2C_BOARD_INFO("ov5650", 0x36),
.platform_data = &whistler_ov5650_data,
},
+ {
+ I2C_BOARD_INFO("ad5820", 0x0c),
+ },
};
static void whistler_adxl34x_init(void)