diff options
author | Erik Lilliebjerg <elilliebjerg@nvidia.com> | 2011-12-01 05:44:07 -0700 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-08 18:04:45 +0530 |
commit | fb24a74f356b1bb97e9bf81ce694d0d9191e49ed (patch) | |
tree | dc84230cc161652fc8d677e06ed01b6406d16f7d /arch/arm/mach-tegra/board-cardhu-sensors.c | |
parent | f674050c9063a9d11ec33681bfcca89f6c62b067 (diff) |
arm: tegra: cardhu: TPS61050 board support
Bug 860351
Bug 850614
Bug 852480
Bug 872156
Bug 824459
Change-Id: I60366c7eb918a76860dbbc087407d3f89663c00d
Signed-off-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Reviewed-on: http://git-master/r/66166
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-sensors.c')
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-sensors.c | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-sensors.c b/arch/arm/mach-tegra/board-cardhu-sensors.c index c7b56583a88a..8dbdb42ba2e4 100644 --- a/arch/arm/mach-tegra/board-cardhu-sensors.c +++ b/arch/arm/mach-tegra/board-cardhu-sensors.c @@ -478,66 +478,20 @@ static struct sh532u_platform_data sh532u_right_pdata = { .gpio_reset = TEGRA_GPIO_PBB0, }; -static bool cardhu_tps61050_pm_flag = 0; - -static struct tps61050_pin_state cardhu_tps61050_pinstate = { +static struct nvc_torch_pin_state cardhu_tps61050_pinstate = { .mask = 0x0008, /*VGP3*/ .values = 0x0008, }; -static int cardhu_tps61050_pm(int pwr) -{ - switch (pwr) { - case TPS61050_PWR_OFF: - if (cardhu_tps61050_pm_flag && cardhu_1v8_cam1) { - regulator_disable(cardhu_1v8_cam1); - cardhu_tps61050_pm_flag = 0; - } - return 0; - - case TPS61050_PWR_STDBY: - case TPS61050_PWR_COMM: - case TPS61050_PWR_ON: - if (!cardhu_tps61050_pm_flag) { - if (cardhu_1v8_cam1 == NULL) { - cardhu_1v8_cam1 = - regulator_get(NULL, "vdd_1v8_cam1"); - if (WARN_ON(IS_ERR(cardhu_1v8_cam1))) { - pr_err("%s: err: %ld\n", - __func__, - PTR_ERR(cardhu_1v8_cam1)); - regulator_put(cardhu_1v8_cam1); - cardhu_1v8_cam1 = NULL; - } - } - regulator_enable(cardhu_1v8_cam1); - cardhu_tps61050_pm_flag = 1; - mdelay(5); - } - return 0; - - default: - return -1; - } -} - -static struct tps61050_platform_data cardhu_tps61050_data = { - .cfg = 0, - .num = 1, - .max_amp_torch = CAMERA_FLASH_MAX_TORCH_AMP, - .max_amp_flash = CAMERA_FLASH_MAX_FLASH_AMP, +static struct tps61050_platform_data cardhu_tps61050_pdata = { + .dev_name = "torch", .pinstate = &cardhu_tps61050_pinstate, - .init = NULL, - .exit = NULL, - .pm = cardhu_tps61050_pm, - .gpio_envm = NULL, - .gpio_sync = NULL, }; static const struct i2c_board_info cardhu_i2c_board_info_tps61050[] = { { I2C_BOARD_INFO("tps61050", 0x33), - .platform_data = &cardhu_tps61050_data, + .platform_data = &cardhu_tps61050_pdata, }, }; |