ARM: tegra: thermal: Update due to struct_est_data modification
[linux-2.6.git] / arch / arm / mach-tegra / board-dalmore-sensors.c
index 6257c4e..b85fa25 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * arch/arm/mach-tegra/board-dalmore-sensors.c
  *
- * Copyright (c) 2012 NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2012-2013 NVIDIA CORPORATION, All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -36,6 +36,7 @@
 #include <linux/therm_est.h>
 #include <linux/nct1008.h>
 #include <mach/edp.h>
+#include <linux/edp.h>
 #include <mach/gpio-tegra.h>
 #include <mach/pinmux-t11.h>
 #include <mach/pinmux.h>
 #include <media/as364x.h>
 #include <media/ad5816.h>
 #include <generated/mach-types.h>
+#include <linux/power/sbs-battery.h>
 
 #include "gpio-names.h"
 #include "board.h"
+#include "board-common.h"
 #include "board-dalmore.h"
 #include "cpu-tegra.h"
 #include "devices.h"
 #include "tegra-board-id.h"
+#include "dvfs.h"
+
+static struct nvc_gpio_pdata imx091_gpio_pdata[] = {
+       {IMX091_GPIO_RESET, CAM_RSTN, true, false},
+       {IMX091_GPIO_PWDN, CAM1_POWER_DWN_GPIO, true, false},
+       {IMX091_GPIO_GP1, CAM_GPIO1, true, false}
+};
 
 static struct board_info board_info;
 
+static struct throttle_table tj_throttle_table[] = {
+       /* CPU_THROT_LOW cannot be used by other than CPU */
+       /*      CPU,  C2BUS,  C3BUS,   SCLK,    EMC   */
+       { { 1810500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1785000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1759500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1734000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1708500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1683000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1657500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1632000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1606500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1581000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1555500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1530000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1504500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1479000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1453500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1428000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1402500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1377000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1351500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1326000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1300500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1275000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1249500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1224000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1198500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1173000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1147500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1122000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1096500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1071000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1045500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1020000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  994500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  969000, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  943500, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  918000, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  892500, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  867000, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  841500, 564000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  816000, 564000, NO_CAP, NO_CAP, 792000 } },
+       { {  790500, 564000, NO_CAP, 372000, 792000 } },
+       { {  765000, 564000, 468000, 372000, 792000 } },
+       { {  739500, 528000, 468000, 372000, 792000 } },
+       { {  714000, 528000, 468000, 336000, 792000 } },
+       { {  688500, 528000, 420000, 336000, 792000 } },
+       { {  663000, 492000, 420000, 336000, 792000 } },
+       { {  637500, 492000, 420000, 336000, 408000 } },
+       { {  612000, 492000, 420000, 300000, 408000 } },
+       { {  586500, 492000, 360000, 336000, 408000 } },
+       { {  561000, 420000, 420000, 300000, 408000 } },
+       { {  535500, 420000, 360000, 228000, 408000 } },
+       { {  510000, 420000, 288000, 228000, 408000 } },
+       { {  484500, 324000, 288000, 228000, 408000 } },
+       { {  459000, 324000, 288000, 228000, 408000 } },
+       { {  433500, 324000, 288000, 228000, 408000 } },
+       { {  408000, 324000, 288000, 228000, 408000 } },
+};
+
 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 },
-       },
+       .throt_tab_size = ARRAY_SIZE(tj_throttle_table),
+       .throt_tab = tj_throttle_table,
 };
 
