summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2015-05-28 21:50:18 +0200
committerJonathan Cameron <jic23@kernel.org>2015-06-07 17:24:44 +0100
commit0cbb39f1432096cf00eca21f2d10f6d2057c26ba (patch)
treee232c76f952716a7f018cc18f2310b350fd97338 /drivers/iio/adc
parentae6d9ce05691bf79694074db7c7da980080548af (diff)
downloadop-kernel-dev-0cbb39f1432096cf00eca21f2d10f6d2057c26ba.zip
op-kernel-dev-0cbb39f1432096cf00eca21f2d10f6d2057c26ba.tar.gz
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>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/twl4030-madc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 94c5f05..6d2d429 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -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 */
OpenPOWER on IntegriCloud