All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ds2760_battery: Fix indexing of the 4 active full EEPROM registers
@ 2011-04-25 14:43 Paul Parsons
  2011-05-20 15:48 ` Anton Vorontsov
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Parsons @ 2011-04-25 14:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: cbou, dwmw2

Fix indexing of the 4 active full EEPROM registers. The indexing was out by 1, accessing the EEPROM registers at 0x23 to 0x26 instead of 0x22 to 0x25.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
---
--- clean-2.6.39-rc4/drivers/power/ds2760_battery.c	2011-03-15 01:20:32.000000000 +0000
+++ linux-2.6.39-rc4/drivers/power/ds2760_battery.c	2011-04-25 13:06:29.344976841 +0100
@@ -186,7 +190,7 @@ static int ds2760_battery_read_status(st
 
 	scale[0] = di->full_active_uAh;
 	for (i = 1; i < 5; i++)
-		scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 2 + i];
+		scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 1 + i];
 
 	di->full_active_uAh = battery_interpolate(scale, di->temp_C / 10);
 	di->full_active_uAh *= 1000; /* convert to µAh */


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

* Re: [PATCH] ds2760_battery: Fix indexing of the 4 active full EEPROM registers
  2011-04-25 14:43 [PATCH] ds2760_battery: Fix indexing of the 4 active full EEPROM registers Paul Parsons
@ 2011-05-20 15:48 ` Anton Vorontsov
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Vorontsov @ 2011-05-20 15:48 UTC (permalink / raw)
  To: Paul Parsons; +Cc: linux-kernel, dwmw2, Dmitry Artamonow, Philipp Zabel

On Mon, Apr 25, 2011 at 02:43:30PM +0000, Paul Parsons wrote:
> Fix indexing of the 4 active full EEPROM registers. The indexing was out by 1, accessing the EEPROM registers at 0x23 to 0x26 instead of 0x22 to 0x25.
> 
> Signed-off-by: Paul Parsons <lost.distance@yahoo.com>

Applied, thank you!

> ---
> --- clean-2.6.39-rc4/drivers/power/ds2760_battery.c	2011-03-15 01:20:32.000000000 +0000
> +++ linux-2.6.39-rc4/drivers/power/ds2760_battery.c	2011-04-25 13:06:29.344976841 +0100
> @@ -186,7 +190,7 @@ static int ds2760_battery_read_status(st
>  
>  	scale[0] = di->full_active_uAh;
>  	for (i = 1; i < 5; i++)
> -		scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 2 + i];
> +		scale[i] = scale[i - 1] + di->raw[DS2760_ACTIVE_FULL + 1 + i];
>  
>  	di->full_active_uAh = battery_interpolate(scale, di->temp_C / 10);
>  	di->full_active_uAh *= 1000; /* convert to µAh */

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

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

end of thread, other threads:[~2011-05-20 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-25 14:43 [PATCH] ds2760_battery: Fix indexing of the 4 active full EEPROM registers Paul Parsons
2011-05-20 15:48 ` Anton Vorontsov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.