Le 25/11/2014 19:41, Alexandre Bm a écrit : > Hello, > > I'm trying to work on the implementation of the new battery standard, > and now, more specifically on the support of multiple batteries[1] > right now. > I attached a WIP patch, a draft, it's some hacks I did to understand > how it works. actually I tested on my laptop but it has a different > sysfs from FirefoxOS, so I'm wondering, > Can anyone help me by giving me some pointers to the Documentation (or > some drivers) of SysFS from the android (Gonk) side ? I need to know > how the filesystem is created, if there is some standards. > Thanks
You may want to have a look at the kernel code, specifically the Flame KK is available at https://github.com/mozilla-b2g/codeaurora_kernel_msm/tree/t2m-flame-3.4-kk, and I think you may be interested by the SysFS Power supply class regarding the bug you are referring to. I don't have any device with Android/Gonk that have multiple batteries, but still those do expose multiple power supply devices in sysfs: $ adb shell ls -al /sys/class/power_supply/ lrwxrwxrwx root root 1970-02-28 16:37 battery -> ../../devices/platform/msm_ssbi.0/pm8921-core/pm8921-charger/power_supply/battery lrwxrwxrwx root root 1970-02-28 16:37 pm8921-dc -> ../../devices/platform/msm_ssbi.0/pm8921-core/pm8921-charger/power_supply/pm8921-dc lrwxrwxrwx root root 1970-02-28 16:37 usb -> ../../devices/platform/msm_ssbi.0/pm8921-core/pm8921-charger/power_supply/usb $ adb shell ls -al /sys/class/power_supply/ lrwxrwxrwx root root 1970-01-01 21:59 battery -> ../../devices/qpnp-charger-eed0f400/power_supply/battery lrwxrwxrwx root root 1970-01-01 21:59 bms -> ../../devices/qpnp-bms-eed12200/power_supply/bms lrwxrwxrwx root root 1970-01-01 21:59 usb -> ../../devices/f9a55000.usb/power_supply/usb Those are similar to what I can see on my ThinkPad that has multiple batteries. > > [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1050752 > _______________________________________________ > dev-b2g mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-b2g > _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
