From 555299af9f0ee71c1ad86a6c6846748861be458b Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Wed, 10 Mar 2021 18:10:00 -0500 Subject: 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 --- firmware/target/hosted/xduoo/powermgmt-xduoo.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'firmware/target/hosted/xduoo/powermgmt-xduoo.c') 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] = 3485, 3780, 3836, 3857, 3890, 3930, 3986, 4062, 4158, 4185, 4196 }; -unsigned int power_input_status(void) -{ - /* POWER_INPUT_USB_CHARGER, POWER_INPUT_NONE */ - return xduoo_power_input_status(); -} - #if defined(XDUOO_X3II) int _battery_voltage(void) { @@ -63,8 +57,3 @@ int _battery_level(void) return xduoo_power_get_battery_capacity(); } #endif - -bool charging_state(void) -{ - return xduoo_power_charging_status(); -} -- cgit v1.2.3