summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/agptek/power-agptek.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-03-10 18:10:00 -0500
committerSolomon Peachy <pizza@shaftnet.org>2021-03-10 18:29:29 -0500
commit555299af9f0ee71c1ad86a6c6846748861be458b (patch)
tree2237e2991231cf529420f52c10a91912ed94bf06 /firmware/target/hosted/agptek/power-agptek.c
parentb3b8310e4e07902a8280a120948f0c32c85e67de (diff)
downloadrockbox-555299af9f0ee71c1ad86a6c6846748861be458b.tar.gz
rockbox-555299af9f0ee71c1ad86a6c6846748861be458b.zip
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
Diffstat (limited to 'firmware/target/hosted/agptek/power-agptek.c')
-rw-r--r--firmware/target/hosted/agptek/power-agptek.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/firmware/target/hosted/agptek/power-agptek.c b/firmware/target/hosted/agptek/power-agptek.c
index 023d3888b9..a327ba6d06 100644
--- a/firmware/target/hosted/agptek/power-agptek.c
+++ b/firmware/target/hosted/agptek/power-agptek.c
@@ -32,28 +32,6 @@
const char * const sysfs_bat_voltage =
"/sys/class/power_supply/battery/voltage_now";
-const char * const sysfs_bat_status =
- "/sys/class/power_supply/battery/status";
-
-const char * const sysfs_pow_supply =
- "/sys/class/power_supply/usb/present";
-
-unsigned int agptek_power_input_status(void)
-{
- int present = 0;
- sysfs_get_int(sysfs_pow_supply, &present);
-
- return present ? POWER_INPUT_USB_CHARGER : POWER_INPUT_NONE;
-}
-
-bool agptek_power_charging_status(void)
-{
- char buf[12] = {0};
- sysfs_get_string(sysfs_bat_status, buf, sizeof(buf));
-
- return (strncmp(buf, "Charging", 8) == 0);
-}
-
unsigned int agptek_power_get_battery_voltage(void)
{
int battery_voltage;