linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current
@ 2015-05-28 19:50 Marek Belisko
  2015-05-28 19:50 ` [PATCH 2/2] iio: adc: twl4030_madc: Fix description of twl4030_madc_set_current_generator() Marek Belisko
  2015-06-07 16:25 ` [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current Jonathan Cameron
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Belisko @ 2015-05-28 19:50 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linux-kernel, hns, Marek Belisko

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.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Marek Belisko <marek@goldelico.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] iio: adc: twl4030_madc: Fix description of twl4030_madc_set_current_generator()
  2015-05-28 19:50 [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current Marek Belisko
@ 2015-05-28 19:50 ` Marek Belisko
  2015-06-07 16:25 ` [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current Jonathan Cameron
  1 sibling, 0 replies; 4+ messages in thread
From: Marek Belisko @ 2015-05-28 19:50 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linux-kernel, hns, Marek Belisko

From: "H. Nikolaus Schaller" <hns@goldelico.com>

The @chan parameter can be 0 or 1 and not a bit mask. Fix wrong description.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Marek Belisko <marek@goldelico.com>
---
 drivers/iio/adc/twl4030-madc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index 6d2d429..06f4792 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -662,10 +662,8 @@ EXPORT_SYMBOL_GPL(twl4030_get_madc_conversion);
  *
  * @madc:	pointer to twl4030_madc_data struct
  * @chan:	can be one of the two values:
- *		TWL4030_BCI_ITHEN
- *		Enables bias current for main battery type reading
- *		TWL4030_BCI_TYPEN
- *		Enables bias current for main battery temperature sensing
+ *		0 - Enables bias current for main battery type reading
+ *		1 - Enables bias current for main battery temperature sensing
  * @on:		enable or disable chan.
  *
  * Function to enable or disable bias current for
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current
  2015-05-28 19:50 [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current Marek Belisko
  2015-05-28 19:50 ` [PATCH 2/2] iio: adc: twl4030_madc: Fix description of twl4030_madc_set_current_generator() Marek Belisko
@ 2015-06-07 16:25 ` Jonathan Cameron
  2015-06-07 16:33   ` Dr. H. Nikolaus Schaller
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2015-06-07 16:25 UTC (permalink / raw)
  To: Marek Belisko; +Cc: linux-iio, linux-kernel, hns

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current
  2015-06-07 16:25 ` [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current Jonathan Cameron
@ 2015-06-07 16:33   ` Dr. H. Nikolaus Schaller
  0 siblings, 0 replies; 4+ messages in thread
From: Dr. H. Nikolaus Schaller @ 2015-06-07 16:33 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Marek Belisko, linux-iio, linux-kernel


Am 07.06.2015 um 18:25 schrieb Jonathan Cameron <jic23@kernel.org>:

> 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!

Yes, that is fine.

>> 
>> 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

Thanks,
Nikolaus

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-07 16:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28 19:50 [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current Marek Belisko
2015-05-28 19:50 ` [PATCH 2/2] iio: adc: twl4030_madc: Fix description of twl4030_madc_set_current_generator() Marek Belisko
2015-06-07 16:25 ` [PATCH 1/2] iio: adc: twl4030_madc: Fix calculation of the temperature sense current Jonathan Cameron
2015-06-07 16:33   ` Dr. H. Nikolaus Schaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).