arm: tegra: cardhu: TPS61050 board support
Erik Lilliebjerg [Thu, 1 Dec 2011 12:44:07 +0000 (05:44 -0700)]
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>

arch/arm/mach-tegra/board-cardhu-power.c
arch/arm/mach-tegra/board-cardhu-sensors.c

index 149eddd..b9aaf89 100644 (file)
@@ -625,6 +625,7 @@ static struct regulator_consumer_supply gpio_switch_en_1v8_cam_supply[] = {
        REGULATOR_SUPPLY("vdd_1v8_cam3", NULL),
        REGULATOR_SUPPLY("vdd_i2c", "6-0072"),
        REGULATOR_SUPPLY("vdd_i2c", "7-0072"),
+       REGULATOR_SUPPLY("vdd_i2c", "2-0033"),
 };
 static int gpio_switch_en_1v8_cam_voltages[] = { 1800};
 
index c7b5658..8dbdb42 100644 (file)
@@ -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,
        },
 };