diff options
author | Bitan Biswas <bbiswas@nvidia.com> | 2011-07-12 21:05:55 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-07-13 14:23:39 -0700 |
commit | e3172b7760eed4dca31f64c373130e2b1c862b43 (patch) | |
tree | 02ebb212d1f6bcddc16e9bf8dfe4c5a3784e871e /drivers/hwmon | |
parent | eb158ee01e6ff15821aa43bc02f048d83c677e7f (diff) |
hwmon: tegra: tsensor: set STOP bit in suspend
tsensor STOP bit is set before suspend. This disables the
counters and prevents OVERFLOW interrupt in LP1 mode
bug 850683
Change-Id: I01fbc9529ecc25ce96f50a5fbf599c9bce2157b5
Reviewed-on: http://git-master/r/40656
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Tested-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/tegra-tsensor.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/hwmon/tegra-tsensor.c b/drivers/hwmon/tegra-tsensor.c index b3edeb3c844e..7e0f002fc4dd 100644 --- a/drivers/hwmon/tegra-tsensor.c +++ b/drivers/hwmon/tegra-tsensor.c @@ -1628,6 +1628,14 @@ static int tsensor_suspend(struct platform_device *pdev, pm_message_t state) { struct tegra_tsensor_data *data = platform_get_drvdata(pdev); + unsigned int config0; + int i; + /* set STOP bit, else OVERFLOW interrupt seen in LP1 */ + for (i = 0; i < TSENSOR_COUNT; i++) { + config0 = tsensor_readl(data, ((i << 16) | SENSOR_CFG0)); + config0 |= (1 << SENSOR_CFG0_STOP_SHIFT); + tsensor_writel(data, config0, ((i << 16) | SENSOR_CFG0)); + } /* TBD: check anything else that could be needed for suspend */ tsensor_clk_enable(data, false); @@ -1637,8 +1645,16 @@ static int tsensor_suspend(struct platform_device *pdev, static int tsensor_resume(struct platform_device *pdev) { struct tegra_tsensor_data *data = platform_get_drvdata(pdev); + unsigned int config0; + int i; /* TBD: check anything else that could be needed for resume */ tsensor_clk_enable(data, true); + /* clear STOP bit */ + for (i = 0; i < TSENSOR_COUNT; i++) { + config0 = tsensor_readl(data, ((i << 16) | SENSOR_CFG0)); + config0 &= ~(1 << SENSOR_CFG0_STOP_SHIFT); + tsensor_writel(data, config0, ((i << 16) | SENSOR_CFG0)); + } return 0; } |