diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-11-29 12:17:26 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-11-29 12:17:26 +0000 |
commit | 077ed4925ef6954eb7f4626e153f89dda5df0731 (patch) | |
tree | 7c3f3ee64055ace3ee1d3806a7f62be0f383e510 /firmware/drivers/ata.c | |
parent | 2b545c3104af6c1c8150d55831c8d9eea1478471 (diff) |
Prevent the click of death when connecting an ipod to usb.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11622 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 0de2eb1804..d0cca2e148 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -1215,6 +1215,15 @@ void ata_sleep(void) queue_post(&ata_queue, Q_SLEEP, NULL); } +void ata_sleepnow(void) +{ + if (!spinup && !sleeping && !ata_mtx.locked) + { + call_ata_idle_notifys(false); + ata_perform_sleep(); + } +} + void ata_spin(void) { last_user_activity = current_tick; @@ -1288,7 +1297,6 @@ static void ata_thread(void) call_ata_idle_notifys(false); last_disk_activity = current_tick - sleep_timeout + (HZ/2); break; - } } } |