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 | |
| parent | 73970f4997de03d0680106548014052d3c67741b (diff) | |
| download | rockbox-ccf51927b9d13b53f41a3edc566da2fcba184a64.zip rockbox-ccf51927b9d13b53f41a3edc566da2fcba184a64.tar.gz rockbox-ccf51927b9d13b53f41a3edc566da2fcba184a64.tar.bz2 rockbox-ccf51927b9d13b53f41a3edc566da2fcba184a64.tar.xz | |
Disk poweroff for 1st/2nd gen iPods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14157 a1c6a512-1295-4272-9138-f99709370657
| -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 37ebb32..4ee434f 100644 --- a/firmware/export/config-ipod1g2g.h +++ b/firmware/export/config-ipod1g2g.h @@ -73,6 +73,9 @@ /* Define this if you have a PortalPlayer PP5002 */ #define CONFIG_CPU PP5002 +/* We're able to shut off power to the HDD */ +#define HAVE_ATA_POWER_OFF + /* Define this if you want to use the PP5002 i2c interface */ #define CONFIG_I2C I2C_PP5002 diff --git a/firmware/target/arm/ipod/power-ipod.c b/firmware/target/arm/ipod/power-ipod.c index 1a84cbe..1b5ea60 100644 --- a/firmware/target/arm/ipod/power-ipod.c +++ b/firmware/target/arm/ipod/power-ipod.c @@ -30,7 +30,11 @@ void power_init(void) { -#ifndef IPOD_1G2G +#ifdef IPOD_1G2G /* probably also 3rd gen */ + GPIOC_ENABLE |= 0x40; /* GPIO C6 is HDD power (low active) */ + GPIOC_OUTPUT_VAL &= ~0x40; /* on by default */ + GPIOC_OUTPUT_EN |= 0x40; /* enable output */ +#else pcf50605_init(); #endif } @@ -53,14 +57,25 @@ bool charging_state(void) { void ide_power_enable(bool on) { - /* We do nothing on the iPod */ +#ifdef IPOD_1G2G /* probably also 3rd gen */ + if (on) + GPIOC_OUTPUT_VAL &= ~0x40; + else + GPIOC_OUTPUT_VAL |= 0x40; +#else + /* We do nothing on other iPods yet */ (void)on; +#endif } bool ide_powered(void) { +#ifdef IPOD_1G2G /* probably also 3rd gen */ + return !(GPIOC_OUTPUT_VAL & 0x40); +#else /* pretend we are always powered - we don't turn it off on the ipod */ return true; +#endif } void power_off(void) |