ARM: tegra: power: Set cpu_pwr_off timer to 200us for PMIC
[linux-2.6.git] / arch / arm / mach-tegra / board-cardhu-power.c
old mode 100755 (executable)
new mode 100644 (file)
index 35cbb92..e982514
@@ -239,23 +239,33 @@ TPS_PDATA_INIT_SUPPLY(ldo6, 1000, 3300, VIO, 0, 0, 0, -1, 0, 0, 0);
 TPS_PDATA_INIT_SUPPLY(ldo7, 1000, 3300, VIO, 0, 0, 0, -1, 0, 0, 0);
 TPS_PDATA_INIT_SUPPLY(ldo8, 1000, 3300, VIO, 0, 0, 0, -1, 0, 0, 0);
 
+#if defined(CONFIG_RTC_DRV_TPS6591x)
 static struct tps6591x_rtc_platform_data rtc_data = {
        .irq = TEGRA_NR_IRQS + TPS6591X_INT_RTC_ALARM,
+       .time = {
+               .tm_year = 2000,
+               .tm_mon = 0,
+               .tm_mday = 1,
+               .tm_hour = 0,
+               .tm_min = 0,
+               .tm_sec = 0,
+       },
 };
 
-#define TPS_REG(_id, _data)                            \
-       {                                               \
-               .id     = TPS6591X_ID_##_id,            \
-               .name   = "tps6591x-regulator",         \
-               .platform_data  = &pdata_##_data,       \
-       }
-
 #define TPS_RTC_REG()                          \
        {                                               \
                .id     = 0,            \
                .name   = "rtc_tps6591x",       \
                .platform_data = &rtc_data,     \
        }
+#endif
+
+#define TPS_REG(_id, _data)                            \
+       {                                               \
+               .id     = TPS6591X_ID_##_id,            \
+               .name   = "tps6591x-regulator",         \
+               .platform_data  = &pdata_##_data,       \
+       }
 
 static struct tps6591x_subdev_info tps_devs_e118x[] = {
        TPS_REG(VIO, vio),
@@ -270,7 +280,9 @@ static struct tps6591x_subdev_info tps_devs_e118x[] = {
        TPS_REG(LDO_6, ldo6),
        TPS_REG(LDO_7, ldo7),
        TPS_REG(LDO_8, ldo8),
+#if defined(CONFIG_RTC_DRV_TPS6591x)
        TPS_RTC_REG(),
+#endif
 };
 
 static struct tps6591x_subdev_info tps_devs_e1198[] = {
@@ -286,7 +298,9 @@ static struct tps6591x_subdev_info tps_devs_e1198[] = {
        TPS_REG(LDO_6, ldo6),
        TPS_REG(LDO_7, ldo7),
        TPS_REG(LDO_8, ldo8),
+#if defined(CONFIG_RTC_DRV_TPS6591x)
        TPS_RTC_REG(),
+#endif
 };
 
 static struct tps6591x_platform_data tps_platform = {
@@ -500,6 +514,11 @@ static struct regulator_consumer_supply gpio_switch_en_1v8_cam_supply[] = {
 };
 static int gpio_switch_en_1v8_cam_voltages[] = { 1800};
 
+static struct regulator_consumer_supply gpio_switch_en_vbrtr_supply[] = {
+       REGULATOR_SUPPLY("vdd_vbrtr", NULL),
+};
+static int gpio_switch_en_vbrtr_voltages[] = { 3300};
+
 static int enable_load_switch_rail(
                struct gpio_switch_regulator_subdev_data *psubdev_data)
 {
@@ -619,6 +638,8 @@ GREG_INIT(19, cam2_ldo_en,  cam2_ldo_en,            "vdd_3v3_cam",  TEGRA_GPIO_PR7,         false,
 GREG_INIT(20, en_vdd_bl1_a03,  en_vdd_bl,      NULL,           TEGRA_GPIO_PDD2,        false,  1,      0,      0,      0);
 GREG_INIT(21, en_vdd_bl2_a03,  en_vdd_bl2,     NULL,           TEGRA_GPIO_PDD0,        false,  1,      0,      0,      0);
 
+GREG_INIT(22, en_vbrtr,        en_vbrtr, "vdd_3v3_devices",    PMU_TCA6416_GPIO_PORT12,                false,  0,      0,      0,      0);
+
 #define ADD_GPIO_REG(_name) &gpio_pdata_##_name
 #define COMMON_GPIO_REG \
        ADD_GPIO_REG(en_5v_cp),                 \
@@ -640,7 +661,8 @@ GREG_INIT(21, en_vdd_bl2_a03,       en_vdd_bl2,     NULL,           TEGRA_GPIO_PDD0,        false,  1,      0,
        ADD_GPIO_REG(dis_5v_switch_e118x),      \
        ADD_GPIO_REG(en_usb1_vbus_oc_e118x),    \
        ADD_GPIO_REG(en_usb3_vbus_oc_e118x),    \
-       ADD_GPIO_REG(en_vddio_vid_oc_e118x),
+       ADD_GPIO_REG(en_vddio_vid_oc_e118x), \
+       ADD_GPIO_REG(en_vbrtr),
 
 #define E1198_GPIO_REG \
        ADD_GPIO_REG(en_vddio_vid_oc),          \
@@ -726,21 +748,43 @@ int __init cardhu_gpio_switch_regulator_init(void)
 
 static struct tegra_suspend_platform_data cardhu_suspend_data = {
        .cpu_timer      = 2000,
-       .cpu_off_timer  = 0,
+       .cpu_off_timer  = 200,
        .suspend_mode   = TEGRA_SUSPEND_LP1,
        .core_timer     = 0x7e7e,
        .core_off_timer = 0,
        .separate_req   = true,
        .corereq_high   = false,
        .sysclkreq_high = true,
-       .wake_enb       = TEGRA_WAKE_GPIO_PV0 | TEGRA_WAKE_PWR_INT,
-       .wake_high      = 0,
+       .wake_enb       = TEGRA_WAKE_GPIO_PV0 | TEGRA_WAKE_PWR_INT | TEGRA_WAKE_RTC_ALARM,
+       .wake_high      = TEGRA_WAKE_RTC_ALARM,
        .wake_low       = TEGRA_WAKE_GPIO_PV0 | TEGRA_WAKE_PWR_INT,
        .wake_any       = 0,
+       .cpu_lp2_min_residency = 2000,
 };
 
 int __init cardhu_suspend_init(void)
 {
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
+       switch (board_info.board_id) {
+       case BOARD_E1291:
+               /* CORE_PWR_REQ to be high for E1291-A03 */
+               if (board_info.fab == 0x3)
+                       cardhu_suspend_data.corereq_high = true;
+               break;
+       case BOARD_E1198:
+               break;
+       case BOARD_PM269:
+       case BOARD_E1187:
+       case BOARD_E1186:
+               cardhu_suspend_data.cpu_timer = 5000;
+               cardhu_suspend_data.cpu_off_timer = 5000;
+               break;
+       default:
+               break;
+       }
+
        tegra_init_suspend(&cardhu_suspend_data);
        return 0;
 }