Battery info sysctl for arm devices

From: Toby Kurien <toby_at_tobykurien.com>
Date: Wed, 11 Dec 2024 07:15:34 UTC
I am new to FreeBSD and busy implementing a driver for the battery and charge controller in the Pinephone Pro. Everything battery-related appears to fall under ACPI, including the sysctls in hw.acpi.battery.* and I was wondering how battery on ARM is normally handled? Is there a /dev/acpi on ARM or is there a different standard for handling battery on ARM? 
 
I looked into the source for upower to see how it handles FreeBSD, but it seems to be based on ACPI. I was wondering if I should "emulate" ACPI by registering "hw.acpi.battery.*" to expose the battery info, but then it seems upower will try to use /dev/acpi, which would fail. Any pointers on how to expose battery state on ARM would be appreciated. 

 
--  
http://tobykurien.com
 

 
--  
tobykurien.com