diff options
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) |