ARM: tegra11x: Define ncpu residency for 2 clusters
[linux-3.10.git] / arch / arm / mach-tegra / board-dalmore-power.c
index d28f600..fe6084a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-dalmore-power.c
  *
- * Copyright (C) 2012 NVIDIA Corporation.
+ * Copyright (C) 2012-2013 NVIDIA Corporation.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
 #include <linux/regulator/tps65090-regulator.h>
 #include <linux/regulator/tps51632-regulator.h>
 #include <linux/gpio.h>
+#include <linux/interrupt.h>
 #include <linux/regulator/userspace-consumer.h>
 
 #include <asm/mach-types.h>
+#include <linux/power/sbs-battery.h>
 
-#include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/edp.h>
 #include <mach/gpio-tegra.h>
 #include "tegra-board-id.h"
 #include "board.h"
 #include "gpio-names.h"
+#include "board-common.h"
 #include "board-dalmore.h"
 #include "tegra_cl_dvfs.h"
 #include "devices.h"
 #include "tegra11_soctherm.h"
+#include "iomap.h"
+#include "tegra3_tsensor.h"
 
 #define PMC_CTRL               0x0
 #define PMC_CTRL_INTR_LOW      (1 << 17)
-
+#define TPS65090_CHARGER_INT   TEGRA_GPIO_PJ0
 /*TPS65090 consumer rails */
 static struct regulator_consumer_supply tps65090_dcdc1_supply[] = {
        REGULATOR_SUPPLY("vdd_sys_5v0", NULL),
@@ -75,6 +79,7 @@ static struct regulator_consumer_supply tps65090_dcdc2_supply[] = {
        REGULATOR_SUPPLY("vdd_sys_dtv_3v3", NULL),
        REGULATOR_SUPPLY("vcc", "0-007c"),
        REGULATOR_SUPPLY("vcc", "0-0030"),
+       REGULATOR_SUPPLY("vin", "2-0030"),
 };
 
 static struct regulator_consumer_supply tps65090_dcdc3_supply[] = {
@@ -99,7 +104,7 @@ static struct regulator_consumer_supply tps65090_fet3_supply[] = {
 
 static struct regulator_consumer_supply tps65090_fet4_supply[] = {
        REGULATOR_SUPPLY("avdd_lcd", NULL),
-       REGULATOR_SUPPLY("vdd_ts_3v3", NULL),
+       REGULATOR_SUPPLY("avdd", "spi3.2"),
 };
 
 static struct regulator_consumer_supply tps65090_fet5_supply[] = {
@@ -111,13 +116,13 @@ static struct regulator_consumer_supply tps65090_fet6_supply[] = {
 };
 
 static struct regulator_consumer_supply tps65090_fet7_supply[] = {
-       REGULATOR_SUPPLY("vdd_wifi_3v3", NULL),
-       REGULATOR_SUPPLY("vdd_gps_3v3", NULL),
-       REGULATOR_SUPPLY("vdd_bt_3v3", NULL),
+       REGULATOR_SUPPLY("vdd_wifi_3v3", "bcm4329_wlan.1"),
+       REGULATOR_SUPPLY("vdd_gps_3v3", "reg-userspace-consumer.2"),
+       REGULATOR_SUPPLY("vdd_bt_3v3", "bluedroid_pm.0"),
 };
 
 #define TPS65090_PDATA_INIT(_id, _name, _supply_reg,                   \
-               _always_on, _boot_on, _apply_uV, _en_ext_ctrl, _gpio)   \
+       _always_on, _boot_on, _apply_uV, _en_ext_ctrl, _gpio, _wait_to) \
 static struct regulator_init_data ri_data_##_name =                    \
 {                                                                      \
        .supply_regulator = _supply_reg,                                \
@@ -143,19 +148,20 @@ static struct tps65090_regulator_platform_data                            \
        .enable_ext_control = _en_ext_ctrl,                             \
        .gpio = _gpio,                                                  \
        .reg_init_data = &ri_data_##_name ,                             \
+       .wait_timeout_us = _wait_to,                                    \
 }
 
-TPS65090_PDATA_INIT(DCDC1, dcdc1, NULL, 1, 1, 0, false, -1);
-TPS65090_PDATA_INIT(DCDC2, dcdc2, NULL, 1, 1, 0, false, -1);
-TPS65090_PDATA_INIT(DCDC3, dcdc3, NULL, 1, 1, 0, false, -1);
-TPS65090_PDATA_INIT(LDO1, ldo1, NULL, 1, 1, 0, false, -1);
-TPS65090_PDATA_INIT(LDO2, ldo2, NULL, 1, 1, 0, false, -1);
-TPS65090_PDATA_INIT(FET1, fet1, NULL, 0, 0, 0, false, -1);
-TPS65090_PDATA_INIT(FET3, fet3, tps65090_rails(DCDC2), 0, 0, 0, false, -1);
-TPS65090_PDATA_INIT(FET4, fet4, tps65090_rails(DCDC2), 1, 1, 0, false, -1); /* always_on and boot_on */
-TPS65090_PDATA_INIT(FET5, fet5, tps65090_rails(DCDC2), 0, 0, 0, false, -1);
-TPS65090_PDATA_INIT(FET6, fet6, tps65090_rails(DCDC2), 0, 0, 0, false, -1);
-TPS65090_PDATA_INIT(FET7, fet7, tps65090_rails(DCDC2), 0, 0, 0, false, -1);
+TPS65090_PDATA_INIT(DCDC1, dcdc1, NULL, 1, 1, 0, true, -1, -1);
+TPS65090_PDATA_INIT(DCDC2, dcdc2, NULL, 1, 1, 0, true, -1, -1);
+TPS65090_PDATA_INIT(DCDC3, dcdc3, NULL, 1, 1, 0, true, -1, -1);
+TPS65090_PDATA_INIT(LDO1, ldo1, NULL, 1, 1, 0, false, -1, -1);
+TPS65090_PDATA_INIT(LDO2, ldo2, NULL, 1, 1, 0, false, -1, -1);
+TPS65090_PDATA_INIT(FET1, fet1, NULL, 0, 0, 0, false, -1, 800);
+TPS65090_PDATA_INIT(FET3, fet3, tps65090_rails(DCDC2), 0, 0, 0, false, -1, 0);
+TPS65090_PDATA_INIT(FET4, fet4, tps65090_rails(DCDC2), 0, 0, 0, false, -1, 0);
+TPS65090_PDATA_INIT(FET5, fet5, tps65090_rails(DCDC2), 0, 0, 0, false, -1, 0);
+TPS65090_PDATA_INIT(FET6, fet6, tps65090_rails(DCDC2), 0, 0, 0, false, -1, 0);
+TPS65090_PDATA_INIT(FET7, fet7, tps65090_rails(DCDC2), 0, 0, 0, false, -1, 0);
 
 #define ADD_TPS65090_REG(_name) (&tps65090_regulator_pdata_##_name)
 static struct tps65090_regulator_platform_data *tps65090_reg_pdata[] = {
@@ -172,10 +178,17 @@ static struct tps65090_regulator_platform_data *tps65090_reg_pdata[] = {
        ADD_TPS65090_REG(fet7),
 };
 
+static struct tps65090_charger_data bcharger_pdata = {
+       .irq_base = TPS65090_TEGRA_IRQ_BASE,
+       .update_status = sbs_update,
+};
+
 static struct tps65090_platform_data tps65090_pdata = {
-       .irq_base = -1,
+       .irq_base = TPS65090_TEGRA_IRQ_BASE,
+       .irq_flag = IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
        .num_reg_pdata =  ARRAY_SIZE(tps65090_reg_pdata),
-       .reg_pdata = tps65090_reg_pdata
+       .reg_pdata = tps65090_reg_pdata,
+       .charger_pdata = &bcharger_pdata,
 };
 
 /* MAX77663 consumer rails */
@@ -193,7 +206,7 @@ static struct regulator_consumer_supply max77663_sd2_supply[] = {
        REGULATOR_SUPPLY("avdd_usb_pll", "tegra-udc.0"),
        REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.0"),
        REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.1"),
-       REGULATOR_SUPPLY("vddio_cam", "tegra_camera"),
+       REGULATOR_SUPPLY("vddio_cam", "vi"),
        REGULATOR_SUPPLY("pwrdet_cam", NULL),
        REGULATOR_SUPPLY("avdd_osc", NULL),
        REGULATOR_SUPPLY("vddio_sys", NULL),
@@ -219,14 +232,14 @@ static struct regulator_consumer_supply max77663_sd2_supply[] = {
        REGULATOR_SUPPLY("vdd_mic_1v8", NULL),
        REGULATOR_SUPPLY("vdd_nfc_1v8", NULL),
        REGULATOR_SUPPLY("vdd_ds_1v8", NULL),
-       REGULATOR_SUPPLY("vdd_ts_1v8", NULL),
        REGULATOR_SUPPLY("vdd_spi_1v8", NULL),
        REGULATOR_SUPPLY("dvdd_lcd", NULL),
        REGULATOR_SUPPLY("vdd_com_1v8", NULL),
-       REGULATOR_SUPPLY("vddio_wifi_1v8", NULL),
-       REGULATOR_SUPPLY("vdd_gps_1v8", NULL),
-       REGULATOR_SUPPLY("vddio_bt_1v8", NULL),
+       REGULATOR_SUPPLY("vddio_wifi_1v8", "bcm4329_wlan.1"),
+       REGULATOR_SUPPLY("vdd_gps_1v8", "reg-userspace-consumer.2"),
+       REGULATOR_SUPPLY("vddio_bt_1v8", "bluedroid_pm.0"),
        REGULATOR_SUPPLY("vdd_dtv_1v8", NULL),
+       REGULATOR_SUPPLY("vlogic", "0-0069"),
 };
 
 static struct regulator_consumer_supply max77663_sd3_supply[] = {
@@ -241,7 +254,7 @@ static struct regulator_consumer_supply max77663_ldo0_supply[] = {
        REGULATOR_SUPPLY("avdd_pllu", NULL),
        REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegradc.0"),
        REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegradc.1"),
-       REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegra_camera"),
+       REGULATOR_SUPPLY("avdd_csi_dsi_pll", "vi"),
 };
 
 static struct regulator_consumer_supply max77663_ldo1_supply[] = {
@@ -252,6 +265,7 @@ static struct regulator_consumer_supply max77663_ldo2_supply[] = {
        REGULATOR_SUPPLY("vdd_sensor_2v85", NULL),
        REGULATOR_SUPPLY("vdd_als", NULL),
        REGULATOR_SUPPLY("vdd", "0-004c"),
+       REGULATOR_SUPPLY("vdd", "0-0069"),
 };
 
 static struct regulator_consumer_supply max77663_ldo3_supply[] = {
@@ -267,9 +281,10 @@ static struct regulator_consumer_supply max77663_ldo4_supply[] = {
 static struct regulator_consumer_supply max77663_ldo5_supply[] = {
        REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.0"),
        REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.1"),
-       REGULATOR_SUPPLY("avdd_dsi_csi", "tegra_camera"),
+       REGULATOR_SUPPLY("avdd_dsi_csi", "vi"),
        REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.1"),
        REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.2"),
+       REGULATOR_SUPPLY("vddio_hsic", "tegra-xhci"),
        REGULATOR_SUPPLY("pwrdet_mipi", NULL),
        REGULATOR_SUPPLY("vddio_bb_hsic", NULL),
 };
@@ -283,11 +298,13 @@ static struct regulator_consumer_supply max77663_ldo6_supply[] = {
 static struct regulator_consumer_supply max77663_ldo7_supply[] = {
        REGULATOR_SUPPLY("avdd_cam1", NULL),
        REGULATOR_SUPPLY("avdd_2v8_cam_af", NULL),
+       REGULATOR_SUPPLY("vana", "2-0036"),
 };
 
 /* FIXME!! Put the device address of camera */
 static struct regulator_consumer_supply max77663_ldo8_supply[] = {
        REGULATOR_SUPPLY("avdd_cam2", NULL),
+       REGULATOR_SUPPLY("avdd", "2-0010"),
 };
 
 static struct max77663_regulator_fps_cfg max77663_fps_cfgs[] = {
@@ -504,6 +521,7 @@ static struct regulator_init_data tps51632_init_data = {
                                        REGULATOR_MODE_STANDBY),        \
                .valid_ops_mask = (REGULATOR_CHANGE_MODE |              \
                                        REGULATOR_CHANGE_STATUS |       \
+                                        REGULATOR_CHANGE_CONTROL |     \
                                        REGULATOR_CHANGE_VOLTAGE),      \
                .always_on = 1,                                         \
                .boot_on =  1,                                          \
@@ -537,6 +555,7 @@ static struct regulator_consumer_supply palmas_smps12_supply[] = {
 
 #define palmas_smps3_supply max77663_sd2_supply
 #define palmas_smps45_supply max77663_sd0_supply
+#define palmas_smps457_supply max77663_sd0_supply
 
 static struct regulator_consumer_supply palmas_smps8_supply[] = {
        REGULATOR_SUPPLY("avdd_plla_p_c", NULL),
@@ -547,11 +566,12 @@ static struct regulator_consumer_supply palmas_smps8_supply[] = {
        REGULATOR_SUPPLY("avdd_plle", NULL),
        REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegradc.0"),
        REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegradc.1"),
-       REGULATOR_SUPPLY("avdd_csi_dsi_pll", "tegra_camera"),
+       REGULATOR_SUPPLY("avdd_csi_dsi_pll", "vi"),
        REGULATOR_SUPPLY("avdd_hdmi_pll", "tegradc.1"),
        REGULATOR_SUPPLY("avdd_usb_pll", "tegra-ehci.2"),
        REGULATOR_SUPPLY("avddio_usb", "tegra-ehci.2"),
-
+       REGULATOR_SUPPLY("avddio_usb", "tegra-xhci"),
+       REGULATOR_SUPPLY("avdd_usb_pll", "tegra-xhci"),
 };
 
 static struct regulator_consumer_supply palmas_smps9_supply[] = {
@@ -570,6 +590,7 @@ static struct regulator_consumer_supply palmas_ldo4_supply[] = {
 
 static struct regulator_consumer_supply palmas_ldo7_supply[] = {
        REGULATOR_SUPPLY("vdd_af_cam1", NULL),
+       REGULATOR_SUPPLY("vdd", "2-000e"),
 };
 
 #define palmas_ldo8_supply max77663_ldo4_supply
@@ -577,6 +598,7 @@ static struct regulator_consumer_supply palmas_ldo7_supply[] = {
 
 static struct regulator_consumer_supply palmas_ldoln_supply[] = {
        REGULATOR_SUPPLY("hvdd_usb", "tegra-ehci.2"),
+       REGULATOR_SUPPLY("hvdd_usb", "tegra-xhci"),
 };
 
 static struct regulator_consumer_supply palmas_ldousb_supply[] = {
@@ -612,8 +634,9 @@ static struct regulator_consumer_supply palmas_ldousb_supply[] = {
 PALMAS_PDATA_INIT(smps12, 1350,  1350, tps65090_rails(DCDC3), 0, 0, 0);
 PALMAS_PDATA_INIT(smps3, 1800,  1800, tps65090_rails(DCDC3), 0, 0, 0);
 PALMAS_PDATA_INIT(smps45, 900,  1400, tps65090_rails(DCDC2), 1, 1, 0);
+PALMAS_PDATA_INIT(smps457, 900,  1400, tps65090_rails(DCDC2), 1, 1, 0);
 PALMAS_PDATA_INIT(smps8, 1050,  1050, tps65090_rails(DCDC2), 0, 1, 1);
-PALMAS_PDATA_INIT(smps9, 2800,  2800, tps65090_rails(DCDC2), 0, 0, 0);
+PALMAS_PDATA_INIT(smps9, 2800,  2800, tps65090_rails(DCDC2), 1, 0, 0);
 PALMAS_PDATA_INIT(ldo1, 2800,  2800, tps65090_rails(DCDC2), 0, 0, 1);
 PALMAS_PDATA_INIT(ldo2, 2800,  2800, tps65090_rails(DCDC2), 0, 0, 1);
 PALMAS_PDATA_INIT(ldo3, 1200,  1200, palmas_rails(smps3), 0, 0, 1);
@@ -632,7 +655,7 @@ static struct regulator_init_data *dalmore_e1611_reg_data[PALMAS_NUM_REGS] = {
        NULL,
        PALMAS_REG_PDATA(smps3),
        PALMAS_REG_PDATA(smps45),
-       NULL,
+       PALMAS_REG_PDATA(smps457),
        NULL,
        NULL,
        PALMAS_REG_PDATA(smps8),
@@ -670,10 +693,10 @@ PALMAS_REG_INIT(smps12, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps123, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps3, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps45, 0, PALMAS_EXT_CONTROL_NSLEEP, 0, 0, 0);
-PALMAS_REG_INIT(smps457, 0, 0, 0, 0, 0);
+PALMAS_REG_INIT(smps457, 0, PALMAS_EXT_CONTROL_NSLEEP, 0, 0, 0);
 PALMAS_REG_INIT(smps6, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps7, 0, 0, 0, 0, 0);
-PALMAS_REG_INIT(smps8, 0, 0, 0, 0, 0);
+PALMAS_REG_INIT(smps8, 0, PALMAS_EXT_CONTROL_NSLEEP, 0, 0, 0);
 PALMAS_REG_INIT(smps9, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps10, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldo1, 0, 0, 0, 0, 0);
@@ -684,7 +707,7 @@ PALMAS_REG_INIT(ldo5, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldo6, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldo7, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldo8, 0, 0, 0, 0, 0);
-PALMAS_REG_INIT(ldo9, 0, 0, 0, 0, 0);
+PALMAS_REG_INIT(ldo9, 1, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldoln, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldousb, 0, 0, 0, 0, 0);
 PALMAS_REG_INIT(regen1, 0, 0, 0, 0, 0);
@@ -728,14 +751,21 @@ static struct palmas_pmic_platform_data pmic_platform = {
        .disabe_ldo8_tracking_suspend = true,
 };
 
+static struct palmas_rtc_platform_data rtc_platform = {
+       .enable_charging = 1,
+       .charging_current_ua = 100,
+};
+
 static struct palmas_platform_data palmas_pdata = {
        .gpio_base = PALMAS_TEGRA_GPIO_BASE,
        .irq_base = PALMAS_TEGRA_IRQ_BASE,
        .pmic_pdata = &pmic_platform,
+       .rtc_pdata = &rtc_platform,
        .mux_from_pdata = true,
        .pad1 = 0,
        .pad2 = 0,
        .pad3 = PALMAS_PRIMARY_SECONDARY_PAD3_DVFS1,
+       .use_power_off = true,
 };
 
 static struct i2c_board_info palma_device[] = {
@@ -758,20 +788,28 @@ static struct regulator_consumer_supply fixed_reg_avdd_usb_hdmi_supply[] = {
 
 /* EN_CAM_1v8 From PMU GP5 */
 static struct regulator_consumer_supply fixed_reg_en_1v8_cam_supply[] = {
-       REGULATOR_SUPPLY("dvdd_cam", NULL),
-       REGULATOR_SUPPLY("vdd_cam_1v8", NULL),
+       REGULATOR_SUPPLY("vi2c", "2-0030"),
+       REGULATOR_SUPPLY("vif", "2-0036"),
+       REGULATOR_SUPPLY("dovdd", "2-0010"),
+       REGULATOR_SUPPLY("vdd_i2c", "2-000e"),
 };
 
 /* EN_CAM_1v8 on e1611 From PMU GP6 */
 static struct regulator_consumer_supply fixed_reg_en_1v8_cam_e1611_supply[] = {
-       REGULATOR_SUPPLY("dvdd_cam", NULL),
-       REGULATOR_SUPPLY("vdd_cam_1v8", NULL),
+       REGULATOR_SUPPLY("vi2c", "2-0030"),
+       REGULATOR_SUPPLY("vif", "2-0036"),
+       REGULATOR_SUPPLY("dovdd", "2-0010"),
+       REGULATOR_SUPPLY("vdd_i2c", "2-000e"),
 };
 
 static struct regulator_consumer_supply fixed_reg_vdd_hdmi_5v0_supply[] = {
        REGULATOR_SUPPLY("vdd_hdmi_5v0", "tegradc.1"),
 };
 
+static struct regulator_consumer_supply fixed_reg_lcd_bl_en_supply[] = {
+       REGULATOR_SUPPLY("vdd_lcd_bl_en", NULL),
+};
+
 /* EN_USB1_VBUS From TEGRA GPIO PN4 PR3(T30) */
 static struct regulator_consumer_supply fixed_reg_usb1_vbus_supply[] = {
        REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
@@ -785,6 +823,12 @@ static struct regulator_consumer_supply fixed_reg_vpp_fuse_supply[] = {
 /* EN_USB3_VBUS From TEGRA GPIO PM5 */
 static struct regulator_consumer_supply fixed_reg_usb3_vbus_supply[] = {
        REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.2"),
+       REGULATOR_SUPPLY("usb_vbus", "tegra-xhci"),
+};
+
+/* EN_1V8_TS From TEGRA_GPIO_PH5 */
+static struct regulator_consumer_supply fixed_reg_dvdd_ts_supply[] = {
+       REGULATOR_SUPPLY("dvdd", "spi3.2"),
 };
 
 /* Macro for defining fixed regulator sub device data */
@@ -841,15 +885,9 @@ FIXED_REG(4,       vpp_fuse,       vpp_fuse,
        max77663_rails(sd2),    0,      0,
        TEGRA_GPIO_PX4, false,  true,   0,      3300);
 
-#ifdef CONFIG_ARCH_TEGRA_11x_SOC
 FIXED_REG(5,   usb1_vbus,      usb1_vbus,
        tps65090_rails(DCDC1),  0,      0,
        TEGRA_GPIO_PN4, true,   true,   0,      5000);
-#else
-FIXED_REG(5,   usb1_vbus,      usb1_vbus,
-       tps65090_rails(DCDC1),  0,      0,
-       TEGRA_GPIO_PR3, true,   true,   0,      5000);
-#endif
 
 FIXED_REG(6,   usb3_vbus,      usb3_vbus,
        tps65090_rails(DCDC1),  0,      0,
@@ -859,6 +897,13 @@ FIXED_REG(7,       en_1v8_cam_e1611,       en_1v8_cam_e1611,
        palmas_rails(smps3),    0,      0,
        PALMAS_TEGRA_GPIO_BASE + PALMAS_GPIO6,  false,  true,   0,      1800);
 
+FIXED_REG(8,   dvdd_ts,        dvdd_ts,
+       palmas_rails(smps3),    0,      0,
+       TEGRA_GPIO_PH5, false,  false,  1,      1800);
+
+FIXED_REG(9,   lcd_bl_en,      lcd_bl_en,
+       NULL,   0,      0,
+       TEGRA_GPIO_PH2, false,  true,   0,      5000);
 /*
  * Creating the fixed regulator device tables
  */
@@ -868,7 +913,8 @@ FIXED_REG(7,        en_1v8_cam_e1611,       en_1v8_cam_e1611,
 #define DALMORE_COMMON_FIXED_REG               \
        ADD_FIXED_REG(usb1_vbus),               \
        ADD_FIXED_REG(usb3_vbus),               \
-       ADD_FIXED_REG(vdd_hdmi_5v0),
+       ADD_FIXED_REG(vdd_hdmi_5v0),            \
+       ADD_FIXED_REG(lcd_bl_en),
 
 #define E1612_FIXED_REG                                \
        ADD_FIXED_REG(avdd_usb_hdmi),           \
@@ -876,7 +922,8 @@ FIXED_REG(7,        en_1v8_cam_e1611,       en_1v8_cam_e1611,
        ADD_FIXED_REG(vpp_fuse),                \
 
 #define E1611_FIXED_REG                                \
-       ADD_FIXED_REG(en_1v8_cam_e1611),
+       ADD_FIXED_REG(en_1v8_cam_e1611), \
+       ADD_FIXED_REG(dvdd_ts),
 
 /* Gpio switch regulator platform data for Dalmore E1611 */
 static struct platform_device *fixed_reg_devs_e1611_a00[] = {
@@ -895,16 +942,7 @@ int __init dalmore_palmas_regulator_init(void)
        void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
        u32 pmc_ctrl;
        int i;
-#ifdef CONFIG_ARCH_TEGRA_3x_SOC
-       int ret;
 
-       ret = gpio_request(TEGRA_GPIO_PCC3, "pmic_nreswarm");
-       if (ret < 0)
-               pr_err("%s: gpio_request failed for gpio %d\n",
-                               __func__, TEGRA_GPIO_PCC3);
-       else
-               gpio_direction_output(TEGRA_GPIO_PCC3, 1);
-#endif
        /* TPS65913: Normal state of INT request line is LOW.
         * configure the power management controller to trigger PMU
         * interrupts when HIGH.
@@ -947,15 +985,15 @@ static struct platform_device dalmore_pda_power_device = {
 };
 
 static struct tegra_suspend_platform_data dalmore_suspend_data = {
-       .cpu_timer      = 2000,
-       .cpu_off_timer  = 2000,
+       .cpu_timer      = 300,
+       .cpu_off_timer  = 300,
        .suspend_mode   = TEGRA_SUSPEND_LP0,
        .core_timer     = 0x157e,
        .core_off_timer = 2000,
        .corereq_high   = true,
        .sysclkreq_high = true,
-       .min_residency_noncpu = 600,
-       .min_residency_crail = 1000,
+       .cpu_lp2_min_residency = 1000,
+       .min_residency_crail = 20000,
 };
 #ifdef CONFIG_ARCH_TEGRA_HAS_CL_DVFS
 /* board parameters for cpu dfll */
@@ -1026,25 +1064,25 @@ static int __init dalmore_max77663_regulator_init(void)
        return 0;
 }
 
-static struct regulator_bulk_data dalmore_bt_regulator_supply[] = {
+static struct regulator_bulk_data dalmore_gps_regulator_supply[] = {
        [0] = {
-               .supply = "vdd_bt_3v3",
+               .supply = "vdd_gps_3v3",
        },
        [1] = {
-               .supply = "vddio_bt_1v8",
+               .supply = "vdd_gps_1v8",
        },
 };
 
-static struct regulator_userspace_consumer_data dalmore_bt_regulator_pdata = {
-       .num_supplies   = ARRAY_SIZE(dalmore_bt_regulator_supply),
-       .supplies       = dalmore_bt_regulator_supply,
+static struct regulator_userspace_consumer_data dalmore_gps_regulator_pdata = {
+       .num_supplies   = ARRAY_SIZE(dalmore_gps_regulator_supply),
+       .supplies       = dalmore_gps_regulator_supply,
 };
 
-static struct platform_device dalmore_bt_regulator_device = {
+static struct platform_device dalmore_gps_regulator_device = {
        .name   = "reg-userspace-consumer",
-       .id     = 1,
+       .id     = 2,
        .dev    = {
-                       .platform_data = &dalmore_bt_regulator_pdata,
+                       .platform_data = &dalmore_gps_regulator_pdata,
        },
 };
 
@@ -1057,7 +1095,8 @@ static int __init dalmore_fixed_regulator_init(void)
 
        tegra_get_board_info(&board_info);
 
-       if (board_info.board_id == BOARD_E1611)
+       if (board_info.board_id == BOARD_E1611 ||
+               board_info.board_id == BOARD_P2454)
                return platform_add_devices(fixed_reg_devs_e1611_a00,
                                ARRAY_SIZE(fixed_reg_devs_e1611_a00));
        else
@@ -1066,23 +1105,47 @@ static int __init dalmore_fixed_regulator_init(void)
 }
 subsys_initcall_sync(dalmore_fixed_regulator_init);
 
-int __init dalmore_regulator_init(void)
+static void dalmore_tps65090_init(void)
 {
-       struct board_info board_info;
+       int err;
+
+       err = gpio_request(TPS65090_CHARGER_INT, "CHARGER_INT");
+       if (err < 0) {
+               pr_err("%s: gpio_request failed %d\n", __func__, err);
+               goto fail_init_irq;
+       }
+
+       err = gpio_direction_input(TPS65090_CHARGER_INT);
+       if (err < 0) {
+               pr_err("%s: gpio_direction_input failed %d\n", __func__, err);
+               goto fail_init_irq;
+       }
+
+       tps65090_regulators[0].irq = gpio_to_irq(TPS65090_CHARGER_INT);
+fail_init_irq:
        i2c_register_board_info(4, tps65090_regulators,
                        ARRAY_SIZE(tps65090_regulators));
+       return;
+}
+
+int __init dalmore_regulator_init(void)
+{
+       struct board_info board_info;
+
+       dalmore_tps65090_init();
 #ifdef CONFIG_ARCH_TEGRA_HAS_CL_DVFS
        dalmore_cl_dvfs_init();
 #endif
        tegra_get_board_info(&board_info);
-       if (board_info.board_id == BOARD_E1611)
+       if (board_info.board_id == BOARD_E1611 ||
+               board_info.board_id == BOARD_P2454)
                dalmore_palmas_regulator_init();
        else
                dalmore_max77663_regulator_init();
 
        i2c_register_board_info(4, tps51632_boardinfo, 1);
        platform_device_register(&dalmore_pda_power_device);
-       platform_device_register(&dalmore_bt_regulator_device);
+       platform_device_register(&dalmore_gps_regulator_device);
        return 0;
 }
 
@@ -1094,7 +1157,6 @@ int __init dalmore_suspend_init(void)
 
 int __init dalmore_edp_init(void)
 {
-#ifdef CONFIG_TEGRA_EDP_LIMITS
        unsigned int regulator_mA;
 
        regulator_mA = get_maximum_cpu_current_supported();
@@ -1102,138 +1164,100 @@ int __init dalmore_edp_init(void)
                regulator_mA = 15000;
 
        pr_info("%s: CPU regulator %d mA\n", __func__, regulator_mA);
-
        tegra_init_cpu_edp_limits(regulator_mA);
-#endif
+
+       regulator_mA = get_maximum_core_current_supported();
+       if (!regulator_mA)
+               regulator_mA = 4000;
+
+       pr_info("%s: core regulator %d mA\n", __func__, regulator_mA);
+       tegra_init_core_edp_limits(regulator_mA);
+
        return 0;
 }
 
+static struct tegra_tsensor_pmu_data tpdata_palmas = {
+       .reset_tegra = 1,
+       .pmu_16bit_ops = 0,
+       .controller_type = 0,
+       .pmu_i2c_addr = 0x58,
+       .i2c_controller_id = 4,
+       .poweroff_reg_addr = 0xa0,
+       .poweroff_reg_data = 0x0,
+};
+
+static struct tegra_tsensor_pmu_data tpdata_max77663 = {
+       .reset_tegra = 1,
+       .pmu_16bit_ops = 0,
+       .controller_type = 0,
+       .pmu_i2c_addr = 0x3c,
+       .i2c_controller_id = 4,
+       .poweroff_reg_addr = 0x41,
+       .poweroff_reg_data = 0x80,
+};
+
 static struct soctherm_platform_data dalmore_soctherm_data = {
-       .hw_backstop = 60,
-       .dividend = 1,
-       .divisor = 2,
-       .duration = 1,
-       .step = 1,
-       .sensor_data = {
-               [TSENSE_CPU0] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
-               },
-               [TSENSE_CPU1] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
-               },
-               [TSENSE_CPU2] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
-               },
-               [TSENSE_CPU3] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
-               },
-               [TSENSE_MEM0] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
-               },
-               [TSENSE_MEM1] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
+       .therm = {
+               [THERM_CPU] = {
+                       .zone_enable = true,
+                       .passive_delay = 1000,
+                       .num_trips = 3,
+                       .trips = {
+                               {
+                                       .cdev_type = "tegra-balanced",
+                                       .trip_temp = 84000,
+                                       .trip_type = THERMAL_TRIP_PASSIVE,
+                                       .upper = THERMAL_NO_LIMIT,
+                                       .lower = THERMAL_NO_LIMIT,
+                               },
+                               {
+                                       .cdev_type = "tegra-heavy",
+                                       .trip_temp = 94000,
+                                       .trip_type = THERMAL_TRIP_HOT,
+                                       .upper = THERMAL_NO_LIMIT,
+                                       .lower = THERMAL_NO_LIMIT,
+                               },
+                               {
+                                       .cdev_type = "tegra-shutdown",
+                                       .trip_temp = 104000,
+                                       .trip_type = THERMAL_TRIP_CRITICAL,
+                                       .upper = THERMAL_NO_LIMIT,
+                                       .lower = THERMAL_NO_LIMIT,
+                               },
+                       },
                },
-               [TSENSE_GPU] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
+               [THERM_GPU] = {
+                       .zone_enable = true,
                },
-               [TSENSE_PLLX] = {
-                       .enable = true,
-                       .therm_a = 570,
-                       .therm_b = -744,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
+               [THERM_PLL] = {
+                       .zone_enable = true,
                },
        },
-
-       .thermtrip = {
-               [THERM_CPU] = 90,
-               [THERM_GPU] = 0, /* Not enabled */
-               [THERM_MEM] = 0, /* Not enabled */
-               [THERM_PLL] = 0, /* Not enabled */
-       },
-       .passive = {
-               [THERM_CPU] = {
-                       .trip_temp = 38000,
-                       .tc1 = 0,
-                       .tc2 = 1,
-                       .passive_delay = 2000,
-               }
-       },
-};
-
-static struct balanced_throttle tj_throttle = {
-       .throt_tab_size = 10,
-       .throt_tab = {
-               {      0, 1000 },
-               { 640000, 1000 },
-               { 640000, 1000 },
-               { 640000, 1000 },
-               { 640000, 1000 },
-               { 640000, 1000 },
-               { 760000, 1000 },
-               { 760000, 1050 },
-               {1000000, 1050 },
-               {1000000, 1100 },
+       .throttle = {
+               [THROTTLE_HEAVY] = {
+                       .devs = {
+                               [THROTTLE_DEV_CPU] = {
+                                       .enable = 1,
+                               },
+                       },
+               },
        },
+       .tshut_pmu_trip_data = &tpdata_palmas,
 };
 
-static int __init dalmore_soctherm_init(void)
+int __init dalmore_soctherm_init(void)
 {
-       dalmore_soctherm_data.passive[THERM_CPU].cdev =
-                       balanced_throttle_register(&tj_throttle);
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
+       if (!(board_info.board_id == BOARD_E1611 ||
+               board_info.board_id == BOARD_P2454))
+               dalmore_soctherm_data.tshut_pmu_trip_data = &tpdata_max77663;
+
+       tegra_platform_edp_init(dalmore_soctherm_data.therm[THERM_CPU].trips,
+                       &dalmore_soctherm_data.therm[THERM_CPU].num_trips);
+       tegra_add_tj_trips(dalmore_soctherm_data.therm[THERM_CPU].trips,
+                       &dalmore_soctherm_data.therm[THERM_CPU].num_trips);
 
        return tegra11_soctherm_init(&dalmore_soctherm_data);
 }
-module_init(dalmore_soctherm_init);