summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Gjenero <dreamlayers@rockbox.org>2009-04-19 22:06:17 +0000
committerBoris Gjenero <dreamlayers@rockbox.org>2009-04-19 22:06:17 +0000
commit88b509b7d258c820f2eeda513524acbf76dcaaf5 (patch)
tree0097638dc41a0a25782370603f01c62407e7d913
parent01ada299a3219165d4dc49fc102c47f40a6a2fb0 (diff)
downloadrockbox-88b509b7d258c820f2eeda513524acbf76dcaaf5.tar.gz
rockbox-88b509b7d258c820f2eeda513524acbf76dcaaf5.zip
Fix FS#9926 - On Photo and Color iPods, correct check for whether battery is charging
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20752 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/ipod/power-ipod.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/target/arm/ipod/power-ipod.c b/firmware/target/arm/ipod/power-ipod.c
index 2de10c7f0b..1ae2d37b76 100644
--- a/firmware/target/arm/ipod/power-ipod.c
+++ b/firmware/target/arm/ipod/power-ipod.c
@@ -77,7 +77,16 @@ unsigned int power_input_status(void)
77 77
78/* Returns true if the unit is charging the batteries. */ 78/* Returns true if the unit is charging the batteries. */
79bool charging_state(void) { 79bool charging_state(void) {
80#if defined(IPOD_COLOR)
81 /* 0x70000088 appears to be the input value for GPO32 bits.
82 Write a zero to 0x70000088 before reading.
83 To enable input set the corresponding 0x7000008C bit,
84 and clear the corresponding GPO32_ENABLE bit. */
85 outl(0, 0x70000088);
86 return (inl(0x70000088) & 1)?false:true;
87#else
80 return (GPIOB_INPUT_VAL & 0x01)?false:true; 88 return (GPIOB_INPUT_VAL & 0x01)?false:true;
89#endif
81} 90}
82#endif /* CONFIG_CHARGING */ 91#endif /* CONFIG_CHARGING */
83 92