summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-11-30 02:38:05 +0000
committerAidan MacDonald <amachronic@protonmail.com>2023-09-30 03:21:52 -0400
commita6eaffe40d5e2b697686d56a648d98aca376284d (patch)
tree51788608283982dc525d5ba2df91d95456e1b09a
parentd05f6aac2d51b2c284b8185bc34383e62e2fb21f (diff)
downloadrockbox-a6eaffe40d5e2b697686d56a648d98aca376284d.tar.gz
rockbox-a6eaffe40d5e2b697686d56a648d98aca376284d.zip
powermgmt: Remove CURRENT_USB
CURRENT_USB overrides CURRENT_NORMAL when USB is plugged. It defaults to 2 mA and wasn't defined on any target, but this doesn't make sense to me. After all, the current drawn by the CPU or other components won't change just because USB was plugged in. As far as I can tell, the only side effect of removing this is reducing the estimated USB charging current. This might mean CURRENT_MAX_CHG should be increased by CURRENT_NORMAL on some (all?) targets to compensate, but I'm not sure which targets would be affected. Change-Id: I5aa5c3893ae1e4ce6b8803ab4e8c897d534eb08f
-rw-r--r--firmware/export/powermgmt.h7
-rw-r--r--firmware/powermgmt.c12
2 files changed, 0 insertions, 19 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index 41594abe4d..a78386445e 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -84,13 +84,6 @@ enum shutdown_type
84/* Start up power management thread */ 84/* Start up power management thread */
85void powermgmt_init(void) INIT_ATTR; 85void powermgmt_init(void) INIT_ATTR;
86 86
87/* Generic current values that are intentionally meaningless - config header
88 * should define proper numbers.*/
89
90#ifndef CURRENT_USB
91#define CURRENT_USB 2 /* usual current in mA in USB mode */
92#endif
93
94#if CONFIG_CHARGING && !defined(CURRENT_MAX_CHG) 87#if CONFIG_CHARGING && !defined(CURRENT_MAX_CHG)
95#define CURRENT_MAX_CHG 350 /* maximum charging current */ 88#define CURRENT_MAX_CHG 350 /* maximum charging current */
96#endif 89#endif
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index abcd32f814..e455127496 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -190,18 +190,6 @@ int battery_current(void)
190 int current = CURRENT_NORMAL; 190 int current = CURRENT_NORMAL;
191 191
192#ifndef BOOTLOADER 192#ifndef BOOTLOADER
193 if (usb_inserted()
194#ifdef HAVE_USB_POWER
195 #if (CURRENT_USB < CURRENT_NORMAL)
196 || usb_powered_only()
197 #else
198 && !usb_powered_only()
199 #endif
200#endif
201 ) {
202 current = CURRENT_USB;
203 }
204
205#if defined(HAVE_BACKLIGHT) && defined(CURRENT_BACKLIGHT) 193#if defined(HAVE_BACKLIGHT) && defined(CURRENT_BACKLIGHT)
206 if (backlight_get_current_timeout() == 0) /* LED always on */ 194 if (backlight_get_current_timeout() == 0) /* LED always on */
207 current += CURRENT_BACKLIGHT; 195 current += CURRENT_BACKLIGHT;