hosted: Consolidate the code that polls the battery charging status

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
This commit is contained in:
Solomon Peachy 2021-03-10 18:10:00 -05:00
parent b3b8310e4e
commit 555299af9f
19 changed files with 80 additions and 187 deletions

View file

@ -23,8 +23,5 @@
#include <stdbool.h>
#include "config.h"
unsigned int agptek_power_input_status(void);
bool agptek_power_charging_status(void);
unsigned int agptek_power_get_battery_voltage(void);
#endif /* _POWER_AGPTEK_H_ */