mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
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>
This commit is contained in:
parent
f7edbe0129
commit
2695584a5c
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
struct ti_bandgap {
|
struct ti_bandgap {
|
||||||
ulong base;
|
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);
|
struct ti_bandgap *bgp = dev_get_priv(dev);
|
||||||
|
|
||||||
bgp->temperature = 0x3ff & readl(bgp->base + CTRL_CORE_TEMP_SENSOR_MPU);
|
bgp->adc_val = 0x3ff & readl(bgp->base + CTRL_CORE_TEMP_SENSOR_MPU);
|
||||||
*temp = dra752_adc_to_temp[bgp->temperature - DRA752_ADC_START_VALUE];
|
*temp = dra752_adc_to_temp[bgp->adc_val - DRA752_ADC_START_VALUE];
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user