summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-05-08 21:36:50 +0000
committerJens Arnold <amiconn@rockbox.org>2008-05-08 21:36:50 +0000
commit8291cd76de8ee3797ca01ebeffee176d0177b353 (patch)
tree5c085c37256aee91c1db67716f14344200e80e16
parent21a373388833b8f4f7284cff16d48cab7857de2f (diff)
downloadrockbox-8291cd76de8ee3797ca01ebeffee176d0177b353.zip
rockbox-8291cd76de8ee3797ca01ebeffee176d0177b353.tar.gz
rockbox-8291cd76de8ee3797ca01ebeffee176d0177b353.tar.bz2
rockbox-8291cd76de8ee3797ca01ebeffee176d0177b353.tar.xz
Fix the short audio dropout at disk spinup from power-off on portalplayer targets (observed on Mini G2, probably affected others as well).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17426 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/ata.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 397cb9a..2dca175 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1022,7 +1022,15 @@ static int ata_power_on(void)
int rc;
ide_power_enable(true);
- sleep(HZ/50); /* allow voltage to build up */
+ sleep(HZ/4); /* allow voltage to build up */
+
+ /* Accessing the PP IDE controller too early after powering up the disk
+ * makes the core hang for a short time, causing an audio dropout. This
+ * also depends on the disk; iPod Mini G2 needs at least HZ/5 to get rid
+ * of the dropout. Since this time isn't additive (the wait_for_bsy() in
+ * ata_hard_reset() will shortened by the same amount), it's a good idea
+ * to do this on all HDD based targets. */
+
if( ata_hard_reset() )
return -1;
@@ -1235,7 +1243,7 @@ int ata_init(void)
if (!ide_powered()) /* somebody has switched it off */
{
ide_power_enable(true);
- sleep(HZ/50); /* allow voltage to build up */
+ sleep(HZ/4); /* allow voltage to build up */
}
/* first try, hard reset at cold start only */