arm: tegra: soctherm: Register soctherm device as CPU zone
Diwakar Tundlam [Sun, 16 Dec 2012 20:13:37 +0000 (12:13 -0800)]
Add registration of soctherm device for CPU zone temperature
monitoring and bind it to the CPU-therm cooling device.

Also register the balanced throttling table for CPU frequency
throttling from the CPU-therm temperature monitoring zone.

Bug 1200075

Change-Id: I8df8c896b87a85a769e15b15f13e4b2c420d7662
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/172056
Reviewed-by: Mandar Padmawar <mpadmawar@nvidia.com>
Tested-by: Mandar Padmawar <mpadmawar@nvidia.com>

arch/arm/mach-tegra/board-dalmore-power.c
arch/arm/mach-tegra/board-dalmore-sensors.c
arch/arm/mach-tegra/board-pluto-power.c
arch/arm/mach-tegra/board-pluto-sensors.c
arch/arm/mach-tegra/board-roth-power.c
arch/arm/mach-tegra/board-roth-sensors.c
arch/arm/mach-tegra/tegra11_soctherm.c
arch/arm/mach-tegra/tegra11_soctherm.h

index 3b8d788..c4c63a2 100644 (file)
@@ -1176,7 +1176,8 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
        .tsensor_clk_rate = 500000,
        .sensor_data = {
                [TSENSE_CPU0] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -1184,7 +1185,8 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU1] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -1192,7 +1194,8 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU2] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -1200,22 +1203,17 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU3] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
                        .tsample = 163,
                        .pdiv = 10,
                },
-               /* MEM0/MEM1 won't be used */
-               [TSENSE_MEM0] = {
-                       .enable = false,
-               },
-               [TSENSE_MEM1] = {
-                       .enable = false,
-               },
                [TSENSE_GPU] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -1223,7 +1221,8 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_PLLX] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -1231,6 +1230,22 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
                        .pdiv = 10,
                },
        },
+       .therm = {
+               [THERM_CPU] = {
+                       .zone_enable = true,
+                       .cdev_type = "tegra-balanced",
+                       .thermtrip = 115,
+                       .trip_temp = 85000,
+                       .passive_delay = 1000,
+                       .hysteresis = 3000,
+               },
+               [THERM_GPU] = {
+                       .zone_enable = true,
+               },
+               [THERM_PLL] = {
+                       .zone_enable = true,
+               },
+       },
 };
 
 int __init dalmore_soctherm_init(void)
index aa2d2e9..a5a133f 100644 (file)
@@ -92,7 +92,7 @@ static struct balanced_throttle tj_throttle = {
 static int __init dalmore_throttle_init(void)
 {
        if (machine_is_dalmore())
-               balanced_throttle_register(&tj_throttle, "dalmore-nct");
+               balanced_throttle_register(&tj_throttle, "tegra-balanced");
        return 0;
 }
 module_init(dalmore_throttle_init);
@@ -111,7 +111,7 @@ static struct nct1008_platform_data dalmore_nct1008_pdata = {
        .trips = {
                /* Thermal Throttling */
                [0] = {
-                       .cdev_type = "dalmore-nct",
+                       .cdev_type = "tegra-balanced",
                        .trip_temp = 75000,
                        .trip_type = THERMAL_TRIP_PASSIVE,
                        .state = THERMAL_NO_LIMIT,
index f227f69..9df17d0 100644 (file)
@@ -717,7 +717,8 @@ static struct soctherm_platform_data pluto_soctherm_data = {
        .tsensor_clk_rate = 500000,
        .sensor_data = {
                [TSENSE_CPU0] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -725,7 +726,8 @@ static struct soctherm_platform_data pluto_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU1] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -733,7 +735,8 @@ static struct soctherm_platform_data pluto_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU2] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -741,22 +744,17 @@ static struct soctherm_platform_data pluto_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU3] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
                        .tsample = 163,
                        .pdiv = 10,
                },
-               /* MEM0/MEM1 won't be used */
-               [TSENSE_MEM0] = {
-                       .enable = false,
-               },
-               [TSENSE_MEM1] = {
-                       .enable = false,
-               },
                [TSENSE_GPU] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -764,7 +762,8 @@ static struct soctherm_platform_data pluto_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_PLLX] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -772,6 +771,22 @@ static struct soctherm_platform_data pluto_soctherm_data = {
                        .pdiv = 10,
                },
        },
