[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1432842619-7251-1-git-send-email-marek@goldelico.com>
Date: Thu, 28 May 2015 21:50:18 +0200
From: Marek Belisko <marek@...delico.com>
To: jic23@...nel.org
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
hns@...delico.com, Marek Belisko <marek@...delico.com>
Subject: [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current
From: "H. Nikolaus Schaller" <hns@...delico.com>
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@...delico.com>
Signed-off-by: Marek Belisko <marek@...delico.com>
---
drivers/iio/adc/twl4030-madc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 */
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists