summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoritohy <itohy@NetBSD.org>2002-03-23 23:40:32 +0000
committeritohy <itohy@NetBSD.org>2002-03-23 23:40:32 +0000
commit78b5427b7eace5df4e69c7cbef3cdbf8cee81726 (patch)
tree04c6d3daaf9600d5361822926e7bb5a50c46aa17 /sys/dev
parenta378ffa3a9cde07c75a9c5c195057e889ef42c0d (diff)
Add wait-for-ready code between setting MCE and changing data format,
which is required by OPL3-SA2 (YMF711) chip. Fixes PR kern/14819.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/ad1848.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ic/ad1848.c b/sys/dev/ic/ad1848.c
index b9ff89e5a23..55b02039f65 100644
--- a/sys/dev/ic/ad1848.c
+++ b/sys/dev/ic/ad1848.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ad1848.c,v 1.13 2002/03/06 07:12:02 itohy Exp $ */
+/* $NetBSD: ad1848.c,v 1.14 2002/03/23 23:40:32 itohy Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.13 2002/03/06 07:12:02 itohy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.14 2002/03/23 23:40:32 itohy Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1140,6 +1140,14 @@ ad1848_commit_settings(addr)
if (sc->channels == 2)
fs |= FMT_STEREO;
+ /*
+ * OPL3-SA2 (YMF711) is sometimes busy here.
+ * Wait until it becomes ready.
+ */
+ for (timeout = 0;
+ timeout < 1000 && ADREAD(sc, AD1848_IADDR) & SP_IN_INIT; timeout++)
+ delay(10);
+
ad_write(sc, SP_CLOCK_DATA_FORMAT, fs);
/*