lkml.org 
[lkml]   [2015]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current
On 28/05/15 20:50, Marek Belisko wrote:
> From: "H. Nikolaus Schaller" <hns@goldelico.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.
I'm going to take that literally and apply it via the slow route on
the basis that a bug no one noticed doesn't need fixing fast!
>
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> Signed-off-by: Marek Belisko <marek@goldelico.com>
Applied to the togreg branch of iio.git - initially pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
> 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 */
>



\
 
 \ /
  Last update: 2015-06-07 18:41    [W:0.035 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site