1
0
Fork 0
forked from len0rd/rockbox

Disk poweroff for 3rd gen iPods.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14171 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-08-03 22:54:33 +00:00
parent 5490f6c78a
commit 7f85b5b907
2 changed files with 8 additions and 4 deletions

View file

@ -73,6 +73,9 @@
/* Define this if you have a PortalPlayer PP5002 */ /* Define this if you have a PortalPlayer PP5002 */
#define CONFIG_CPU 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 this if you want to use the PP5002 i2c interface */
#define CONFIG_I2C I2C_PP5002 #define CONFIG_I2C I2C_PP5002

View file

@ -30,11 +30,12 @@
void power_init(void) void power_init(void)
{ {
#ifdef IPOD_1G2G /* probably also 3rd gen */ #if defined(IPOD_1G2G) || defined(IPOD_3G)
GPIOC_ENABLE |= 0x40; /* GPIO C6 is HDD power (low active) */ GPIOC_ENABLE |= 0x40; /* GPIO C6 is HDD power (low active) */
GPIOC_OUTPUT_VAL &= ~0x40; /* on by default */ GPIOC_OUTPUT_VAL &= ~0x40; /* on by default */
GPIOC_OUTPUT_EN |= 0x40; /* enable output */ GPIOC_OUTPUT_EN |= 0x40; /* enable output */
#else #endif
#ifndef IPOD_1G2G
pcf50605_init(); pcf50605_init();
#endif #endif
} }
@ -57,7 +58,7 @@ bool charging_state(void) {
void ide_power_enable(bool on) void ide_power_enable(bool on)
{ {
#ifdef IPOD_1G2G /* probably also 3rd gen */ #if defined(IPOD_1G2G) || defined(IPOD_3G)
if (on) if (on)
GPIOC_OUTPUT_VAL &= ~0x40; GPIOC_OUTPUT_VAL &= ~0x40;
else else
@ -70,7 +71,7 @@ void ide_power_enable(bool on)
bool ide_powered(void) bool ide_powered(void)
{ {
#ifdef IPOD_1G2G /* probably also 3rd gen */ #if defined(IPOD_1G2G) || defined(IPOD_3G)
return !(GPIOC_OUTPUT_VAL & 0x40); return !(GPIOC_OUTPUT_VAL & 0x40);
#else #else
/* pretend we are always powered - we don't turn it off on the ipod */ /* pretend we are always powered - we don't turn it off on the ipod */