diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2011-03-16 16:05:32 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-03-18 14:55:48 -0800 |
commit | 693aaef157e3c5044d116dd0b157bdb233639adf (patch) | |
tree | d7329f7ade67dbfe0d85854a9a54a675d0a977af | |
parent | c7831cb27fc6a2701b020676a6daf9c76e9470d9 (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: Ib14d1b96de1c838834da171e4f3c1f85e5db2281
(cherry picked from commit 83fe26dfcb2b89076105a2d6c5dc84c87f9e1465)
Reviewed-on: http://git-master/r/23184
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Tested-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@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 5bbba54ddc0f..ed8636306f03 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> @@ -400,10 +402,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++) { @@ -412,7 +433,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); @@ -420,13 +441,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; } |