diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2011-03-16 16:05:32 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:14 -0800 |
commit | be9f2503cbbae683450c0e7175a39d12486d24cb (patch) | |
tree | 5c5c2e37439d54acd8d8688ea2bd3e43d8147201 /arch/arm/mach-tegra/board-ventana-sensors.c | |
parent | dfd43f2b3342ad4c649cd0d50ee058cd5bb39b7d (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
Original-Change-Id: Ic538f946a8a8330a39dbbc5d6f2198e770b4167f
Reviewed-on: http://git-master/r/23144
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: R2eac0475e743fda09e22506d1800a08a5ea1a3f5
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana-sensors.c')
-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 598b8fc22ba6..fbcdc6e67f0d 100644 --- a/arch/arm/mach-tegra/board-ventana-sensors.c +++ b/arch/arm/mach-tegra/board-ventana-sensors.c @@ -24,6 +24,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> @@ -337,10 +339,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++) { @@ -349,7 +370,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); @@ -357,13 +378,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; } |