Hello everyone.
This is my first post here.
After installing Gentoo on my PowerBook G4 (DLSD 15'' model) I found out that upowerd does not see the battery, so power management does not work correctly while it should.
The problem lies in pmu_battery.c in the kernel. It does not assign a proper type to the battery power supply.
So I created some patches to address the troubles I encountered.
I made a repository on github if someone ever needs these patches:
https://github.com/swayne2k/gentoo-patches
0097-therm_adt746x-third-sensor.patch - patch for thermal driver for adt746x chip present on alu G4 PowerBooks. By default there are only two sensors present in sys/devices/platform/temperatures. This fix adds the third sensor if ever someone needs that.
0098-fix_pmu_battery_type.patch - adds the correct power supply type on initialising batteries on alu G4 PowerBooks thus making upowerd recognize the battery. This was fixed in some 6.18 kernels but still applicable to 6.12 kernels at least up to 6.12.74
0099-fix_lm75_for_powerbook.patch - fixes hwmon driver to read the temperature from the lm75-type sensor present on alu G4 PowerBooks. This sensor is usually labeled as "Trackpad" and is almost useless for thermal management. But if someone needs it, here it is.
All the patches have been tested on kernel 6.12 up to 6.12.73.
