summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra11_soctherm.c
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2014-04-04 15:28:26 -0700
committerDiwakar Tundlam <dtundlam@nvidia.com>2014-04-07 13:29:09 -0700
commit486a45921286f3b7073f6dc8bb680784d9fdfeff (patch)
tree40b6fc8d4074ce7bb21e8cf8e911e51da2d713d8 /arch/arm/mach-tegra/tegra11_soctherm.c
parent16b5ebd6a208e58026f0f8b917c1b5245f58e94c (diff)
arm: tegra13: soctherm: temporary adjust throttle
Temporarily adjust thermal throttling parameters for T132 devices to avoid random shutdown issues seen on some platforms. Bug 1468124 Change-Id: Id7939110deae7f3076914a8a76049ca98fc843e4 Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-on: http://git-master/r/392519
Diffstat (limited to 'arch/arm/mach-tegra/tegra11_soctherm.c')
-rw-r--r--arch/arm/mach-tegra/tegra11_soctherm.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra11_soctherm.c b/arch/arm/mach-tegra/tegra11_soctherm.c
index ee8bfcfea1a8..d247b8e73b19 100644
--- a/arch/arm/mach-tegra/tegra11_soctherm.c
+++ b/arch/arm/mach-tegra/tegra11_soctherm.c
@@ -36,6 +36,7 @@
#include <linux/uaccess.h>
#include <linux/thermal.h>
#include <linux/platform_data/thermal_sensors.h>
+#include <linux/pid_thermal_gov.h>
#include <linux/bug.h>
#include <linux/tegra-fuse.h>
#include <linux/tegra-pmc.h>
@@ -723,6 +724,17 @@ static int soctherm_ocx_to_wake_gpio[TEGRA_SOC_OC_IRQ_MAX] = {
static int sensor2therm_a[TSENSE_SIZE];
static int sensor2therm_b[TSENSE_SIZE];
+static struct pid_thermal_gov_params t13_pid_params = {
+ .max_err_temp = 12000,
+ /* other fields are same */
+};
+
+struct soctherm_therm t13_therm = {
+ .passive_delay = 500,
+ .hotspot_offset = 0,
+ /* other fields are same */
+};
+
/**
* div64_s64_precise() - wrapper for div64_s64()
* @a: the dividend
@@ -1624,6 +1636,7 @@ static int __init soctherm_thermal_sys_init(void)
{
char name[THERMAL_NAME_LENGTH];
struct soctherm_therm *therm;
+ struct pid_thermal_gov_params *gov;
bool oc_en = false;
int i, j;
@@ -1657,6 +1670,13 @@ static int __init soctherm_thermal_sys_init(void)
}
}
+ /* XXX: temporarily adjust paramters for T132 */
+ if (IS_T13X) {
+ gov = therm->tzp->governor_params;
+ gov->max_err_temp = t13_pid_params.max_err_temp;
+ therm->passive_delay = t13_therm.passive_delay;
+ }
+
snprintf(name, THERMAL_NAME_LENGTH, "%s-therm", therm_names[i]);
soctherm_th_zones[i] = thermal_zone_device_register(
name,
@@ -2822,9 +2842,26 @@ static int soctherm_init_platform_data(void)
i, j, therm->trips[j].trip_temp);
therm->trips[j].trip_temp -= rem;
}
+
+ /* XXX: temporarily lower thresholds for T132 */
+ if (IS_T13X) {
+ if (therm->trips[j].trip_type ==
+ THERMAL_TRIP_HOT)
+ therm->trips[j].trip_temp -= 2000;
+ else if (therm->trips[j].trip_type ==
+ THERMAL_TRIP_PASSIVE)
+ therm->trips[j].trip_temp -= 5000;
+ }
}
}
+ /* XXX: temporarily use ZERO hotspot offset for T132 */
+ if (IS_T13X) {
+ plat_data.therm[THERM_CPU].hotspot_offset = 0;
+ plat_data.therm[THERM_GPU].hotspot_offset = 0;
+ plat_data.therm[THERM_MEM].hotspot_offset = 0;
+ }
+
/* Program hotspot offsets per THERM */
r = REG_SET(0, TS_HOTSPOT_OFF_CPU,
plat_data.therm[THERM_CPU].hotspot_offset / 1000);