diff options
author | Nils Wallménius <nils@rockbox.org> | 2007-01-23 15:43:37 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2007-01-23 15:43:37 +0000 |
commit | 1b85f60ae0b0c1e24595e9551ce5eee10f15b182 (patch) | |
tree | a9cd95362fc8e63032647476acf4fa1cbfe1825a /firmware/drivers | |
parent | b2e50906a4af3176d03dff98af4a260709bdad96 (diff) |
Permanently enable powering down the disk when it's sleeping for supported targets (iriver h1xx, h3xx and h10, iaudio x5, gigabeat and archos recorders)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12094 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/ata.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 4dd0fdcc49..349f76c0ec 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -63,6 +63,10 @@ #define READ_TIMEOUT 5*HZ +#ifdef HAVE_ATA_POWER_OFF +#define ATA_POWER_OFF_TIMEOUT 2*HZ +#endif + static struct mutex ata_mtx; int ata_device; /* device 0 (master) or 1 (slave) */ @@ -75,9 +79,6 @@ static bool spinup = false; static bool sleeping = true; static bool poweroff = false; static long sleep_timeout = 5*HZ; -#ifdef HAVE_ATA_POWER_OFF -static int poweroff_timeout = 2*HZ; -#endif #ifdef HAVE_LBA48 static bool lba48 = false; /* set for 48 bit addressing */ #endif @@ -561,16 +562,6 @@ void ata_spindown(int seconds) sleep_timeout = seconds * HZ; } -#ifdef HAVE_ATA_POWER_OFF -void ata_poweroff(bool enable) -{ - if (enable) - poweroff_timeout = 2*HZ; - else - poweroff_timeout = 0; -} -#endif - bool ata_disk_is_active(void) { return !sleeping; @@ -654,8 +645,8 @@ static void ata_thread(void) } } #ifdef HAVE_ATA_POWER_OFF - if ( !spinup && sleeping && poweroff_timeout && !poweroff && - TIME_AFTER( current_tick, last_sleep + poweroff_timeout )) + if ( !spinup && sleeping && !poweroff && + TIME_AFTER( current_tick, last_sleep + ATA_POWER_OFF_TIMEOUT )) { mutex_lock(&ata_mtx); ide_power_enable(false); |