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
Unifies codec size with most targets.
Apart from other things increased size improves seek accuracy in long m4b audiobooks.
Tested on Agptek Rocker and XDuoo X3II
Related discussion: https://www.rockbox.org/tracker/task/13049#comment44591
Change-Id: Id246969e78386b71ac66aace128cfba72a3f209e
affects all hiby targets, fiiom3k, and ibasso dx50/dx90
As well as deduplicating a small pile of code, this also implements
hysteresis so we're not doing a sysfs read/lookup multiple times
back-to-back every time the power management tick fires.
Change-Id: I2f7672acbb36341becf67e07960c24c681270d09