summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorLinqiang Pu <dpu@nvidia.com>2012-06-13 10:09:10 +0800
committerVarun Wadekar <vwadekar@nvidia.com>2012-07-12 10:12:28 +0530
commit498a6de4e72b6d20e2e7e33a6020267876ac3f75 (patch)
tree88df834128789545f9b57f02ef5adeab608adba8 /drivers/hwmon
parent82f7e2f76e924523de912b1f804d5c10772d1958 (diff)
hwmon: tsensor: fix system hang in 0C.
Changed the low temp to 0C since 20C is very easy to trigger thermal alert under -15C to 15C environment temperature. And the thermal alert will run into endless alert from tsensor_work_func. Also revised suspend and resume routine to cancel the work when suspending and disable/enable irq. Bug 999175 Signed-off-by: Linqiang Pu <dpu@nvidia.com> (cherry picked from commit 6a909bfa690991438be298d4933946a92e4929c4) Change-Id: Icafc6d5f0164204cc0cb7bea64bef2fadadbfbfd Reviewed-on: http://git-master/r/111550 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/tegra-tsensor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/tegra-tsensor.c b/drivers/hwmon/tegra-tsensor.c
index 44caa23e72c3..7a8d26b86721 100644
--- a/drivers/hwmon/tegra-tsensor.c
+++ b/drivers/hwmon/tegra-tsensor.c
@@ -655,7 +655,7 @@ int tsensor_thermal_get_temp_low(struct tegra_tsensor_data *data,
long *milli_temp)
{
/* temp to counter below 20C seems to be inaccurate */
- *milli_temp = 20000;
+ *milli_temp = 0;
return 0;
}
@@ -2016,6 +2016,8 @@ static int tsensor_suspend(struct platform_device *pdev,
struct tegra_tsensor_data *data = platform_get_drvdata(pdev);
unsigned int config0;
+ disable_irq(data->irq);
+ cancel_delayed_work_sync(&data->work);
/* set STOP bit, else OVERFLOW interrupt seen in LP1 */
config0 = tsensor_readl(data, ((data->instance << 16) | SENSOR_CFG0));
config0 |= (1 << SENSOR_CFG0_STOP_SHIFT);
@@ -2046,6 +2048,7 @@ static int tsensor_resume(struct platform_device *pdev)
if (data->is_edp_supported)
schedule_delayed_work(&data->work, 0);
+ enable_irq(data->irq);
return 0;
}
#endif