Messages in this thread | | | Date | Sun, 11 Nov 2018 12:30:29 +0100 | From | Pavel Machek <> | Subject | Re: [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] | |