Messages in this thread | | | Date | Fri, 8 Sep 2017 13:32:31 +0200 | From | Pavel Machek <> | Subject | libbattery was Re: [RFC PATCH 5/5] power: generic-adc-battery: Add capacity handling |
| |
Hi!
> > + case POWER_SUPPLY_PROP_CAPACITY: > > + { > > + int ret, curr, voltage; > > + > > + ret = read_channel(adc_bat, POWER_SUPPLY_PROP_CURRENT_NOW, &curr); > > + ret |= read_channel(adc_bat, POWER_SUPPLY_PROP_VOLTAGE_NOW, &voltage); > > + if (ret < 0) > > + goto err; > > + > > + val->intval = fuel_level_LiIon(voltage, curr, 10); > > + } > > + break; > > default: > > return -EINVAL; > > } > > Without patch description: See Last Question in > > Documentation/power/power_supply_class.txt
...should be done in libbattery, yet to be written. :-).
Do you have specific guidance what you'd like to see in libbattery?
I was thinking about creating lib_pocket_hardware -- that would hide battery details, plus other phone-related stuff such as LEDs, backlights, temperatures, ...
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] | |