summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2011-07-12 00:51:11 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:47:34 -0800
commit1d143a601d8bafdf749b6fc34ea0b746de44e438 (patch)
treead6cf8953a7c1e3789ac51ce1c5be46a240fe40a /drivers/misc
parent860a1ce24675bed1e9b3d588003c94f974493a76 (diff)
Arm: Tegra: Tsensor: Added guardbanding to temperatures
Bug 844025 - Guardband to account for hotspot offset and sensor accuracy. - Throttling point specified independent of EDP, but constrained to be one of the specified EDP points. Original-Change-Id: Ic9231ad6887ca282bb520ea23229526ac7a243be Reviewed-on: http://git-master/r/40566 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Rebase-Id: Rb582312d40da8f1cc753666bdef6068138358cd0
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/nct1008.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c
index d4a8c1cfa3f9..748697a64ba9 100644
--- a/drivers/misc/nct1008.c
+++ b/drivers/misc/nct1008.c
@@ -441,7 +441,6 @@ static void nct1008_work_func(struct work_struct *work)
int nentries = data->limits_sz;
int lo_limit = 0, hi_limit = 0;
int intr_status = i2c_smbus_read_byte_data(data->client, STATUS_RD);
- bool throttle = false;
err = nct1008_get_temp(&data->client->dev, &temperature);
if (err) {
@@ -461,7 +460,6 @@ static void nct1008_work_func(struct work_struct *work)
} else if (temperature >= data->limits[nentries-1]) {
lo_limit = data->limits[nentries-1] - ALERT_HYSTERESIS;
hi_limit = data->plat_data.shutdown_ext_limit;
- throttle = true;
} else {
for (i = 0; (i + 1) < nentries; i++) {
if (temperature >= data->limits[i] &&
@@ -473,6 +471,15 @@ static void nct1008_work_func(struct work_struct *work)
}
}
+ if (temperature >= data->plat_data.throttling_ext_limit) {
+ /* start throttling */
+ therm_throttle(data, true);
+ } else if (temperature <
+ (data->plat_data.throttling_ext_limit - ALERT_HYSTERESIS)) {
+ /* switch off throttling */
+ therm_throttle(data, false);
+ }
+
if (lo_limit == hi_limit) {
err = -ENODATA;
goto out;
@@ -503,19 +510,12 @@ static void nct1008_work_func(struct work_struct *work)
current_hi_limit = hi_limit;
}
- if (throttle) {
- /* start throttling */
- therm_throttle(data, true);
- goto out;
- } else {
- /* switch off throttling */
- therm_throttle(data, false);
- }
-
/* inform edp governor */
if (edp_thermal_zone_val != temperature)
- // FIXME: Move this direct tegra_ function call to be called via
- // a pointer in 'struct nct1008_data' (like 'alarm_fn')
+ /*
+ * FIXME: Move this direct tegra_ function call to be called
+ * via a pointer in 'struct nct1008_data' (like 'alarm_fn')
+ */
tegra_edp_update_thermal_zone(temperature);
edp_thermal_zone_val = temperature;
@@ -629,7 +629,10 @@ static int __devinit nct1008_configure_sensor(struct nct1008_data* data)
if (err)
goto error;
} else {
- /* External Temperature Throttling limit */
+ /*
+ * External Temperature Throttling limit:
+ * Applies when 'Thermal Zones' are not specified.
+ */
hi_limit = pdata->throttling_ext_limit;
}