diff options
author | Thom Johansen <thomj@rockbox.org> | 2006-10-25 17:31:29 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2006-10-25 17:31:29 +0000 |
commit | 017b0d7b716e8e1e1fc7ae5adec7a65c38b43e96 (patch) | |
tree | de25e5e1c5d1a164b4121b7d27852ee00183c4a3 /firmware | |
parent | 58ebf47a2b5cedefdf0aaf48f669f6b926d61913 (diff) | |
download | rockbox-017b0d7b716e8e1e1fc7ae5adec7a65c38b43e96.tar.gz rockbox-017b0d7b716e8e1e1fc7ae5adec7a65c38b43e96.zip |
A better workaround due to ATA sleep bugs in the Ipod Nano. battery_bench and plugins like it should now work also on Nano.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11344 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/ata.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index f57088504b..3874745711 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -1412,20 +1412,13 @@ void ata_poweroff(bool enable) bool ata_disk_is_active(void) { -#ifdef IPOD_NANO - return false; -#else return !sleeping; -#endif } static int ata_perform_sleep(void) { int ret = 0; - /* ATA sleep is currently broken on Nano, and will hang all subsequent - accesses, so disable until we find a cure. */ -#ifndef IPOD_NANO mutex_lock(&ata_mtx); SET_REG(ATA_SELECT, ata_device); @@ -1446,7 +1439,6 @@ static int ata_perform_sleep(void) sleeping = true; mutex_unlock(&ata_mtx); -#endif return ret; } @@ -1569,6 +1561,12 @@ int ata_hard_reset(void) static int perform_soft_reset(void) { +/* If this code is allowed to run on a Nano, the next reads from the flash will + * time out, so we disable it. It shouldn't be necessary anyway, since the + * ATA -> Flash interface automatically sleeps almost immediately after the + * last command. + */ +#ifndef IPOD_NANO int ret; int retry_count; @@ -1590,6 +1588,9 @@ static int perform_soft_reset(void) ret = ret?0:-1; return ret; +#else + return 0; /* Always report success */ +#endif } int ata_soft_reset(void) |