+       .therm = {
+               [THERM_CPU] = {
+                       .zone_enable = true,
+                       .cdev_type = "tegra-balanced",
+                       .thermtrip = 115,
+                       .trip_temp = 85000,
+                       .passive_delay = 1000,
+                       .hysteresis = 3000,
+               },
+               [THERM_GPU] = {
+                       .zone_enable = true,
+               },
+               [THERM_PLL] = {
+                       .zone_enable = true,
+               },
+       },
 };
 
 int __init pluto_soctherm_init(void)
index 07bb289..006824e 100644 (file)
@@ -308,7 +308,7 @@ static struct balanced_throttle tj_throttle = {
 static int __init pluto_throttle_init(void)
 {
        if (machine_is_tegra_pluto())
-               balanced_throttle_register(&tj_throttle, "pluto-nct");
+               balanced_throttle_register(&tj_throttle, "tegra-balanced");
        return 0;
 }
 module_init(pluto_throttle_init);
@@ -327,7 +327,7 @@ static struct nct1008_platform_data pluto_nct1008_pdata = {
        .trips = {
                /* Thermal Throttling */
                [0] = {
-                       .cdev_type = "pluto-nct",
+                       .cdev_type = "tegra-balanced",
                        .trip_temp = 75000,
                        .trip_type = THERMAL_TRIP_PASSIVE,
                        .state = THERMAL_NO_LIMIT,
index 90ec1b7..64612cb 100644 (file)
@@ -745,7 +745,8 @@ static struct soctherm_platform_data roth_soctherm_data = {
        .tsensor_clk_rate = 500000,
        .sensor_data = {
                [TSENSE_CPU0] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -753,7 +754,8 @@ static struct soctherm_platform_data roth_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU1] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -761,7 +763,8 @@ static struct soctherm_platform_data roth_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU2] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -769,23 +772,8 @@ static struct soctherm_platform_data roth_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_CPU3] = {
-                       .enable = true,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
-               },
-               [TSENSE_MEM0] = {
-                       .enable = true,
-                       .tall = 16300,
-                       .tiddq = 1,
-                       .ten_count = 1,
-                       .tsample = 163,
-                       .pdiv = 10,
-               },
-               [TSENSE_MEM1] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -793,7 +781,8 @@ static struct soctherm_platform_data roth_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_GPU] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -801,7 +790,8 @@ static struct soctherm_platform_data roth_soctherm_data = {
                        .pdiv = 10,
                },
                [TSENSE_PLLX] = {
-                       .enable = true,
+                       .sensor_enable = true,
+                       .zone_enable = false,
                        .tall = 16300,
                        .tiddq = 1,
                        .ten_count = 1,
@@ -809,6 +799,22 @@ static struct soctherm_platform_data roth_soctherm_data = {
                        .pdiv = 10,
                },
        },
+       .therm = {
+               [THERM_CPU] = {
+                       .zone_enable = true,
+                       .cdev_type = "tegra-balanced",
+                       .thermtrip = 115,
+                       .trip_temp = 85000,
+                       .passive_delay = 1000,
+                       .hysteresis = 3000,
+               },
+               [THERM_GPU] = {
+                       .zone_enable = true,
+               },
+               [THERM_PLL] = {
+                       .zone_enable = true,
+               },
+       },
 };
 
 int __init roth_soctherm_init(void)
index d9437df..965500b 100644 (file)
@@ -79,7 +79,7 @@ static struct balanced_throttle tj_throttle = {
 static int __init roth_throttle_init(void)
 {
        if (machine_is_roth())
-               balanced_throttle_register(&tj_throttle, "roth-nct");
+               balanced_throttle_register(&tj_throttle, "tegra-balanced");
        return 0;
 }
 module_init(roth_throttle_init);
@@ -99,7 +99,7 @@ static struct nct1008_platform_data roth_nct1008_pdata = {
        .trips = {
                /* Thermal Throttling */
                [0] = {
-                       .cdev_type = "roth-nct",
+                       .cdev_type = "tegra-balanced",
                        .trip_temp = 75000,
                        .trip_type = THERMAL_TRIP_PASSIVE,
                        .state = THERMAL_NO_LIMIT,
index 7a46919..afaec67 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/suspend.h>
 #include <linux/uaccess.h>
+#include <linux/thermal.h>
 
 #include <mach/tegra_fuse.h>
 #include <mach/iomap.h>
@@ -153,6 +154,8 @@ static int soc_therm_precision = -1;
 #define INTR_STATUS_MD0_MASK           0x1
 #define INTR_STATUS_MU0_SHIFT          24
 #define INTR_STATUS_MU0_MASK           0x1
+#define INTR_STATUS_CD0_SHIFT          9
+#define INTR_STATUS_CU0_SHIFT          8
 
 #define INTR_EN                        0x88
 #define INTR_EN_MU0_SHIFT      24
@@ -334,47 +337,47 @@ static int soctherm_set_limits(enum soctherm_therm_id therm,
 
        soctherm_writel(1<<INTR_EN_CU0_SHIFT, INTR_EN);
        soctherm_writel(1<<INTR_EN_CD0_SHIFT, INTR_EN);
-
        return 0;
 }
 
 static void soctherm_update(void)
 {
-       struct thermal_zone_device *dev = thz[THERM_CPU];
        long temp, trip_temp, low_temp = 0, high_temp = 128000;
-       int count;
-
-       if (!dev)
-               return;
+       int i, count;
 
-       if (!dev->passive)
-               thermal_zone_device_update(dev);
+       for (i = 0; i < THERM_SIZE; i++) {
+               if (!thz[i])
+                       continue;
 
-       dev->ops->get_temp(dev, &temp);
+               if (!thz[i]->passive)
+                       thermal_zone_device_update(thz[i]);
 
-       for (count = 0; count < dev->trips; count++) {
-               dev->ops->get_trip_temp(dev, count, &trip_temp);
+               thz[i]->ops->get_temp(thz[i], &temp);
+               for (count = 0; count < thz[i]->trips; count++) {
+                       thz[i]->ops->get_trip_temp(thz[i], count, &trip_temp);
 
-               if ((trip_temp >= temp) && (trip_temp < high_temp))
-                       high_temp = trip_temp;
+                       if ((trip_temp >= temp) && (trip_temp < high_temp))
+                               high_temp = trip_temp;
 
-               if ((trip_temp < temp) && (trip_temp > low_temp))
-                       low_temp = trip_temp;
+                       if ((trip_temp < temp) && (trip_temp > low_temp))
+                               low_temp = trip_temp -
+                                       plat_data.therm[i].hysteresis;
+               }
        }
 
        soctherm_set_limits(THERM_CPU, low_temp/1000, high_temp/1000);
 }
 
 static int soctherm_bind(struct thermal_zone_device *thz,
-                               struct thermal_cooling_device *cdevice)
+                               struct thermal_cooling_device *cdev)
 {
        int index = ((int)thz->devdata) - TSENSE_SIZE;
 
-       if (index < 0)
+       if (index < 0 || !plat_data.therm[index].cdev_type)
                return 0;
 
-       if (plat_data.therm[index].cdev == cdevice)
-               return thermal_zone_bind_cooling_device(thz, 0, cdevice,
+       if (!strcmp(plat_data.therm[index].cdev_type, cdev->type))
+               return thermal_zone_bind_cooling_device(thz, 0, cdev,
                                                        THERMAL_NO_LIMIT,
                                                        THERMAL_NO_LIMIT);
 
@@ -382,15 +385,15 @@ static int soctherm_bind(struct thermal_zone_device *thz,
 }
 
 static int soctherm_unbind(struct thermal_zone_device *thz,
-                               struct thermal_cooling_device *cdevice)
+                               struct thermal_cooling_device *cdev)
 {
        int index = ((int)thz->devdata) - TSENSE_SIZE;
 
-       if (index < 0)
+       if (index < 0 || !plat_data.therm[index].cdev_type)
                return 0;
 
-       if (plat_data.therm[index].cdev == cdevice)
-               return thermal_zone_unbind_cooling_device(thz, 0, cdevice);
+       if (!strcmp(plat_data.therm[index].cdev_type, cdev->type))
+               return thermal_zone_unbind_cooling_device(thz, 0, cdev);
 
        return 0;
 }
@@ -417,6 +420,8 @@ static int soctherm_get_temp(struct thermal_zone_device *thz,
                        *temp = temp_translate(REG_GET(r, TS_TEMP1_CPU_TEMP));
                else
                        *temp = temp_translate(REG_GET(r, TS_TEMP1_GPU_TEMP));
+
+               plat_data.therm[index].etemp = *temp;
        }
 
        return 0;
@@ -427,7 +432,7 @@ static int soctherm_get_trip_type(struct thermal_zone_device *thz,
                                        enum thermal_trip_type *type) {
        int index = ((int)thz->devdata) - TSENSE_SIZE;
 
-       if (index < 0 || !plat_data.therm[index].cdev)
+       if (index < 0 || !plat_data.therm[index].cdev_type)
                return -EINVAL;
 
        *type = THERMAL_TRIP_PASSIVE;
@@ -439,7 +444,7 @@ static int soctherm_get_trip_temp(struct thermal_zone_device *thz,
                                        unsigned long *temp) {
        int index = ((int)thz->devdata) - TSENSE_SIZE;
 
-       if (index < 0 || !plat_data.therm[index].cdev)
+       if (index < 0 || !plat_data.therm[index].cdev_type)
                return -EINVAL;
 
        *temp = plat_data.therm[index].trip_temp;
@@ -451,12 +456,32 @@ static int soctherm_set_trip_temp(struct thermal_zone_device *thz,
                                        unsigned long temp)
 {
        int index = ((int)thz->devdata) - TSENSE_SIZE;
-       if (index < 0 || !plat_data.therm[index].cdev)
+
+       if (index < 0 || !plat_data.therm[index].cdev_type)
                return -EINVAL;
 
        plat_data.therm[index].trip_temp = temp;
-
        soctherm_update();
+       return 0;
+}
+
+static int soctherm_get_trend(struct thermal_zone_device *thz,
+                               int trip,
+                               enum thermal_trend *trend)
+{
+       int index = ((int)thz->devdata) - TSENSE_SIZE;
+       struct soctherm_therm *trip_state;
+
+       if (index < 0 || !plat_data.therm[index].cdev_type)
+               return -EINVAL;
+
+       trip_state = &plat_data.therm[index];
+
+       /* always THERMAL_TRIP_PASSIVE */
+       if (trip_state->etemp > trip_state->trip_temp)
+               *trend = THERMAL_TREND_RAISING;
+       else
+               *trend = THERMAL_TREND_DROPPING;
 
        return 0;
 }
@@ -468,6 +493,7 @@ static struct thermal_zone_device_ops soctherm_ops = {
        .get_trip_type = soctherm_get_trip_type,
        .get_trip_temp = soctherm_get_trip_temp,
        .set_trip_temp = soctherm_set_trip_temp,
+       .get_trend = soctherm_get_trend,
 };
 
 static int __init soctherm_thermal_init(void)
@@ -476,7 +502,7 @@ static int __init soctherm_thermal_init(void)
        int i;
 
        for (i = 0; i < TSENSE_SIZE; i++) {
-               if (plat_data.sensor_data[i].enable) {
+               if (plat_data.sensor_data[i].zone_enable) {
                        sprintf(name, "%s-tsensor", sensor_names[i]);
                        /* Create a thermal zone device for each sensor */
                        thermal_zone_device_register(
@@ -486,24 +512,27 @@ static int __init soctherm_thermal_init(void)
                                        (void *)i,
                                        &soctherm_ops,
                                        NULL,
-                                       plat_data.therm[i].passive_delay,
+                                       0,
                                        0);
                }
        }
 
        for (i = 0; i < THERM_SIZE; i++) {
-               sprintf(name, "%s-therm", therm_names[i]);
-               thz[i] = thermal_zone_device_register(
+               if (plat_data.therm[i].zone_enable) {
+                       sprintf(name, "%s-therm", therm_names[i]);
+                       thz[i] = thermal_zone_device_register(
                                        name,
-                                       plat_data.therm[i].cdev ? 1 : 0,
-                                       plat_data.therm[i].cdev ? 0x1 : 0,
+                                       plat_data.therm[i].cdev_type ? 1 : 0,
+                                       plat_data.therm[i].cdev_type ? 0x1 : 0,
                                        (void *)TSENSE_SIZE + i,
                                        &soctherm_ops,
                                        NULL,
                                        plat_data.therm[i].passive_delay,
                                        0);
+               }
        }
 
+       soctherm_update();
        return 0;
 }
 module_init(soctherm_thermal_init);
@@ -516,6 +545,11 @@ static void soctherm_update(void)
 
 static void soctherm_work_func(struct work_struct *work)
 {
+       u32 status;
+
+       status = soctherm_readl(INTR_STATUS);
+       soctherm_writel(status, INTR_STATUS);
+
        soctherm_update();
 }
 
@@ -526,7 +560,7 @@ static irqreturn_t soctherm_isr(int irq, void *arg_data)
        queue_work(workqueue, &work);
 
        r = soctherm_readl(INTR_STATUS);
-       soctherm_writel(r, INTR_STATUS);
+       soctherm_writel(r, INTR_DIS);
 
        return IRQ_HANDLED;
 }
@@ -572,7 +606,7 @@ static void __init soctherm_tsense_program(enum soctherm_sense sensor,
        soctherm_writel(r, TS_TSENSE_REG_OFFSET(TS_CPU0_CONFIG0, sensor));
 
        r = REG_SET(0, TS_CPU0_CONFIG1_TIDDQ, data->tiddq);
-       r = REG_SET(r, TS_CPU0_CONFIG1_EN, data->enable);
+       r = REG_SET(r, TS_CPU0_CONFIG1_EN, 1);
        r = REG_SET(r, TS_CPU0_CONFIG1_TEN_COUNT, data->ten_count);
        r = REG_SET(r, TS_CPU0_CONFIG1_TSAMPLE, data->tsample);
        soctherm_writel(r, TS_TSENSE_REG_OFFSET(TS_CPU0_CONFIG1, sensor));
@@ -722,7 +756,7 @@ static int soctherm_init_platform_data(void)
        /* Thermal Sensing programming */
        soctherm_fuse_read_vsensor();
        for (i = 0; i < TSENSE_SIZE; i++) {
-               if (plat_data.sensor_data[i].enable) {
+               if (plat_data.sensor_data[i].sensor_enable) {
                        soctherm_tsense_program(i, &plat_data.sensor_data[i]);
                        soctherm_fuse_read_tsensor(i);
                }
@@ -778,6 +812,7 @@ static int soctherm_init_platform_data(void)
 
 static int soctherm_suspend(void)
 {
+       soctherm_writel((u32)-1, INTR_DIS);
        soctherm_clk_enable(false);
        disable_irq(INT_THERMAL);
        cancel_work_sync(&work);
@@ -834,9 +869,6 @@ int __init tegra11_soctherm_init(struct soctherm_platform_data *data)
        err = request_irq(INT_THERMAL, soctherm_isr, 0, "soctherm", NULL);
        if (err < 0)
                return -1;
-
-       soctherm_update();
-
        return 0;
 }
 
index 6922a59..b3394fd 100644 (file)
@@ -1,48 +1,46 @@
 /*
- * arch/arm/mach-tegra/tegra3_tsensor.h
+ * arch/arm/mach-tegra/tegra11_soctherm.h
  *
- * Tegra tsensor header file
+ * Copyright (C) 2011-2012 NVIDIA Corporation
  *
- * Copyright (c) 2011, NVIDIA Corporation.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
  *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  */
 
-#ifndef __MACH_TEGRA_TEGRA3_SOCTHERM_H
-#define __MACH_TEGRA_TEGRA3_SOCTHERM_H
-
-#include <linux/thermal.h>
-
 enum soctherm_sense {
        TSENSE_CPU0 = 0,
-       TSENSE_CPU1 = 1,
-       TSENSE_CPU2 = 2,
-       TSENSE_CPU3 = 3,
-       TSENSE_MEM0 = 4,
-       TSENSE_MEM1 = 5,
-       TSENSE_GPU  = 6,
-       TSENSE_PLLX = 7,
-       TSENSE_SIZE = 8,
+       TSENSE_CPU1,
+       TSENSE_CPU2,
+       TSENSE_CPU3,
+       TSENSE_MEM0,
+       TSENSE_MEM1,
+       TSENSE_GPU,
+       TSENSE_PLLX,
+       TSENSE_SIZE,
 };
 
 enum soctherm_therm_id {
        THERM_CPU = 0,
-       THERM_MEM = 1,
-       THERM_GPU = 2,
-       THERM_PLL = 3,
-       THERM_SIZE = 4,
+       THERM_MEM,
+       THERM_GPU,
+       THERM_PLL,
+       THERM_SIZE,
 };
 
 struct soctherm_sensor {
-       bool enable;
+       bool sensor_enable;
+       bool zone_enable;
        int tall;
        int tiddq;
        int ten_count;
@@ -51,26 +49,27 @@ struct soctherm_sensor {
 };
 
 struct soctherm_therm {
+       bool zone_enable;
        s8 thermtrip;
        s8 hw_backstop;
 
-       struct thermal_cooling_device *cdev;
+       char *cdev_type;
        int trip_temp;
-       int tc1;
-       int tc2;
        int passive_delay;
+       int etemp;
+       int hysteresis;
 };
 
 enum soctherm_throttle_id {
        THROTTLE_LITE = 0,
-       THROTTLE_HEAVY = 1,
-       THROTTLE_SIZE = 2,
+       THROTTLE_HEAVY,
+       THROTTLE_SIZE,
 };
 
 enum soctherm_throttle_dev_id {
        THROTTLE_DEV_CPU = 0,
-       THROTTLE_DEV_GPU = 1,
-       THROTTLE_DEV_SIZE = 2,
+       THROTTLE_DEV_GPU,
+       THROTTLE_DEV_SIZE,
 };
 
 struct soctherm_throttle_dev {
@@ -106,5 +105,3 @@ static inline int tegra11_soctherm_init(struct soctherm_platform_data *data)
        return 0;
 }
 #endif
-
-#endif