touch: raydium: Update to board files
[linux-2.6.git] / arch / arm / mach-tegra / board-dalmore-power.c
index b267b88..1a35943 100644 (file)
 
 #include <mach/iomap.h>
 #include <mach/irqs.h>
+#include <mach/edp.h>
 #include <mach/gpio-tegra.h>
 
+#include "cpu-tegra.h"
 #include "pm.h"
 #include "tegra-board-id.h"
 #include "board.h"
@@ -47,6 +49,7 @@
 #include "board-dalmore.h"
 #include "tegra_cl_dvfs.h"
 #include "devices.h"
+#include "tegra11_soctherm.h"
 
 #define PMC_CTRL               0x0
 #define PMC_CTRL_INTR_LOW      (1 << 17)
@@ -72,6 +75,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[] = {
@@ -96,7 +100,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[] = {
@@ -216,7 +220,7 @@ 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("dvdd", "spi3.2"),
        REGULATOR_SUPPLY("vdd_spi_1v8", NULL),
        REGULATOR_SUPPLY("dvdd_lcd", NULL),
        REGULATOR_SUPPLY("vdd_com_1v8", NULL),
@@ -280,11 +284,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[] = {
@@ -567,6 +573,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
@@ -733,6 +740,7 @@ static struct palmas_platform_data palmas_pdata = {
        .pad1 = 0,
        .pad2 = 0,
        .pad3 = PALMAS_PRIMARY_SECONDARY_PAD3_DVFS1,
+       .use_power_off = true,
 };
 
 static struct i2c_board_info palma_device[] = {
@@ -757,12 +765,20 @@ static struct regulator_consumer_supply fixed_reg_avdd_usb_hdmi_supply[] = {
 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[] = {
@@ -944,13 +960,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,
 };
 #ifdef CONFIG_ARCH_TEGRA_HAS_CL_DVFS
 /* board parameters for cpu dfll */
@@ -1021,6 +1039,28 @@ static int __init dalmore_max77663_regulator_init(void)
        return 0;
 }
 
+static struct regulator_bulk_data dalmore_gps_regulator_supply[] = {
+       [0] = {
+               .supply = "vdd_gps_3v3",
+       },
+       [1] = {
+               .supply = "vdd_gps_1v8",
+       },
+};
+
+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_gps_regulator_device = {
+       .name   = "reg-userspace-consumer",
+       .id     = 2,
+       .dev    = {
+                       .platform_data = &dalmore_gps_regulator_pdata,
+       },
+};
+
 static struct regulator_bulk_data dalmore_bt_regulator_supply[] = {
        [0] = {
                .supply = "vdd_bt_3v3",
@@ -1052,7 +1092,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
@@ -1070,7 +1111,8 @@ int __init dalmore_regulator_init(void)
        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();
@@ -1078,6 +1120,7 @@ int __init dalmore_regulator_init(void)
        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;
 }
 
@@ -1087,3 +1130,130 @@ int __init dalmore_suspend_init(void)
        return 0;
 }
 
+int __init dalmore_edp_init(void)
+{
+#ifdef CONFIG_TEGRA_EDP_LIMITS
+       unsigned int regulator_mA;
+
+       regulator_mA = get_maximum_cpu_current_supported();
+       if (!regulator_mA)
+               regulator_mA = 15000;
+
+       pr_info("%s: CPU regulator %d mA\n", __func__, regulator_mA);
+
+       tegra_init_cpu_edp_limits(regulator_mA);
+#endif
+       return 0;
+}
+
+static struct soctherm_platform_data dalmore_soctherm_data = {
+       .soctherm_clk_rate = 136000000,
+       .tsensor_clk_rate = 500000,
+       .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,
+               },
+               [TSENSE_GPU] = {
+                       .enable = true,
+                       .therm_a = 570,
+                       .therm_b = -744,
+                       .tall = 16300,
+                       .tiddq = 1,
+                       .ten_count = 1,
+                       .tsample = 163,
+                       .pdiv = 10,
+               },
+               [TSENSE_PLLX] = {
+                       .enable = true,
+                       .therm_a = 570,
+                       .therm_b = -744,
+                       .tall = 16300,
+                       .tiddq = 1,
+                       .ten_count = 1,
+                       .tsample = 163,
+                       .pdiv = 10,
+               },
+       },
+};
+
+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 },
+       },
+};
+
+static int __init dalmore_soctherm_init(void)
+{
+       dalmore_soctherm_data.therm[THERM_CPU].cdev =
+                       balanced_throttle_register(&tj_throttle);
+
+       return tegra11_soctherm_init(&dalmore_soctherm_data);
+}
+module_init(dalmore_soctherm_init);