summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/xduoo/powermgmt-xduoo.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/xduoo/powermgmt-xduoo.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/xduoo/powermgmt-xduoo.c')
-rw-r--r--firmware/target/hosted/xduoo/powermgmt-xduoo.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/firmware/target/hosted/xduoo/powermgmt-xduoo.c b/firmware/target/hosted/xduoo/powermgmt-xduoo.c
index 35d9e45ffc..855072031e 100644
--- a/firmware/target/hosted/xduoo/powermgmt-xduoo.c
+++ b/firmware/target/hosted/xduoo/powermgmt-xduoo.c
@@ -44,12 +44,6 @@ const unsigned short const percent_to_volt_charge[11] =
44 3485, 3780, 3836, 3857, 3890, 3930, 3986, 4062, 4158, 4185, 4196 44 3485, 3780, 3836, 3857, 3890, 3930, 3986, 4062, 4158, 4185, 4196
45}; 45};
46 46
47unsigned int power_input_status(void)
48{
49 /* POWER_INPUT_USB_CHARGER, POWER_INPUT_NONE */
50 return xduoo_power_input_status();
51}
52
53#if defined(XDUOO_X3II) 47#if defined(XDUOO_X3II)
54int _battery_voltage(void) 48int _battery_voltage(void)
55{ 49{
@@ -63,8 +57,3 @@ int _battery_level(void)
63 return xduoo_power_get_battery_capacity(); 57 return xduoo_power_get_battery_capacity();
64} 58}
65#endif 59#endif
66
67bool charging_state(void)
68{
69 return xduoo_power_charging_status();
70}