[Letux-kernel] new generic battery driver
marek.belisko at gmail.com
Tue Jun 14 21:17:52 CEST 2016
On Tue, Jun 7, 2016 at 5:19 PM, H. Nikolaus Schaller <hns at goldelico.com> wrote:
> Hi Marek,
> I have now merged/fixed (the DT patch had to be included in work/hns/dt/gta04)
> and I hope that I did not forget/break anything.
> What I now get is:
> Battery /sys/class/power_supply/generic-adc-batt
> type: Battery
> technology: Li-ion
> capacity: 49%
> status: Discharging
> volt: 3824uV
> current: -750uA
> temp: 0°C
> charge: 0uAh
> full: uAh
> design: 4000uAh
> energy: J?
> power: W?
> discharge: s to empty average
> remaining: s to empty
> charging: s to full
> This looks already quite good.
> Volt & capacity look reasonable, but for current I think it must convert between mA (iio) and µA (power_supply).
> Design should be something like 1200000 uAh (and configured by device tree).
> We can simply make "full" === "design".
> Charge could then be capacity (%) * full uAh.
> So we can even report more useful values.
> One thing I think we should add is a current offset. The reason is that the charging
> current is split between battery and OMAP and only what the OMAP does not draw is
> So we need to compensate for this effect. That adds another DT parameter
> for the current-offset-mA. We will set this to ca. 300mA.
> I have still seen "discharging" even if the charger is active. This might also have something
> to do with this issue.
This could be an issue. I'll look on it.
> And the battery resistance should also be a DT parameter (internal-battery-resistance-mOhm).
> I will push the new version to git (overwriting yours) so that you can compare with your local
> branch. If something is missing or to be added, please commit to git version (and let me know
> so that I will pull it before pushing).
> Letux-kernel mailing list
> Letux-kernel at openphoenux.org
as simple and primitive as possible
Marek Belisko - OPEN-NANDRA
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
More information about the Letux-kernel