mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 15:04:27 +08:00
iio: adc: twl4030_madc: Fix calculation of the temperature sense current
The bit mask to read the setting of the constant current source for measuring the NTC voltage was the wrong one. Since default value is initialized to the lowest level (000 = 10uA) the difference was probably never noticed in practice. Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Marek Belisko <marek@goldelico.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
ae6d9ce056
commit
0cbb39f143
@ -235,7 +235,7 @@ static int twl4030battery_temperature(int raw_volt)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
curr = ((val & TWL4030_BCI_ITHEN) + 1) * 10;
|
||||
curr = ((val & TWL4030_BCI_ITHSENS) + 1) * 10;
|
||||
/* Getting and calculating the thermistor resistance in ohms */
|
||||
res = volt * 1000 / curr;
|
||||
/* calculating temperature */
|
||||
|
Loading…
Reference in New Issue
Block a user