+static int __init dalmore_throttle_init(void)
+{
+       if (machine_is_dalmore())
+               balanced_throttle_register(&tj_throttle, "tegra-balanced");
+       return 0;
+}
+module_init(dalmore_throttle_init);
+
 static struct nct1008_platform_data dalmore_nct1008_pdata = {
        .supported_hwrev = true,
        .ext_range = true,
        .conv_rate = 0x08,
-       .offset = 80, /* 4 * 20C. Bug 844025 - 1C for device accuracies */
-       .shutdown_ext_limit = 90, /* C */
+       .shutdown_ext_limit = 105, /* C */
        .shutdown_local_limit = 120, /* C */
 
-       /* Thermal Throttling */
-       .passive = {
-               .create_cdev = (struct thermal_cooling_device *(*)(void *))
-                               balanced_throttle_register,
-               .cdev_data = &tj_throttle,
-               .trip_temp = 80000,
-               .tc1 = 0,
-               .tc2 = 1,
-               .passive_delay = 2000,
-       }
+       .num_trips = 1,
+       .trips = {
+               {
+                       .cdev_type = "suspend_soctherm",
+                       .trip_temp = 50000,
+                       .trip_type = THERMAL_TRIP_ACTIVE,
+                       .upper = 1,
+                       .lower = 1,
+                       .hysteresis = 5000,
+               },
+       },
 };
 
 static struct i2c_board_info dalmore_i2c4_nct1008_board_info[] = {
@@ -108,7 +176,44 @@ static struct i2c_board_info dalmore_i2c4_nct1008_board_info[] = {
                .lock           = TEGRA_PIN_LOCK_##_lock,       \
                .od             = TEGRA_PIN_OD_DEFAULT,         \
                .ioreset        = TEGRA_PIN_IO_RESET_##_ioreset \
-       }
+}
+
+static int dalmore_focuser_power_on(struct ad5816_power_rail *pw)
+{
+       int err;
+
+       if (unlikely(WARN_ON(!pw || !pw->vdd || !pw->vdd_i2c)))
+               return -EFAULT;
+
+       err = regulator_enable(pw->vdd_i2c);
+       if (unlikely(err))
+               goto ad5816_vdd_i2c_fail;
+
+       err = regulator_enable(pw->vdd);
+       if (unlikely(err))
+               goto ad5816_vdd_fail;
+
+       return 0;
+
+ad5816_vdd_fail:
+       regulator_disable(pw->vdd_i2c);
+
+ad5816_vdd_i2c_fail:
+       pr_err("%s FAILED\n", __func__);
+
+       return -ENODEV;
+}
+
+static int dalmore_focuser_power_off(struct ad5816_power_rail *pw)
+{
+       if (unlikely(WARN_ON(!pw || !pw->vdd || !pw->vdd_i2c)))
+               return -EFAULT;
+
+       regulator_disable(pw->vdd);
+       regulator_disable(pw->vdd_i2c);
+
+       return 0;
+}
 
 static struct tegra_pingroup_config mclk_disable =
        VI_PINMUX(CAM_MCLK, VI, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT);
@@ -143,11 +248,11 @@ static int dalmore_get_vcmvdd(void)
        return 0;
 }
 
-static int dalmore_imx091_power_on(struct imx091_power_rail *pw)
+static int dalmore_imx091_power_on(struct nvc_regulator *vreg)
 {
        int err;
 
-       if (unlikely(!pw || !pw->avdd || !pw->iovdd))
+       if (unlikely(WARN_ON(!vreg)))
                return -EFAULT;
 
        if (dalmore_get_vcmvdd())
@@ -156,11 +261,11 @@ static int dalmore_imx091_power_on(struct imx091_power_rail *pw)
        gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
        usleep_range(10, 20);
 
-       err = regulator_enable(pw->avdd);
+       err = regulator_enable(vreg[IMX091_VREG_AVDD].vreg);
        if (err)
                goto imx091_avdd_fail;
 
-       err = regulator_enable(pw->iovdd);
+       err = regulator_enable(vreg[IMX091_VREG_IOVDD].vreg);
        if (err)
                goto imx091_iovdd_fail;
 
@@ -177,10 +282,10 @@ static int dalmore_imx091_power_on(struct imx091_power_rail *pw)
        return 1;
 
 imx091_vcmvdd_fail:
-       regulator_disable(pw->iovdd);
+       regulator_disable(vreg[IMX091_VREG_IOVDD].vreg);
 
 imx091_iovdd_fail:
-       regulator_disable(pw->avdd);
+       regulator_disable(vreg[IMX091_VREG_AVDD].vreg);
 
 imx091_avdd_fail:
        gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
@@ -190,9 +295,9 @@ imx091_poweron_fail:
        return -ENODEV;
 }
 
-static int dalmore_imx091_power_off(struct imx091_power_rail *pw)
+static int dalmore_imx091_power_off(struct nvc_regulator *vreg)
 {
-       if (unlikely(!pw || !dalmore_vcmvdd || !pw->avdd || !pw->iovdd))
+       if (unlikely(WARN_ON(!vreg)))
                return -EFAULT;
 
        usleep_range(1, 2);
@@ -201,15 +306,61 @@ static int dalmore_imx091_power_off(struct imx091_power_rail *pw)
        usleep_range(1, 2);
 
        regulator_disable(dalmore_vcmvdd);
-       regulator_disable(pw->iovdd);
-       regulator_disable(pw->avdd);
+       regulator_disable(vreg[IMX091_VREG_IOVDD].vreg);
+       regulator_disable(vreg[IMX091_VREG_AVDD].vreg);
 
        return 1;
 }
 
