#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>
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
{
char name[THERMAL_NAME_LENGTH];
struct soctherm_therm *therm;
+ struct pid_thermal_gov_params *gov;
bool oc_en = false;
int i, j;
}
}
+ /* 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,
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);