lkml.org 
[lkml]   [2018]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ACPI / battery: Fix reporting "Not charging" when capacity is 100%
Hi!

> > > * was plugged in and the device thus did not start a new charge cycle.
> > > */
> > > if ((battery_ac_is_broken || power_supply_is_system_supplied()) &&
> > > - battery->rate_now == 0)
> > > + battery->rate_now == 0) {
> > > + if (battery->capacity_now && battery->full_charge_capacity &&
> > > + battery->capacity_now / battery->full_charge_capacity == 1)
> > > + return POWER_SUPPLY_STATUS_FULL;
> >
> > Division? Really?

>
> If you look further down in acpi_battery_get_property, that is how the
> capacity property is calculated. Do you have a better suggestion?

if (battery->capacity_now >= battery->full_charge_capacity)

?
Pavel

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-11-11 12:30    [W:0.071 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site