Commit 0cbb39f1 authored by H. Nikolaus Schaller's avatar H. Nikolaus Schaller Committed by Jonathan Cameron

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: default avatarH. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: default avatarMarek Belisko <marek@goldelico.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent ae6d9ce0
...@@ -235,7 +235,7 @@ static int twl4030battery_temperature(int raw_volt) ...@@ -235,7 +235,7 @@ static int twl4030battery_temperature(int raw_volt)
if (ret < 0) if (ret < 0)
return ret; return ret;
curr = ((val & TWL4030_BCI_ITHEN) + 1) * 10; curr = ((val & TWL4030_BCI_ITHSENS) + 1) * 10;
/* Getting and calculating the thermistor resistance in ohms */ /* Getting and calculating the thermistor resistance in ohms */
res = volt * 1000 / curr; res = volt * 1000 / curr;
/* calculating temperature */ /* calculating temperature */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment