battery not detected when managed by PMU (apple powerbook)

Giuseppe Sacco giuseppe at eppesuigoccas.homedns.org
Mon Jun 29 01:20:29 UTC 2020


Hello,
I just tried Linux on an Apple PowerBook and found that the battery
does not show up in MATE power manager. Reading its source code I found
it uses UPower in order to access battery information.
Browsing UPower source code I noticed that PMU device is not managed at
all, at least on the Linux branch.

Some info is available on /proc file system (I am running kernel 3.16,
but I checked source of 5.7.2 and it seems everything works still in
the same manner). This file shows that the machine is on AC power
(value 1 = on AC power, value 0 = no AC power) and that the battery is
present (value is number of batteries: 0, 1, or 2)

$ cat /proc/pmu/info
PMU driver version     : 2
PMU firmware version   : 0c
AC Power               : 1
Battery count          : 1


This is the data about the first battery:

$ cat /proc/pmu/battery_0 
flags      : 00000011
charge     : 4096
max_charge : 4097
current    : 0
voltage    : 16053
time rem.  : 0

"current" will be a negative measure in µV while charging, "time rem."
is expressed in seconds. "flags" describe the battery status and the
battery type (see linux/pmu.h on kernel sources)

Another info you might require is about the udev device information.
Here it is:

$ udevadm info /dev/pmu
P: /devices/virtual/misc/pmu
N: pmu
L: 0
E: DEVPATH=/devices/virtual/misc/pmu
E: DEVNAME=/dev/pmu
E: MAJOR=10
E: MINOR=154
E: SUBSYSTEM=misc

Do you have any plan about adding support for PMU device? May I be of
any help?

Thank you,
Giuseppe



More information about the devkit-devel mailing list