diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2011-03-16 16:05:32 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-03-17 21:26:58 -0800 |
commit | bad0e2e77226fd3e21bfff1d2847c8adcdf9bd14 (patch) | |
tree | cd787f37f89a5727f0ee489478985faf31bf69e4 | |
parent | 8c0f23b7e65ebdb6d1c160517e9ba509b16ec83f (diff) |
ARM: tegra: ventana: camera: Set LDO6 to 1.8V
By default ldo6 is set to 2.85V. Ventana camera require it
to set to 1.8V.
Bug 799890
Change-Id: Ic538f946a8a8330a39dbbc5d6f2198e770b4167f
Reviewed-on: http://git-master/r/23144
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-ventana-sensors.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-sensors.c b/arch/arm/mach-tegra/board-ventana-sensors.c index d144cc3d0d99..e640e1f31d9d 100644 --- a/arch/arm/mach-tegra/board-ventana-sensors.c +++ b/arch/arm/mach-tegra/board-ventana-sensors.c @@ -25,6 +25,8 @@ #include <linux/i2c/pca954x.h> #include <linux/i2c/pca953x.h> #include <linux/nct1008.h> +#include <linux/err.h> +#include <linux/regulator/consumer.h> #include <mach/gpio.h> @@ -403,10 +405,29 @@ int __init ventana_ov5650_late_init(void) { int ret; int i; + struct regulator *cam_ldo6 = NULL; if (!machine_is_ventana()) return 0; + cam_ldo6 = regulator_get(NULL, "vdd_ldo6"); + if (IS_ERR_OR_NULL(cam_ldo6)) { + pr_err("%s: Couldn't get regulator ldo6\n", __func__); + return PTR_ERR(cam_ldo6); + } + + ret = regulator_set_voltage(cam_ldo6, 1800*1000, 1800*1000); + if (ret){ + pr_err("%s: Failed to set ldo6 to 1.8v\n", __func__); + goto fail_put_regulator; + } + + ret = regulator_enable(cam_ldo6); + if (ret){ + pr_err("%s: Failed to enable ldo6\n", __func__); + goto fail_put_regulator; + } + i2c_new_device(i2c_get_adapter(3), ventana_i2c3_board_info_tca6416); for (i = 0; i < ARRAY_SIZE(ov5650_gpio_keys); i++) { @@ -415,7 +436,7 @@ int __init ventana_ov5650_late_init(void) if (ret < 0) { pr_err("%s: gpio_request failed for gpio #%d\n", __func__, i); - goto fail; + goto fail_free_gpio; } gpio_direction_output(ov5650_gpio_keys[i].gpio, ov5650_gpio_keys[i].enabled); @@ -423,13 +444,25 @@ int __init ventana_ov5650_late_init(void) } i2c_new_device(i2c_get_adapter(3), ventana_i2c3_board_info_pca9546); + ventana_ov2710_power_off(); ventana_ov5650s_power_off(); + + ret = regulator_disable(cam_ldo6); + if (ret){ + pr_err("%s: Failed to disable ldo6\n", __func__); + goto fail_free_gpio; + } + + regulator_put(cam_ldo6); return 0; -fail: +fail_free_gpio: while (i--) gpio_free(ov5650_gpio_keys[i].gpio); + +fail_put_regulator: + regulator_put(cam_ldo6); return ret; } |