hosted: consolidate sysfs-based battery measurement code

Several hosted targets read their battery state from a fixed
sysfs path. Get rid of the duplicated code by handling this
common case in power-linux.c.

Some targets use non-standard units in sysfs instead of the
typical microvolts / microamps, so allow the scale factors
to be overridden by the target.

Change-Id: I31dc4ffc7a2d2c066d00a74070f9f9849c1663d0
This commit is contained in:
Aidan MacDonald 2025-12-01 13:32:26 +00:00
parent 7ffdf50ba5
commit 806b71b2ed
20 changed files with 74 additions and 454 deletions

View file

@ -26,7 +26,6 @@
#include "usb.h"
#include "sysfs.h"
#include "power.h"
#include "power-fiio.h"
#ifdef HAVE_MULTIDRIVE
void cleanup_rbhome(void);