All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery
@ 2011-04-25 13:45 Paul Parsons
  2011-05-20 15:47 ` Anton Vorontsov
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Parsons @ 2011-04-25 13:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: cbou, dwmw2

Fix rated capacity of the HP iPAQ hx4700 3.7V 1800mAh (359113-001) battery. For this battery the value of the rated capacity EEPROM register at 0x32 is 7; thus rated_capacities[7] = 1800.

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
@@ -86,7 +86,11 @@ static int rated_capacities[] = {
 	920,	/* NEC */
 	1440,	/* Samsung */
 	1440,	/* BYD */
+#ifdef CONFIG_MACH_H4700
+	1800,	/* HP iPAQ hx4700 3.7V 1800mAh (359113-001) */
+#else
 	1440,	/* Lishen */
+#endif
 	1440,	/* NEC */
 	2880,	/* Samsung */
 	2880,	/* BYD */


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

* Re: [PATCH] ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery
  2011-04-25 13:45 [PATCH] ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery Paul Parsons
@ 2011-05-20 15:47 ` Anton Vorontsov
  2011-05-20 17:45   ` Dmitry Artamonow
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Vorontsov @ 2011-05-20 15:47 UTC (permalink / raw)
  To: Paul Parsons; +Cc: linux-kernel, dwmw2, Dmitry Artamonow, Philipp Zabel

On Mon, Apr 25, 2011 at 01:45:40PM +0000, Paul Parsons wrote:
> Fix rated capacity of the HP iPAQ hx4700 3.7V 1800mAh (359113-001) battery. For this battery the value of the rated capacity EEPROM register at 0x32 is 7; thus rated_capacities[7] = 1800.
> 
> Signed-off-by: Paul Parsons <lost.distance@yahoo.com>

Applied, thanks!

> ---
> --- 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
> @@ -86,7 +86,11 @@ static int rated_capacities[] = {
>  	920,	/* NEC */
>  	1440,	/* Samsung */
>  	1440,	/* BYD */
> +#ifdef CONFIG_MACH_H4700

Note that this is OK as a temporary fix, but in general such fixups
should be done via platform data. So, it would be great if you could
prepare another patch on top of this one, which would do things in
a proper way.

> +	1800,	/* HP iPAQ hx4700 3.7V 1800mAh (359113-001) */
> +#else
>  	1440,	/* Lishen */
> +#endif
>  	1440,	/* NEC */
>  	2880,	/* Samsung */
>  	2880,	/* BYD */

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

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

* Re: [PATCH] ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery
  2011-05-20 15:47 ` Anton Vorontsov
@ 2011-05-20 17:45   ` Dmitry Artamonow
  2011-05-20 18:34     ` Paul Parsons
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Artamonow @ 2011-05-20 17:45 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: Paul Parsons, linux-kernel, dwmw2, Philipp Zabel

On 19:47 Fri 20 May     , Anton Vorontsov wrote:
> On Mon, Apr 25, 2011 at 01:45:40PM +0000, Paul Parsons wrote:

[snip]

> > --- 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
> > @@ -86,7 +86,11 @@ static int rated_capacities[] = {
> >  	920,	/* NEC */
> >  	1440,	/* Samsung */
> >  	1440,	/* BYD */
> > +#ifdef CONFIG_MACH_H4700
> > +	1800,	/* HP iPAQ hx4700 3.7V 1800mAh (359113-001) */
> > +#else
> >  	1440,	/* Lishen */
> > +#endif
> >  	1440,	/* NEC */
> 
> Note that this is OK as a temporary fix, but in general such fixups
> should be done via platform data. So, it would be great if you could
> prepare another patch on top of this one, which would do things in
> a proper way.

BTW, hx4700 also have extended batteries. I personally have one that rated
3600mAh with my hx4700. Sadly I dropped it on the floor some time ago and
battery lock got broken, so I currently can't use it. But I hope to fix it
some day.

It looks like this one, but made by PALMEXX (Part No.359113-001):
http://www.amazon.com/Li-Ion-359113-001-Battery-hx4700-hx4705/dp/B000VN7QMQ

-- 
Best regards,
Dmitry "MAD" Artamonow


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

* Re: [PATCH] ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery
  2011-05-20 17:45   ` Dmitry Artamonow
@ 2011-05-20 18:34     ` Paul Parsons
  2011-05-20 19:14       ` Dmitry Artamonow
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Parsons @ 2011-05-20 18:34 UTC (permalink / raw)
  To: Anton Vorontsov, Dmitry Artamonow; +Cc: linux-kernel, dwmw2, Philipp Zabel

> BTW, hx4700 also have extended batteries. I personally have
> one that rated
> 3600mAh with my hx4700. Sadly I dropped it on the floor
> some time ago and
> battery lock got broken, so I currently can't use it. But I
> hope to fix it
> some day.

I knew about the 3600mAh battery but unfortunately I don't possess one, so was not able to add it to the patch. I only have the default 1800mAh battery which shipped with the hx4700.

If anybody here does have an hx4700 with the 3600mAh battery and is able to run Linux on it, it would be a big help if they could apply the following patch to discover the rated capacity register value via dmesg:

--- clean-2.6.39/drivers/power/ds2760_battery.c	2011-05-19 05:06:34.000000000 +0100
+++ linux-2.6.39/drivers/power/ds2760_battery.c	2011-05-20 19:20:11.533136179 +0100
@@ -136,6 +136,9 @@ static int ds2760_battery_read_status(st
 		return 1;
 	}
 
+	if (di->update_time == 0)
+		printk("%s: rated capacity = %d\n", __func__, di->raw[DS2760_RATED_CAPACITY]);
+
 	di->update_time = jiffies;
 
 	/* DS2760 reports voltage in units of 4.88mV, but the battery class

Or perhaps HaRET has some means of dumping the register?

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

* Re: [PATCH] ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery
  2011-05-20 18:34     ` Paul Parsons
@ 2011-05-20 19:14       ` Dmitry Artamonow
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Artamonow @ 2011-05-20 19:14 UTC (permalink / raw)
  To: Paul Parsons; +Cc: Anton Vorontsov, linux-kernel, dwmw2, Philipp Zabel

On 19:34 Fri 20 May     , Paul Parsons wrote:
> 
> If anybody here does have an hx4700 with the 3600mAh battery and is able to run Linux on it, it would be a big help if they could apply the following patch to discover the rated capacity register value via dmesg:

Yes, thanks! I'll try to revive my extended battery soon and test it. And
will test standard one too - just to make coverage a bit wider. Who
knows if HP produced more than one kind of standard capacity batteries
which have different value in capacity register?

> Or perhaps HaRET has some means of dumping the register?

No, I don't think HaRET have any one-wire functions, so it's very unlikely
that it can read registers on DS2760.

-- 
Best regards,
Dmitry "MAD" Artamonow


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-25 13:45 [PATCH] ds2760_battery: Fix rated capacity of the hx4700 1800mAh battery Paul Parsons
2011-05-20 15:47 ` Anton Vorontsov
2011-05-20 17:45   ` Dmitry Artamonow
2011-05-20 18:34     ` Paul Parsons
2011-05-20 19:14       ` Dmitry Artamonow

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.