forked from len0rd/rockbox
STANDBY mode works again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2115 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
09ae8cbf4e
commit
c0a53eabca
1 changed files with 8 additions and 4 deletions
|
@ -173,7 +173,6 @@ int ata_read_sectors(unsigned long start,
|
||||||
|
|
||||||
mutex_lock(&ata_mtx);
|
mutex_lock(&ata_mtx);
|
||||||
|
|
||||||
#ifndef USE_STANDBY
|
|
||||||
if ( sleeping ) {
|
if ( sleeping ) {
|
||||||
#ifdef USE_POWEROFF
|
#ifdef USE_POWEROFF
|
||||||
if (ata_power_on()) {
|
if (ata_power_on()) {
|
||||||
|
@ -181,14 +180,15 @@ int ata_read_sectors(unsigned long start,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#ifdef USE_SLEEP
|
||||||
if (perform_soft_reset()) {
|
if (perform_soft_reset()) {
|
||||||
mutex_unlock(&ata_mtx);
|
mutex_unlock(&ata_mtx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
sleeping = false;
|
sleeping = false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!wait_for_rdy())
|
if (!wait_for_rdy())
|
||||||
{
|
{
|
||||||
|
@ -263,7 +263,6 @@ int ata_write_sectors(unsigned long start,
|
||||||
|
|
||||||
mutex_lock(&ata_mtx);
|
mutex_lock(&ata_mtx);
|
||||||
|
|
||||||
#ifndef USE_STANDBY
|
|
||||||
if ( sleeping ) {
|
if ( sleeping ) {
|
||||||
#ifdef USE_POWEROFF
|
#ifdef USE_POWEROFF
|
||||||
if (ata_power_on()) {
|
if (ata_power_on()) {
|
||||||
|
@ -271,14 +270,15 @@ int ata_write_sectors(unsigned long start,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
#ifdef USE_SLEEP
|
||||||
if (perform_soft_reset()) {
|
if (perform_soft_reset()) {
|
||||||
mutex_unlock(&ata_mtx);
|
mutex_unlock(&ata_mtx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
sleeping = false;
|
sleeping = false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!wait_for_rdy())
|
if (!wait_for_rdy())
|
||||||
{
|
{
|
||||||
|
@ -397,6 +397,7 @@ static int ata_perform_sleep(void)
|
||||||
mutex_lock(&ata_mtx);
|
mutex_lock(&ata_mtx);
|
||||||
|
|
||||||
if(!wait_for_rdy()) {
|
if(!wait_for_rdy()) {
|
||||||
|
DEBUGF("ata_perform_sleep() - not RDY\n");
|
||||||
mutex_unlock(&ata_mtx);
|
mutex_unlock(&ata_mtx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -412,7 +413,10 @@ static int ata_perform_sleep(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!wait_for_rdy())
|
if (!wait_for_rdy())
|
||||||
|
{
|
||||||
|
DEBUGF("ata_perform_sleep() - CMD failed\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
sleeping = true;
|
sleeping = true;
|
||||||
mutex_unlock(&ata_mtx);
|
mutex_unlock(&ata_mtx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue