Post by Ed RobbinsOn Thu, 17 Oct 2024 at 16:51, John Paul Adrian Glaubitz
Post by John Paul Adrian GlaubitzHi Ed,
Post by Ed RobbinsSo I think that the apm_emu module should be included by default in
powerpc kernel builds. Is it possible to have it added to the kernel
config?
Yes, this is possible. Someone needs to open a pull request with the
corresponding change to the powerpc kernel configuration [1].
Adrian
Post by Ed Robbins[1] https://salsa.debian.org/kernel-team/linux/-/blob/master/debian/config/kernelarch-powerpc/config?ref_type=heads
I spent some time looking at this again this evening, and it turns out
that there is a much better solution. The macintosh PMU driver uses
the Linux power supply subsystem and reports info about the battery,
but it is not being picked up by the upower daemon because the driver
does not give the battery type, so it comes out as "Unknown", and
upower doesn't recognise it as battery:
***@powerbook12:~$ cat /sys/class/power_supply/PMU_battery_0/uevent
DEVTYPE=power_supply
POWER_SUPPLY_NAME=PMU_battery_0
POWER_SUPPLY_TYPE=Unknown
...
***@powerbook12:~$ sudo journalctl -u upower
...
Oct 13 20:00:24 powerbook12 upowerd[994]: did not recognise type
Unknown, please report
...
***@powerbook12:~$ upower -e
/org/freedesktop/UPower/devices/line_power_pmu_ac
/org/freedesktop/UPower/devices/DisplayDevice
It turns out that adding a single line in the driver
(drivers/power/supply/pmu_battery.c) is enough to fix this:
pbat->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY;
After recompiling the module upower can see the battery and the
default GUI indicators work as well.
I will try to submit this change upstream.
Ed