Re: [PATCH] ACPI / battery: Fix reporting "Not charging" when capacity is 100%

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux