summaryrefslogtreecommitdiffstats
path: root/firmware/target
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-12-24 19:36:37 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-12-24 19:36:37 +0000
commit377b42b63bf49e72f49969ad96eeeef8cc3c4ce2 (patch)
tree3167e772e655c71c4dc58a2ceaa8a190d65ff287 /firmware/target
parent9b8f56f35cfd67a1438ef7a6676319405b226d5d (diff)
downloadrockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.tar.gz
rockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.tar.bz2
rockbox-377b42b63bf49e72f49969ad96eeeef8cc3c4ce2.zip
H10 can distinguish USB and MAIN charger input so return proper flags. H100s were misconfigured and should use CHARGING_SIMPLE. Comment more on what charging types mean in config.h.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19582 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/iriver/h10/power-h10.c12
-rw-r--r--firmware/target/coldfire/iriver/h100/power-h100.c6
2 files changed, 9 insertions, 9 deletions
diff --git a/firmware/target/arm/iriver/h10/power-h10.c b/firmware/target/arm/iriver/h10/power-h10.c
index 1a1f6afbfb..2535c5839f 100644
--- a/firmware/target/arm/iriver/h10/power-h10.c
+++ b/firmware/target/arm/iriver/h10/power-h10.c
@@ -50,9 +50,15 @@ void power_init(void)
unsigned int power_input_status(void)
{
- /* No separate source for USB and charges from USB on its own */
- return (GPIOF_INPUT_VAL & 0x08) ?
- POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
+ unsigned int status = POWER_INPUT_NONE;
+
+ if (GPIOF_INPUT_VAL & 0x08)
+ status = POWER_INPUT_MAIN_CHARGER;
+
+ if (GPIOL_INPUT_VAL & 0x04)
+ status |= POWER_INPUT_USB_CHARGER;
+
+ return status;
}
void ide_power_enable(bool on)
diff --git a/firmware/target/coldfire/iriver/h100/power-h100.c b/firmware/target/coldfire/iriver/h100/power-h100.c
index 2717e42f4a..1dcea9ce0e 100644
--- a/firmware/target/coldfire/iriver/h100/power-h100.c
+++ b/firmware/target/coldfire/iriver/h100/power-h100.c
@@ -57,12 +57,6 @@ unsigned int power_input_status(void)
POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
}
-/* Returns true if the unit is charging the batteries. */
-bool charging_state(void)
-{
- return (power_input_status() & POWER_INPUT_CHARGER) != 0;
-}
-
#ifdef HAVE_SPDIF_POWER
void spdif_power_enable(bool on)
{