Skip to content

device-pine64-{pinephone,pinetab}: shutdown on critical battery

The PMIC AXP803 in the PinePhone and PineTab sends an interrupt to wake up the device in case the battery is low (~15% default). This way, userspace can act upon this and properly shut down the device and avoid any data loss as the PMIC will cut the power when the battery level goes further down to around 0%.

The userspace component here is UPower. UPower is used by Phosh/GNOME and by Powerdevil from KDE, thus also Plasma Mobile. The default values of UPower, who is responsible for this task, do not take action at 15% battery level already. This patch changes these values to allow PinePhones and PineTabs to gracefully shutdown and prevent data loss.

Requires Megi's Linux kernel v5.12 (!2149 (merged))

Note: This patch is rather hard to test though as you need an almost flat battery that isn't too flat :P I have noticed that UPower acts upon a low battery already by showing a warning in the UI, so we can assume that correcting the values in the UPower config will actually shutdown the device instead of only showing a warning.

Edited by Dylan Van Assche

Merge request reports