summaryrefslogtreecommitdiffstats
path: root/firmware/target/coldfire/iriver/h100/power-h100.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iriver/h100/power-h100.c')
-rw-r--r--firmware/target/coldfire/iriver/h100/power-h100.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/firmware/target/coldfire/iriver/h100/power-h100.c b/firmware/target/coldfire/iriver/h100/power-h100.c
index 6eb403732d..2717e42f4a 100644
--- a/firmware/target/coldfire/iriver/h100/power-h100.c
+++ b/firmware/target/coldfire/iriver/h100/power-h100.c
@@ -26,19 +26,14 @@
#include "power.h"
#include "spdif.h"
-
#if CONFIG_TUNER
-
bool tuner_power(bool status)
{
(void)status;
return true;
}
-
#endif /* #if CONFIG_TUNER */
-#ifndef SIMULATOR
-
void power_init(void)
{
or_l(0x00080000, &GPIO1_OUT);
@@ -56,14 +51,16 @@ void power_init(void)
#endif
}
-
-bool charger_inserted(void)
-{
- return (GPIO1_READ & 0x00400000)?true:false;
+unsigned int power_input_status(void)
+{
+ return (GPIO1_READ & 0x00400000) ?
+ POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
}
+
/* Returns true if the unit is charging the batteries. */
-bool charging_state(void) {
- return charger_inserted();
+bool charging_state(void)
+{
+ return (power_input_status() & POWER_INPUT_CHARGER) != 0;
}
#ifdef HAVE_SPDIF_POWER
@@ -119,5 +116,3 @@ void power_off(void)
asm("halt");
while(1);
}
-
-#endif /* SIMULATOR */