summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-08-02 07:40:37 -0400
committerTom Rini <trini@konsulko.com>2015-08-02 07:40:37 -0400
commit7a1af7a79bd79ded6a78d0c1afdbc3353669e313 (patch)
tree6adcb6dfb2782e8502ca07e2533bee3f95eaeae9 /drivers/thermal
parent8968b914be7bfd67d179d0395898bd9db67aaad1 (diff)
parentf85764cc1f6ab01ffc60dd78de9c4de4cff2b5ce (diff)
downloadu-boot-imx-7a1af7a79bd79ded6a78d0c1afdbc3353669e313.zip
u-boot-imx-7a1af7a79bd79ded6a78d0c1afdbc3353669e313.tar.gz
u-boot-imx-7a1af7a79bd79ded6a78d0c1afdbc3353669e313.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-imx
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/imx_thermal.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 0d893c9..3c6c967 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -115,7 +115,7 @@ static int read_cpu_temperature(struct udevice *dev)
writel(TEMPSENSE0_FINISHED, &anatop->tempsense0_clr);
/* milli_Tmeas = c2 - Nmeas * c1 */
- temperature = (c2 - n_meas * c1)/1000;
+ temperature = (long)(c2 - n_meas * c1)/1000;
/* power down anatop thermal sensor */
writel(TEMPSENSE0_POWER_DOWN, &anatop->tempsense0_set);
@@ -130,16 +130,12 @@ int imx_thermal_get_temp(struct udevice *dev, int *temp)
int cpu_tmp = 0;
cpu_tmp = read_cpu_temperature(dev);
- while (cpu_tmp > priv->minc && cpu_tmp < priv->maxc) {
- if (cpu_tmp >= priv->critical) {
- printf("CPU Temperature (%dC) too close to max (%dC)",
- cpu_tmp, priv->maxc);
- puts(" waiting...\n");
- udelay(5000000);
- cpu_tmp = read_cpu_temperature(dev);
- } else {
- break;
- }
+ while (cpu_tmp >= priv->critical) {
+ printf("CPU Temperature (%dC) too close to max (%dC)",
+ cpu_tmp, priv->maxc);
+ puts(" waiting...\n");
+ udelay(5000000);
+ cpu_tmp = read_cpu_temperature(dev);
}
*temp = cpu_tmp;