-struct imx091_platform_data dalmore_imx091_data = {
-       .power_on = dalmore_imx091_power_on,
-       .power_off = dalmore_imx091_power_off,
+static struct nvc_imager_cap imx091_cap = {
+       .identifier             = "IMX091",
+       .sensor_nvc_interface   = 3,
+       .pixel_types[0]         = 0x100,
+       .orientation            = 0,
+       .direction              = 0,
+       .initial_clock_rate_khz = 6000,
+       .clock_profiles[0] = {
+               .external_clock_khz     = 24000,
+               .clock_multiplier       = 850000, /* value / 1,000,000 */
+       },
+       .clock_profiles[1] = {
+               .external_clock_khz     = 0,
+               .clock_multiplier       = 0,
+       },
+       .h_sync_edge            = 0,
+       .v_sync_edge            = 0,
+       .mclk_on_vgp0           = 0,
+       .csi_port               = 0,
+       .data_lanes             = 4,
+       .virtual_channel_id     = 0,
+       .discontinuous_clk_mode = 1,
+       .cil_threshold_settle   = 0x0,
+       .min_blank_time_width   = 16,
+       .min_blank_time_height  = 16,
+       .preferred_mode_index   = 0,
+       .focuser_guid           = NVC_FOCUS_GUID(0),
+       .torch_guid             = NVC_TORCH_GUID(0),
+       .cap_version            = NVC_IMAGER_CAPABILITIES_VERSION2,
+};
+
+static struct imx091_platform_data imx091_pdata = {
+       .num                    = 0,
+       .sync                   = 0,
+       .dev_name               = "camera",
+       .gpio_count             = ARRAY_SIZE(imx091_gpio_pdata),
+       .gpio                   = imx091_gpio_pdata,
+       .flash_cap              = {
+               .sdo_trigger_enabled = 1,
+               .adjustable_flash_timing = 1,
+       },
+       .cap                    = &imx091_cap,
+       .power_on               = dalmore_imx091_power_on,
+       .power_off              = dalmore_imx091_power_off,
+};
+
+struct sbs_platform_data sbs_pdata = {
+       .poll_retry_count = 100,
+       .i2c_retry_count = 2,
 };
 
 static int dalmore_ov9772_power_on(struct ov9772_power_rail *pw)
@@ -316,6 +467,7 @@ static struct as364x_platform_data dalmore_as3648_pdata = {
        .config         = {
                .max_total_current_mA = 1000,
                .max_peak_current_mA = 600,
+               .vin_low_v_run_mV = 3070,
                .strobe_type = 1,
                },
        .pinstate       = {
@@ -331,17 +483,19 @@ static struct as364x_platform_data dalmore_as3648_pdata = {
        .power_off_callback = dalmore_as3648_power_off,
 };
 
-static struct ad5816_platform_data pluto_ad5816_pdata = {
-       .cfg            = 0,
-       .num            = 0,
-       .sync           = 0,
-       .dev_name       = "focuser",
+static struct ad5816_platform_data dalmore_ad5816_pdata = {
+       .cfg = 0,
+       .num = 0,
+       .sync = 0,
+       .dev_name = "focuser",
+       .power_on = dalmore_focuser_power_on,
+       .power_off = dalmore_focuser_power_off,
 };
 
 static struct i2c_board_info dalmore_i2c_board_info_e1625[] = {
        {
                I2C_BOARD_INFO("imx091", 0x36),
-               .platform_data = &dalmore_imx091_data,
+               .platform_data = &imx091_pdata,
        },
        {
                I2C_BOARD_INFO("ov9772", 0x10),
@@ -353,7 +507,7 @@ static struct i2c_board_info dalmore_i2c_board_info_e1625[] = {
        },
        {
                I2C_BOARD_INFO("ad5816", 0x0E),
-               .platform_data = &pluto_ad5816_pdata,
+               .platform_data = &dalmore_ad5816_pdata,
        },
 };
 
@@ -367,21 +521,6 @@ static int dalmore_camera_init(void)
        return 0;
 }
 
-/* MPU board file definition   */
-static struct mpu_platform_data mpu9150_gyro_data = {
-       .int_config     = 0x10,
-       .level_shifter  = 0,
-       /* Located in board_[platformname].h */
-       .orientation    = MPU_GYRO_ORIENTATION,
-       .sec_slave_type = SECONDARY_SLAVE_TYPE_COMPASS,
-       .sec_slave_id   = COMPASS_ID_AK8975,
-       .secondary_i2c_addr     = MPU_COMPASS_ADDR,
-       .secondary_read_reg     = 0x06,
-       .secondary_orientation  = MPU_COMPASS_ORIENTATION,
-       .key            = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22,
-                          0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89},
-};
-
 #define TEGRA_CAMERA_GPIO(_gpio, _label, _value)               \
        {                                                       \
                .gpio = _gpio,                                  \
@@ -395,11 +534,45 @@ static struct i2c_board_info dalmore_i2c_board_info_cm3218[] = {
        },
 };
 
+/* MPU board file definition   */
+static struct mpu_platform_data mpu9150_gyro_data = {
+       .int_config     = 0x10,
+       .level_shifter  = 0,
+       /* Located in board_[platformname].h */
+       .orientation    = MPU_GYRO_ORIENTATION,
+       .sec_slave_type = SECONDARY_SLAVE_TYPE_NONE,
+       .key            = {0x4E, 0xCC, 0x7E, 0xEB, 0xF6, 0x1E, 0x35, 0x22,
+                          0x00, 0x34, 0x0D, 0x65, 0x32, 0xE9, 0x94, 0x89},
+};
+
+static struct mpu_platform_data mpu_compass_data = {
+       .orientation    = MPU_COMPASS_ORIENTATION,
+       .config         = NVI_CONFIG_BOOT_MPU,
+};
+
+static struct mpu_platform_data bmp180_pdata = {
+       .config         = NVI_CONFIG_BOOT_MPU,
+};
+
 static struct i2c_board_info __initdata inv_mpu9150_i2c2_board_info[] = {
        {
                I2C_BOARD_INFO(MPU_GYRO_NAME, MPU_GYRO_ADDR),
                .platform_data = &mpu9150_gyro_data,
        },
+       {
+               /* The actual BMP180 address is 0x77 but because this conflicts
+                * with another device, this address is hacked so Linux will
+                * call the driver.  The conflict is technically okay since the
+                * BMP180 is behind the MPU.  Also, the BMP180 driver uses a
+                * hard-coded address of 0x77 since it can't be changed anyway.
+                */
+               I2C_BOARD_INFO("bmp180", 0x78),
+               .platform_data = &bmp180_pdata,
+       },
+       {
+               I2C_BOARD_INFO(MPU_COMPASS_NAME, MPU_COMPASS_ADDR),
+               .platform_data = &mpu_compass_data,
+       },
 };
 
 static void mpuirq_init(void)
@@ -433,64 +606,43 @@ static void mpuirq_init(void)
 
 static int dalmore_nct1008_init(void)
 {
-       int nct1008_port = -1;
+       int nct1008_port;
        int ret = 0;
 
-#if defined(CONFIG_ARCH_TEGRA_11x_SOC)
-       if ((board_info.board_id == BOARD_E1611) ||
-           (board_info.board_id == BOARD_E1612) ||
+       if ((board_info.board_id == BOARD_E1612) ||
            (board_info.board_id == BOARD_E1641) ||
-           (board_info.board_id == BOARD_E1613))
+           (board_info.board_id == BOARD_E1613) ||
+           (board_info.board_id == BOARD_P2454))
        {
                /* per email from Matt 9/10/2012 */
                nct1008_port = TEGRA_GPIO_PX6;
+       } else if (board_info.board_id == BOARD_E1611) {
+               if (board_info.fab == 0x04)
+                       nct1008_port = TEGRA_GPIO_PO4;
+               else
+                       nct1008_port = TEGRA_GPIO_PX6;
        } else {
                nct1008_port = TEGRA_GPIO_PX6;
                pr_err("Warning: nct alert_port assumed TEGRA_GPIO_PX6"
-                      " for unknown dalmore board id E%d\n",
-                      board_info.board_id);
+                       " for unknown dalmore board id E%d\n",
+                       board_info.board_id);
        }
-#else
-       /* dalmore + AP30 interposer has SPI2_CS0 gpio */
-       nct1008_port = TEGRA_GPIO_PX3;
-#endif
 
-       if (nct1008_port >= 0) {
-#ifdef CONFIG_TEGRA_EDP_LIMITS
-               const struct tegra_edp_limits *cpu_edp_limits;
-               int cpu_edp_limits_size;
-               int i;
-
-               /* edp capping */
-               tegra_get_cpu_edp_limits(&cpu_edp_limits, &cpu_edp_limits_size);
-
-               if (cpu_edp_limits_size > MAX_THROT_TABLE_SIZE)
-                       BUG();
-
-               for (i = 0; i < cpu_edp_limits_size-1; i++) {
-                       dalmore_nct1008_pdata.active[i].create_cdev =
-                               (struct thermal_cooling_device *(*)(void *))
-                                       edp_cooling_device_create;
-                       dalmore_nct1008_pdata.active[i].cdev_data = (void *)i;
-                       dalmore_nct1008_pdata.active[i].trip_temp =
-                               cpu_edp_limits[i].temperature * 1000;
-                       dalmore_nct1008_pdata.active[i].hysteresis = 1000;
-               }
-               dalmore_nct1008_pdata.active[i].create_cdev = NULL;
-#endif
+       tegra_add_cdev_trips(dalmore_nct1008_pdata.trips,
+                               &dalmore_nct1008_pdata.num_trips);
 
-               dalmore_i2c4_nct1008_board_info[0].irq = gpio_to_irq(nct1008_port);
-               pr_info("%s: dalmore nct1008 irq %d", __func__, dalmore_i2c4_nct1008_board_info[0].irq);
+       dalmore_i2c4_nct1008_board_info[0].irq = gpio_to_irq(nct1008_port);
+       pr_info("%s: dalmore nct1008 irq %d",
+                       __func__, dalmore_i2c4_nct1008_board_info[0].irq);
 
-               ret = gpio_request(nct1008_port, "temp_alert");
-               if (ret < 0)
-                       return ret;
+       ret = gpio_request(nct1008_port, "temp_alert");
+       if (ret < 0)
+               return ret;
 
-               ret = gpio_direction_input(nct1008_port);
-               if (ret < 0) {
-                       pr_info("%s: calling gpio_free(nct1008_port)", __func__);
-                       gpio_free(nct1008_port);
-               }
+       ret = gpio_direction_input(nct1008_port);
+       if (ret < 0) {
+               pr_info("%s: calling gpio_free(nct1008_port)", __func__);
+               gpio_free(nct1008_port);
        }
 
        /* dalmore has thermal sensor on GEN1-I2C i.e. instance 0 */
@@ -503,82 +655,130 @@ static int dalmore_nct1008_init(void)
 static struct i2c_board_info __initdata bq20z45_pdata[] = {
        {
                I2C_BOARD_INFO("sbs-battery", 0x0B),
+               .platform_data = &sbs_pdata,
        },
 };
 
 #ifdef CONFIG_TEGRA_SKIN_THROTTLE
-static int tegra_skin_match(struct thermal_zone_device *thz, void *data)
-{
-       return strcmp((char *)data, thz->type) == 0;
-}
-
-static int tegra_skin_get_temp(void *data, long *temp)
-{
-       struct thermal_zone_device *thz;
-
-       thz = thermal_zone_device_find(data, tegra_skin_match);
-
-       if (!thz || thz->ops->get_temp(thz, temp))
-               *temp = 25000;
+static struct thermal_trip_info skin_trips[] = {
+       {
+               .cdev_type = "skin-balanced",
+               .trip_temp = 45000,
+               .trip_type = THERMAL_TRIP_PASSIVE,
+               .upper = THERMAL_NO_LIMIT,
+               .lower = THERMAL_NO_LIMIT,
+               .hysteresis = 0,
+       },
+};
 
-       return 0;
-}
+static struct therm_est_subdevice skin_devs[] = {
+       {
+               .dev_data = "nct_ext",
+               .coeffs = {
+                       2, 1, 1, 1,
+                       1, 1, 1, 1,
+                       1, 1, 1, 0,
+                       1, 1, 0, 0,
+                       0, 0, -1, -7
+               },
+       },
+       {
+               .dev_data = "nct_int",
+               .coeffs = {
+                       -11, -7, -5, -3,
+                       -3, -2, -1, 0,
+                       0, 0, 1, 1,
+                       1, 2, 2, 3,
+                       4, 6, 11, 18
+               },
+       },
+};
 
 static struct therm_est_data skin_data = {
+       .num_trips = ARRAY_SIZE(skin_trips),
+       .trips = skin_trips,
        .toffset = 9793,
        .polling_period = 1100,
-       .ndevs = 2,
-       .devs = {
-                       {
-                               .dev_data = "nct_ext",
-                               .get_temp = tegra_skin_get_temp,
-                               .coeffs = {
-                                       2, 1, 1, 1,
-                                       1, 1, 1, 1,
-                                       1, 1, 1, 0,
-                                       1, 1, 0, 0,
-                                       0, 0, -1, -7
-                               },
-                       },
-                       {
-                               .dev_data = "nct_int",
-                               .get_temp = tegra_skin_get_temp,
-                               .coeffs = {
-                                       -11, -7, -5, -3,
-                                       -3, -2, -1, 0,
-                                       0, 0, 1, 1,
-                                       1, 2, 2, 3,
-                                       4, 6, 11, 18
-                               },
-                       },
-       },
-       .trip_temp = 43000,
-       .tc1 = 1,
-       .tc2 = 15,
        .passive_delay = 15000,
+       .tc1 = 10,
+       .tc2 = 1,
+       .ndevs = ARRAY_SIZE(skin_devs),
+       .devs = skin_devs,
+};
+
+static struct throttle_table skin_throttle_table[] = {
+       /* CPU_THROT_LOW cannot be used by other than CPU */
+       /*      CPU,  C2BUS,  C3BUS,   SCLK,    EMC   */
+       { { 1810500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1785000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1759500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1734000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1708500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1683000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1657500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1632000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1606500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1581000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1555500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1530000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1504500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1479000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1453500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1428000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1402500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1377000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1351500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1326000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1300500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1275000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1249500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1224000, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1198500, NO_CAP, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1173000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1147500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1122000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1096500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1071000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1045500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { { 1020000, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  994500, 636000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  969000, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  943500, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  918000, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  892500, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  867000, 600000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  841500, 564000, NO_CAP, NO_CAP, NO_CAP } },
+       { {  816000, 564000, NO_CAP, NO_CAP, 792000 } },
+       { {  790500, 564000, NO_CAP, 372000, 792000 } },
+       { {  765000, 564000, 468000, 372000, 792000 } },
+       { {  739500, 528000, 468000, 372000, 792000 } },
+       { {  714000, 528000, 468000, 336000, 792000 } },
+       { {  688500, 528000, 420000, 336000, 792000 } },
+       { {  663000, 492000, 420000, 336000, 792000 } },
+       { {  637500, 492000, 420000, 336000, 408000 } },
+       { {  612000, 492000, 420000, 300000, 408000 } },
+       { {  586500, 492000, 360000, 336000, 408000 } },
+       { {  561000, 420000, 420000, 300000, 408000 } },
+       { {  535500, 420000, 360000, 228000, 408000 } },
+       { {  510000, 420000, 288000, 228000, 408000 } },
+       { {  484500, 324000, 288000, 228000, 408000 } },
+       { {  459000, 324000, 288000, 228000, 408000 } },
+       { {  433500, 324000, 288000, 228000, 408000 } },
+       { {  408000, 324000, 288000, 228000, 408000 } },
 };
 
 static struct balanced_throttle skin_throttle = {
-       .throt_tab_size = 6,
-       .throt_tab = {
-               { 640000, 1200 },
-               { 640000, 1200 },
-               { 760000, 1200 },
-               { 760000, 1200 },
-               {1000000, 1200 },
-               {1000000, 1200 },
-       },
+       .throt_tab_size = ARRAY_SIZE(skin_throttle_table),
+       .throt_tab = skin_throttle_table,
 };
 
 static int __init dalmore_skin_init(void)
 {
-       struct thermal_cooling_device *skin_cdev;
-
-       skin_cdev = balanced_throttle_register(&skin_throttle);
-
-       skin_data.cdev = skin_cdev;
-       tegra_skin_therm_est_device.dev.platform_data = &skin_data;
-       platform_device_register(&tegra_skin_therm_est_device);
+       if (machine_is_dalmore()) {
+               balanced_throttle_register(&skin_throttle, "skin-balanced");
+               tegra_skin_therm_est_device.dev.platform_data = &skin_data;
+               platform_device_register(&tegra_skin_therm_est_device);
+       }
 
        return 0;
 }