Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Wait for the RIRB DMA engine to come ready. Nee...
details: https://anonhg.NetBSD.org/src/rev/afb1171580a4
branches: trunk
changeset: 333584:afb1171580a4
user: nonaka <nonaka%NetBSD.org@localhost>
date: Sun Nov 09 19:57:53 2014 +0000
description:
Wait for the RIRB DMA engine to come ready. Needed on the audio device
integrated in the Vortex86EX SoC. From OpenBSD.
diffstat:
sys/dev/pci/azalia.c | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diffs (36 lines):
diff -r b2235a9390a3 -r afb1171580a4 sys/dev/pci/azalia.c
--- a/sys/dev/pci/azalia.c Sun Nov 09 19:35:43 2014 +0000
+++ b/sys/dev/pci/azalia.c Sun Nov 09 19:57:53 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: azalia.c,v 1.82 2014/09/21 14:30:22 christos Exp $ */
+/* $NetBSD: azalia.c,v 1.83 2014/11/09 19:57:53 nonaka Exp $ */
/*-
* Copyright (c) 2005, 2008 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.82 2014/09/21 14:30:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.83 2014/11/09 19:57:53 nonaka Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -816,6 +816,17 @@
/* Run! */
rirbctl = AZ_READ_1(az, RIRBCTL);
AZ_WRITE_1(az, RIRBCTL, rirbctl | HDA_RIRBCTL_RIRBDMAEN | HDA_RIRBCTL_RINTCTL);
+ for (i = 5000; i >= 0; i--) {
+ DELAY(10);
+ rirbctl = AZ_READ_1(az, RIRBCTL);
+ if (rirbctl & HDA_RIRBCTL_RIRBDMAEN)
+ break;
+ }
+ if (i <= 0) {
+ aprint_error_dev(az->dev, "RIRB is not running\n");
+ return EBUSY;
+ }
+
return 0;
}
Home |
Main Index |
Thread Index |
Old Index