arm: tegra: Move all tj dependent thermals from nct to soc_therm
Diwakar Tundlam [Wed, 30 Jan 2013 00:44:32 +0000 (16:44 -0800)]
Functions moved are vdd_cpu, core edp. Raised shutdown limit for nct.
Added two higher temps for cpu_edp to support higher soc_therm temps.

Doing this only for Dalmore, Pluto, Ceres, Pismo.
No real changes to Roth.

Bug 1200075

Change-Id: I2b4ac4ba7cd933bd47c30ab2ad9eabb3a3da5fbe
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/195331
(cherry picked from commit 2af79db3c5763d3a0b6e78663ccf1ad6c04be134)
Reviewed-on: http://git-master/r/197096
GVS: Gerrit_Virtual_Submit

12 files changed:
arch/arm/mach-tegra/board-common.c
arch/arm/mach-tegra/board-common.h
arch/arm/mach-tegra/board-dalmore-power.c
arch/arm/mach-tegra/board-dalmore-sensors.c
arch/arm/mach-tegra/board-pismo-power.c
arch/arm/mach-tegra/board-pismo-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/cpu-tegra.c
arch/arm/mach-tegra/edp.c

index db7e257..cb69239 100644 (file)
@@ -166,8 +166,12 @@ static void tegra_add_trip_points(struct thermal_trip_info *trips,
 
 void tegra_add_cdev_trips(struct thermal_trip_info *trips, int *num_trips)
 {
-       tegra_add_trip_points(trips, num_trips, tegra_core_edp_get_cdev());
        tegra_add_trip_points(trips, num_trips, tegra_dvfs_get_cpu_dfll_cdev());
        tegra_add_trip_points(trips, num_trips, tegra_dvfs_get_cpu_pll_cdev());
        tegra_add_trip_points(trips, num_trips, tegra_dvfs_get_core_cdev());
 }
+
+void tegra_add_tj_trips(struct thermal_trip_info *trips, int *num_trips)
+{
+       tegra_add_trip_points(trips, num_trips, tegra_core_edp_get_cdev());
+}
index 408552e..11f1622 100644 (file)
@@ -28,4 +28,5 @@ extern struct platform_device *uart_console_debug_device;
 int  uart_console_debug_init(int defaul_debug_port);
 int tegra_vibrator_init(void);
 void tegra_add_cdev_trips(struct thermal_trip_info *trips, int *num_trips);
+void tegra_add_tj_trips(struct thermal_trip_info *trips, int *num_trips);
 #endif
index b6e55d0..c322f36 100644 (file)
@@ -47,6 +47,7 @@
 #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"
@@ -1184,21 +1185,21 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
                        .trips = {
                                {
                                        .cdev_type = "tegra-balanced",
-                                       .trip_temp = 85000,
+                                       .trip_temp = 84000,
                                        .trip_type = THERMAL_TRIP_PASSIVE,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-heavy",
-                                       .trip_temp = 95000,
+                                       .trip_temp = 94000,
                                        .trip_type = THERMAL_TRIP_HOT,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-shutdown",
-                                       .trip_temp = 105000,
+                                       .trip_temp = 104000,
                                        .trip_type = THERMAL_TRIP_CRITICAL,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
@@ -1225,5 +1226,10 @@ static struct soctherm_platform_data dalmore_soctherm_data = {
 
 int __init dalmore_soctherm_init(void)
 {
+       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);
 }
index b29ba75..79c21d0 100644 (file)
@@ -113,24 +113,8 @@ static struct nct1008_platform_data dalmore_nct1008_pdata = {
        .supported_hwrev = true,
        .ext_range = true,
        .conv_rate = 0x08,
-       .offset = 0,
-       .shutdown_ext_limit = 85, /* C */
+       .shutdown_ext_limit = 105, /* C */
        .shutdown_local_limit = 120, /* C */
-
-       .passive_delay = 2000,
-
-       .num_trips = 1,
-       .trips = {
-               /* Thermal Throttling */
-               [0] = {
-                       .cdev_type = "tegra-balanced",
-                       .trip_temp = 75000,
-                       .trip_type = THERMAL_TRIP_PASSIVE,
-                       .upper = THERMAL_NO_LIMIT,
-                       .lower = THERMAL_NO_LIMIT,
-                       .hysteresis = 0,
-               },
-       },
 };
 
 static struct i2c_board_info dalmore_i2c4_nct1008_board_info[] = {
@@ -584,8 +568,6 @@ static int dalmore_nct1008_init(void)
                        board_info.board_id);
        }
 
-       tegra_platform_edp_init(dalmore_nct1008_pdata.trips,
-                               &dalmore_nct1008_pdata.num_trips);
        tegra_add_cdev_trips(dalmore_nct1008_pdata.trips,
                                &dalmore_nct1008_pdata.num_trips);
 
index 4d6d039..d842171 100644 (file)
@@ -40,6 +40,7 @@
 #include "tegra-board-id.h"
 #include "board.h"
 #include "gpio-names.h"
+#include "board-common.h"
 #include "board-pismo.h"
 #include "tegra_cl_dvfs.h"
 #include "devices.h"
@@ -823,21 +824,21 @@ static struct soctherm_platform_data pismo_soctherm_data = {
                        .trips = {
                                {
                                        .cdev_type = "tegra-balanced",
-                                       .trip_temp = 85000,
+                                       .trip_temp = 84000,
                                        .trip_type = THERMAL_TRIP_PASSIVE,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-heavy",
-                                       .trip_temp = 95000,
+                                       .trip_temp = 94000,
                                        .trip_type = THERMAL_TRIP_HOT,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-shutdown",
-                                       .trip_temp = 105000,
+                                       .trip_temp = 104000,
                                        .trip_type = THERMAL_TRIP_CRITICAL,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
@@ -864,5 +865,10 @@ static struct soctherm_platform_data pismo_soctherm_data = {
 
 int __init pismo_soctherm_init(void)
 {
+       tegra_platform_edp_init(pismo_soctherm_data.therm[THERM_CPU].trips,
+                       &pismo_soctherm_data.therm[THERM_CPU].num_trips);
+       tegra_add_tj_trips(pismo_soctherm_data.therm[THERM_CPU].trips,
+                       &pismo_soctherm_data.therm[THERM_CPU].num_trips);
+
        return tegra11_soctherm_init(&pismo_soctherm_data);
 }
index 95f3386..134e706 100644 (file)
@@ -102,23 +102,8 @@ static struct nct1008_platform_data pismo_nct1008_pdata = {
        .ext_range = true,
        .conv_rate = 0x08,
        .offset = 0,
-       .shutdown_ext_limit = 85, /* C */
+       .shutdown_ext_limit = 105, /* C */
        .shutdown_local_limit = 120, /* C */
-
-       .passive_delay = 2000,
-
-       .num_trips = 1,
-       .trips = {
-               /* Thermal Throttling */
-               [0] = {
-                       .cdev_type = "pismo-nct",
-                       .trip_temp = 75000,
-                       .trip_type = THERMAL_TRIP_PASSIVE,
-                       .upper = THERMAL_NO_LIMIT,
-                       .lower = THERMAL_NO_LIMIT,
-                       .hysteresis = 0,
-               },
-       },
 };
 
 static struct i2c_board_info pismo_i2c4_nct1008_board_info[] = {
@@ -555,8 +540,6 @@ static int pismo_nct1008_init(void)
 
        nct1008_port = TEGRA_GPIO_PX6;
 
-       tegra_platform_edp_init(pismo_nct1008_pdata.trips,
-                               &pismo_nct1008_pdata.num_trips);
        tegra_add_cdev_trips(pismo_nct1008_pdata.trips,
                                &pismo_nct1008_pdata.num_trips);
 
index 6e15fd5..e567765 100644 (file)
@@ -35,6 +35,7 @@
 #include "cpu-tegra.h"
 #include "pm.h"
 #include "board.h"
+#include "board-common.h"
 #include "board-pluto.h"
 #include "iomap.h"
 #include "tegra_cl_dvfs.h"
@@ -725,21 +726,21 @@ static struct soctherm_platform_data pluto_soctherm_data = {
                        .trips = {
                                {
                                        .cdev_type = "tegra-balanced",
-                                       .trip_temp = 85000,
+                                       .trip_temp = 84000,
                                        .trip_type = THERMAL_TRIP_PASSIVE,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-heavy",
-                                       .trip_temp = 95000,
+                                       .trip_temp = 94000,
                                        .trip_type = THERMAL_TRIP_HOT,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-shutdown",
-                                       .trip_temp = 105000,
+                                       .trip_temp = 104000,
                                        .trip_type = THERMAL_TRIP_CRITICAL,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
@@ -766,5 +767,10 @@ static struct soctherm_platform_data pluto_soctherm_data = {
 
 int __init pluto_soctherm_init(void)
 {
+       tegra_platform_edp_init(pluto_soctherm_data.therm[THERM_CPU].trips,
+                       &pluto_soctherm_data.therm[THERM_CPU].num_trips);
+       tegra_add_tj_trips(pluto_soctherm_data.therm[THERM_CPU].trips,
+                       &pluto_soctherm_data.therm[THERM_CPU].num_trips);
+
        return tegra11_soctherm_init(&pluto_soctherm_data);
 }
index 7920368..dfb93a3 100644 (file)
@@ -332,23 +332,8 @@ static struct nct1008_platform_data pluto_nct1008_pdata = {
        .ext_range = true,
        .conv_rate = 0x08,
        .offset = 0,
-       .shutdown_ext_limit = 85, /* C */
+       .shutdown_ext_limit = 105, /* C */
        .shutdown_local_limit = 120, /* C */
-
-       .passive_delay = 2000,
-
-       .num_trips = 1,
-       .trips = {
-               /* Thermal Throttling */
-               [0] = {
-                       .cdev_type = "tegra-balanced",
-                       .trip_temp = 75000,
-                       .trip_type = THERMAL_TRIP_PASSIVE,
-                       .upper = THERMAL_NO_LIMIT,
-                       .lower = THERMAL_NO_LIMIT,
-                       .hysteresis = 0,
-               },
-       },
 };
 
 static struct i2c_board_info pluto_i2c4_nct1008_board_info[] = {
@@ -776,8 +761,6 @@ static int pluto_nct1008_init(void)
                        board_info.board_id);
        }
 
-       tegra_platform_edp_init(pluto_nct1008_pdata.trips,
-                               &pluto_nct1008_pdata.num_trips);
        tegra_add_cdev_trips(pluto_nct1008_pdata.trips,
                                &pluto_nct1008_pdata.num_trips);
 
index eb8a681..cddafc1 100644 (file)
@@ -708,21 +708,21 @@ static struct soctherm_platform_data roth_soctherm_data = {
                        .trips = {
                                {
                                        .cdev_type = "tegra-balanced",
-                                       .trip_temp = 85000,
+                                       .trip_temp = 84000,
                                        .trip_type = THERMAL_TRIP_PASSIVE,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-heavy",
-                                       .trip_temp = 95000,
+                                       .trip_temp = 94000,
                                        .trip_type = THERMAL_TRIP_HOT,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
                                },
                                {
                                        .cdev_type = "tegra-shutdown",
-                                       .trip_temp = 105000,
+                                       .trip_temp = 104000,
                                        .trip_type = THERMAL_TRIP_CRITICAL,
                                        .upper = THERMAL_NO_LIMIT,
                                        .lower = THERMAL_NO_LIMIT,
index 0739138..0ede5ec 100644 (file)
@@ -230,6 +230,8 @@ static int roth_nct1008_init(void)
                                &roth_nct1008_pdata.num_trips);
        tegra_add_cdev_trips(roth_nct1008_pdata.trips,
                                &roth_nct1008_pdata.num_trips);
+       tegra_add_tj_trips(roth_nct1008_pdata.trips,
+                               &roth_nct1008_pdata.num_trips);
 
        roth_i2c4_nct1008_board_info[0].irq = gpio_to_irq(nct1008_port);
        pr_info("%s: roth nct1008 irq %d", __func__, \
index 90a0fe9..b53d529 100644 (file)
@@ -278,7 +278,7 @@ static struct thermal_cooling_device_ops tegra_edp_cooling_ops = {
 static int __init edp_init(void)
 {
        thermal_cooling_device_register(
-                               "edp",
+                               "cpu_edp",
                                NULL,
                                &tegra_edp_cooling_ops);
        return 0;
index 63f4543..26ea066 100644 (file)
@@ -325,7 +325,7 @@ static struct tegra_edp_limits edp_default_limits[] = {
 };
 
 /* Constants for EDP calculations */
-static int temperatures[] = { 23, 40, 50, 60, 70, 75, 80, 85, 90, 95 };
+static int temperatures[] = { 23, 40, 50, 60, 70, 75, 80, 85, 90, 95, 100, 105 };
 static struct tegra_edp_cpu_leakage_params leakage_params[] = {
        {
                .cpu_speedo_id      = 0, /* A01 CPU */
@@ -789,7 +789,7 @@ void tegra_platform_edp_init(struct thermal_trip_info *trips, int *num_trips)
        for (i = 0; i < cpu_edp_limits_size-1; i++) {
                trip_state = &trips[*num_trips];
 
-               trip_state->cdev_type = "edp";
+               trip_state->cdev_type = "cpu_edp";
                trip_state->trip_temp =
                        cpu_edp_limits[i].temperature * 1000;
                trip_state->trip_type = THERMAL_TRIP_ACTIVE;