summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-09-02 06:26:00 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-09-02 06:26:00 +0000
commitc0a53eabca41bfee55255ca0492d6e5dd1c79c36 (patch)
tree880ec9dd1ee6f40dfad079b365e3f87718283098 /firmware/drivers
parent09ae8cbf4efaea602ffae2551e82d9acc3a39dbe (diff)
STANDBY mode works again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2115 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/ata.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 1a8ff37cb7..101c9bd4e8 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -173,7 +173,6 @@ int ata_read_sectors(unsigned long start,
mutex_lock(&ata_mtx);
-#ifndef USE_STANDBY
if ( sleeping ) {
#ifdef USE_POWEROFF
if (ata_power_on()) {
@@ -181,14 +180,15 @@ int ata_read_sectors(unsigned long start,
return -1;
}
#else
+#ifdef USE_SLEEP
if (perform_soft_reset()) {
mutex_unlock(&ata_mtx);
return -1;
}
#endif
+#endif
sleeping = false;
}
-#endif
if (!wait_for_rdy())
{
@@ -263,7 +263,6 @@ int ata_write_sectors(unsigned long start,
mutex_lock(&ata_mtx);
-#ifndef USE_STANDBY
if ( sleeping ) {
#ifdef USE_POWEROFF
if (ata_power_on()) {
@@ -271,14 +270,15 @@ int ata_write_sectors(unsigned long start,
return -1;
}
#else
+#ifdef USE_SLEEP
if (perform_soft_reset()) {
mutex_unlock(&ata_mtx);
return -1;
}
#endif
+#endif
sleeping = false;
}
-#endif
if (!wait_for_rdy())
{
@@ -397,6 +397,7 @@ static int ata_perform_sleep(void)
mutex_lock(&ata_mtx);
if(!wait_for_rdy()) {
+ DEBUGF("ata_perform_sleep() - not RDY\n");
mutex_unlock(&ata_mtx);
return -1;
}
@@ -412,7 +413,10 @@ static int ata_perform_sleep(void)
#endif
if (!wait_for_rdy())
+ {
+ DEBUGF("ata_perform_sleep() - CMD failed\n");
ret = -1;
+ }
#endif
sleeping = true;
mutex_unlock(&ata_mtx);