All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/power/sbs-battery.c: capacity attr = remaining relative capacity
@ 2012-04-25  6:59 Nikolaus Voss
  2012-05-04 15:24 ` Rhyland Klein
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolaus Voss @ 2012-04-25  6:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: cbouatmailru, rklein

Currently, the capacity exported by this driver refers to reg 0x0e,
which is the absolute state of charge which according to SBS
refers to the design capacity/ energy of the battery. It can be
> 100 % and drops below 100 % for a fully charged battery with
the battery aging.

This is not what the user exspects of a remaining capacity
indication between 0 and 100 % with 100 % referring to
a fully charged battery. This is provided by SBS reg 0x0d,
which is the relative state of charge referring to the
full charge capacity.

Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
---
 drivers/power/sbs-battery.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/power/sbs-battery.c b/drivers/power/sbs-battery.c
index 9ff8af0..182d2ed 100644
--- a/drivers/power/sbs-battery.c
+++ b/drivers/power/sbs-battery.c
@@ -89,7 +89,7 @@ static const struct chip_data {
 	[REG_CURRENT] =
 		SBS_DATA(POWER_SUPPLY_PROP_CURRENT_NOW, 0x0A, -32768, 32767),
 	[REG_CAPACITY] =
-		SBS_DATA(POWER_SUPPLY_PROP_CAPACITY, 0x0E, 0, 100),
+		SBS_DATA(POWER_SUPPLY_PROP_CAPACITY, 0x0D, 0, 100),
 	[REG_REMAINING_CAPACITY] =
 		SBS_DATA(POWER_SUPPLY_PROP_ENERGY_NOW, 0x0F, 0, 65535),
 	[REG_REMAINING_CAPACITY_CHARGE] =
-- 
1.7.5.4


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

* Re: [PATCH] drivers/power/sbs-battery.c: capacity attr = remaining relative capacity
  2012-04-25  6:59 [PATCH] drivers/power/sbs-battery.c: capacity attr = remaining relative capacity Nikolaus Voss
@ 2012-05-04 15:24 ` Rhyland Klein
  2012-05-06  3:06   ` Anton Vorontsov
  0 siblings, 1 reply; 3+ messages in thread
From: Rhyland Klein @ 2012-05-04 15:24 UTC (permalink / raw)
  To: Nikolaus Voss; +Cc: linux-kernel, cbouatmailru

On Tue, 2012-04-24 at 23:59 -0700, Nikolaus Voss wrote:
> Currently, the capacity exported by this driver refers to reg 0x0e,
> which is the absolute state of charge which according to SBS
> refers to the design capacity/ energy of the battery. It can be
> > 100 % and drops below 100 % for a fully charged battery with
> the battery aging.
> 
> This is not what the user exspects of a remaining capacity
> indication between 0 and 100 % with 100 % referring to
> a fully charged battery. This is provided by SBS reg 0x0d,
> which is the relative state of charge referring to the
> full charge capacity.
> 
> Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
> ---
>  drivers/power/sbs-battery.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Ack-ed Rhyland Klein <rklein@nvidia.com>


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

* Re: [PATCH] drivers/power/sbs-battery.c: capacity attr = remaining relative capacity
  2012-05-04 15:24 ` Rhyland Klein
@ 2012-05-06  3:06   ` Anton Vorontsov
  0 siblings, 0 replies; 3+ messages in thread
From: Anton Vorontsov @ 2012-05-06  3:06 UTC (permalink / raw)
  To: Rhyland Klein; +Cc: Nikolaus Voss, linux-kernel

On Fri, May 04, 2012 at 08:24:43AM -0700, Rhyland Klein wrote:
> On Tue, 2012-04-24 at 23:59 -0700, Nikolaus Voss wrote:
> > Currently, the capacity exported by this driver refers to reg 0x0e,
> > which is the absolute state of charge which according to SBS
> > refers to the design capacity/ energy of the battery. It can be
> > > 100 % and drops below 100 % for a fully charged battery with
> > the battery aging.
> > 
> > This is not what the user exspects of a remaining capacity
> > indication between 0 and 100 % with 100 % referring to
> > a fully charged battery. This is provided by SBS reg 0x0d,
> > which is the relative state of charge referring to the
> > full charge capacity.
> > 
> > Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
> > ---
> >  drivers/power/sbs-battery.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> Ack-ed Rhyland Klein <rklein@nvidia.com>

Applied, thanks!

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

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

end of thread, other threads:[~2012-05-06  3:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-25  6:59 [PATCH] drivers/power/sbs-battery.c: capacity attr = remaining relative capacity Nikolaus Voss
2012-05-04 15:24 ` Rhyland Klein
2012-05-06  3:06   ` 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.