diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-08-03 12:05:47 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-08-03 12:05:47 +0000 |
commit | ccf51927b9d13b53f41a3edc566da2fcba184a64 (patch) | |
tree | 066d6079bb4bad312543fbb167a250a2a7d48d5d /firmware/target/arm/ipod/power-ipod.c | |
parent | 73970f4997de03d0680106548014052d3c67741b (diff) | |
download | rockbox-ccf51927b9d13b53f41a3edc566da2fcba184a64.tar.gz rockbox-ccf51927b9d13b53f41a3edc566da2fcba184a64.zip |
Disk poweroff for 1st/2nd gen iPods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14157 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/ipod/power-ipod.c')
-rw-r--r-- | firmware/target/arm/ipod/power-ipod.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/firmware/target/arm/ipod/power-ipod.c b/firmware/target/arm/ipod/power-ipod.c index 1a84cbe022..1b5ea60d87 100644 --- a/firmware/target/arm/ipod/power-ipod.c +++ b/firmware/target/arm/ipod/power-ipod.c | |||
@@ -30,7 +30,11 @@ | |||
30 | 30 | ||
31 | void power_init(void) | 31 | void power_init(void) |
32 | { | 32 | { |
33 | #ifndef IPOD_1G2G | 33 | #ifdef IPOD_1G2G /* probably also 3rd gen */ |
34 | GPIOC_ENABLE |= 0x40; /* GPIO C6 is HDD power (low active) */ | ||
35 | GPIOC_OUTPUT_VAL &= ~0x40; /* on by default */ | ||
36 | GPIOC_OUTPUT_EN |= 0x40; /* enable output */ | ||
37 | #else | ||
34 | pcf50605_init(); | 38 | pcf50605_init(); |
35 | #endif | 39 | #endif |
36 | } | 40 | } |
@@ -53,14 +57,25 @@ bool charging_state(void) { | |||
53 | 57 | ||
54 | void ide_power_enable(bool on) | 58 | void ide_power_enable(bool on) |
55 | { | 59 | { |
56 | /* We do nothing on the iPod */ | 60 | #ifdef IPOD_1G2G /* probably also 3rd gen */ |
61 | if (on) | ||
62 | GPIOC_OUTPUT_VAL &= ~0x40; | ||
63 | else | ||
64 | GPIOC_OUTPUT_VAL |= 0x40; | ||
65 | #else | ||
66 | /* We do nothing on other iPods yet */ | ||
57 | (void)on; | 67 | (void)on; |
68 | #endif | ||
58 | } | 69 | } |
59 | 70 | ||
60 | bool ide_powered(void) | 71 | bool ide_powered(void) |
61 | { | 72 | { |
73 | #ifdef IPOD_1G2G /* probably also 3rd gen */ | ||
74 | return !(GPIOC_OUTPUT_VAL & 0x40); | ||
75 | #else | ||
62 | /* pretend we are always powered - we don't turn it off on the ipod */ | 76 | /* pretend we are always powered - we don't turn it off on the ipod */ |
63 | return true; | 77 | return true; |
78 | #endif | ||
64 | } | 79 | } |
65 | 80 | ||
66 | void power_off(void) | 81 | void power_off(void) |