diff options
-rw-r--r-- | firmware/export/config-ipod1g2g.h | 3 | ||||
-rw-r--r-- | firmware/target/arm/ipod/power-ipod.c | 19 |
2 files changed, 20 insertions, 2 deletions
diff --git a/firmware/export/config-ipod1g2g.h b/firmware/export/config-ipod1g2g.h index 37ebb32f86..4ee434f732 100644 --- a/firmware/export/config-ipod1g2g.h +++ b/firmware/export/config-ipod1g2g.h | |||
@@ -73,6 +73,9 @@ | |||
73 | /* Define this if you have a PortalPlayer PP5002 */ | 73 | /* Define this if you have a PortalPlayer PP5002 */ |
74 | #define CONFIG_CPU PP5002 | 74 | #define CONFIG_CPU PP5002 |
75 | 75 | ||
76 | /* We're able to shut off power to the HDD */ | ||
77 | #define HAVE_ATA_POWER_OFF | ||
78 | |||
76 | /* Define this if you want to use the PP5002 i2c interface */ | 79 | /* Define this if you want to use the PP5002 i2c interface */ |
77 | #define CONFIG_I2C I2C_PP5002 | 80 | #define CONFIG_I2C I2C_PP5002 |
78 | 81 | ||
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) |