diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-12-16 22:29:01 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-12-16 22:29:01 +0000 |
commit | 127c363e87e9dd95fd5ab598660967b99ec1a400 (patch) | |
tree | ffc73da22870aa9c079bc96945b2b6e64a82dd91 /firmware | |
parent | 78acda25b37747f9a883ccf1ad14f7710f9a3374 (diff) |
Unconditionally drive HD power control pin for player (doesn't hurt even for very old players). Slight optimization for recorders.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5487 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/power.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index d4e8b3315b..3522ad4232 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c @@ -119,30 +119,22 @@ void ide_power_enable(bool on) if(on) { #ifdef ATA_POWER_PLAYERSTYLE - if (is_new_player()) - { - or_b(0x10, &PBDRL); - touched = true; - } + or_b(0x10, &PBDRL); #else or_b(0x20, &PADRL); - touched = true; #endif + touched = true; } #endif #ifdef HAVE_ATA_POWER_OFF if(!on) { #ifdef ATA_POWER_PLAYERSTYLE - if (is_new_player()) - { - and_b(~0x10, &PBDRL); - touched = true; - } + and_b(~0x10, &PBDRL); #else and_b(~0x20, &PADRL); - touched = true; #endif + touched = true; } #endif @@ -166,20 +158,18 @@ bool ide_powered(void) { #if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF) #ifdef ATA_POWER_PLAYERSTYLE - if (is_new_player()) - { - if ((PBCR2 & 0x0300) || !(PBIOR & 0x0010)) /* not configured for output */ - return false; /* would be floating low, disk off */ - else - return (PBDR & 0x0010) != 0; - } + /* This is not correct for very old players, since these are unable to + * control hd power. However, driving the pin doesn't hurt, because it + * is not connected anywhere */ + if ((PBCR2 & 0x0300) || !(PBIORL & 0x10)) /* not configured for output */ + return false; /* would be floating low, disk off */ else - return true; /* old player: always on */ + return (PBDRL & 0x10) != 0; #else - if ((PACR2 & 0x0400) || !(PAIOR & 0x0020)) /* not configured for output */ + if ((PACR2 & 0x0400) || !(PAIORL & 0x20)) /* not configured for output */ return true; /* would be floating high, disk on */ else - return (PADR & 0x0020) != 0; + return (PADRL & 0x20) != 0; #endif /* ATA_POWER_PLAYERSTYLE */ #else return true; /* pretend always powered if not controlable */ |