aboutsummaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2019-11-11 15:15:30 +0530
committerLokesh Vutla <lokeshvutla@ti.com>2020-01-20 10:10:28 +0530
commit2695584a5c279a1c2b6245466b66cd3735f1f00f (patch)
treec3bc463d196c7ff8ee3b8c8e35bee4eddcabb82b /drivers/thermal
parentf7edbe012917f6b04692c0458d4d65875dd4299c (diff)
downloadu-boot-2695584a5c279a1c2b6245466b66cd3735f1f00f.zip
u-boot-2695584a5c279a1c2b6245466b66cd3735f1f00f.tar.gz
u-boot-2695584a5c279a1c2b6245466b66cd3735f1f00f.tar.bz2
thermal: ti-bandgap: Fix adc value datatype
The CORE_TEMP_SENSOR_MPU register gives a raw adc value which needs to be indexed into a lookup table to get the actual temperature. Fix the naming and datatype of the adc value variable. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/ti-bandgap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/thermal/ti-bandgap.c b/drivers/thermal/ti-bandgap.c
index b490391..8b332f1 100644
--- a/drivers/thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-bandgap.c
@@ -26,7 +26,7 @@
struct ti_bandgap {
ulong base;
- int temperature; /* in mili degree celsius */
+ uint adc_val;
};
/*
@@ -162,8 +162,8 @@ static int ti_bandgap_get_temp(struct udevice *dev, int *temp)
{
struct ti_bandgap *bgp = dev_get_priv(dev);
- bgp->temperature = 0x3ff & readl(bgp->base + CTRL_CORE_TEMP_SENSOR_MPU);
- *temp = dra752_adc_to_temp[bgp->temperature - DRA752_ADC_START_VALUE];
+ bgp->adc_val = 0x3ff & readl(bgp->base + CTRL_CORE_TEMP_SENSOR_MPU);
+ *temp = dra752_adc_to_temp[bgp->adc_val - DRA752_ADC_START_VALUE];
return 0;
}