提交 0cbb39f1 编写于 作者: H H. Nikolaus Schaller 提交者: 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: NH. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: NMarek Belisko <marek@goldelico.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册