From f9442e77d95c3db9b92763c436a8c43b2893a512 Mon Sep 17 00:00:00 2001 From: amiconn Date: Thu, 16 Dec 2004 22:29:01 +0000 Subject: [PATCH] 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 --- firmware/drivers/power.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index d4e8b3315..3522ad423 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 */ -- 2.11.4.GIT