lkml.org 
[lkml]   [2009]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] battery: Fix charge_now returned by broken batteries
Hi!

> > current full charge, when the charging is complete. It may end up lower or
> > greater than
> > previous value.
> > Comparing current charge with the last full charge may correctly give you
> >>100%.
>
> Then maybe we can write something like...
>
> val->intval = acpi_battery_is_charged(battery)
> ? min(battery->capacity_now, battery->full_charge_capacity) * 1000
> : battery->capacity_now * 1000;
>
> So we only use the min() operation when it is fully charged (returning
> to 100%) without losing information when charging.
>
> The problem is that percentage may jump from >100% to 100% in
> batteries whose full capacity increase, but I think that is OK, since
> when completely charged, the >100% is the new 100%.
>
> In "broken" batteries (is it broken finally? or is it expected
> behaviour?) like mine the old problem will be corrected, as it was
> only present in the charged state.

I believe you better work around this in userspace... or agree that
>100% charge is possible.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2009-10-10 14:15    [W:0.074 / U:3.500 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site