Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/isa Pull up revision 1.17 (requested by thorpej):



details:   https://anonhg.NetBSD.org/src/rev/da6767e169c5
branches:  netbsd-1-5
changeset: 490437:da6767e169c5
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Tue Dec 26 15:47:15 2000 +0000

description:
Pull up revision 1.17 (requested by thorpej):
  Support full-duplex audio on 1848 wss devices by using
  seperate interrupt handlers for play and record. Fix from
  Juergen Weiss <weiss%uni-mainz.de@localhost> by way of PR#11178.

diffstat:

 sys/dev/isa/ad1848_isa.c |  43 ++++++++++++++++++++++++++++++-------------
 1 files changed, 30 insertions(+), 13 deletions(-)

diffs (80 lines):

diff -r 988c3a993269 -r da6767e169c5 sys/dev/isa/ad1848_isa.c
--- a/sys/dev/isa/ad1848_isa.c  Tue Dec 26 08:19:19 2000 +0000
+++ b/sys/dev/isa/ad1848_isa.c  Tue Dec 26 15:47:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ad1848_isa.c,v 1.14.4.1 2000/06/30 16:27:47 simonb Exp $       */
+/*     $NetBSD: ad1848_isa.c,v 1.14.4.2 2000/12/26 15:47:15 jhawk Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -522,7 +522,7 @@
        ad1848_isa_halt_output(isc);
        ad1848_isa_halt_input(isc);
 
-       isc->sc_intr = 0;
+       isc->sc_pintr = isc->sc_rintr = NULL;
 
        if (isc->sc_playdrq != -1)
                isa_dmamap_destroy(isc->sc_ic, isc->sc_playdrq);
@@ -557,8 +557,13 @@
            DMAMODE_READ | DMAMODE_LOOPDEMAND, BUS_DMA_NOWAIT);
 
        isc->sc_recrun = 1;
-       isc->sc_intr = intr;
-       isc->sc_arg = arg;
+       if (sc->mode == 2 && isc->sc_playdrq != isc->sc_recdrq) {
+               isc->sc_rintr = intr;
+               isc->sc_rarg = arg;
+       } else {
+               isc->sc_pintr = intr;
+               isc->sc_parg = arg;
+       }
 
        blksize = (blksize * 8) / (param->precision * param->factor * param->channels) - 1;
 
@@ -594,8 +599,8 @@
            DMAMODE_WRITE | DMAMODE_LOOPDEMAND, BUS_DMA_NOWAIT);
 
        isc->sc_playrun = 1;
-       isc->sc_intr = intr;
-       isc->sc_arg = arg;
+       isc->sc_pintr = intr;
+       isc->sc_parg = arg;
 
        blksize = (blksize * 8) / (param->precision * param->factor * param->channels) - 1;
 
@@ -665,15 +670,27 @@
        isc->sc_interrupts++;
 
        /* Handle interrupt */
-       if (isc->sc_intr && (status & INTERRUPT_STATUS)) {
-               (*isc->sc_intr)(isc->sc_arg);
-               retval = 1;
-       }
+       if ((status & INTERRUPT_STATUS) != 0) {
+               if (sc->mode == 2 && isc->sc_playdrq != isc->sc_recdrq) {
+                       status = ad_read(sc, CS_IRQ_STATUS);
+                       if ((status & CS_IRQ_PI) && isc->sc_pintr != NULL) {
+                               (*isc->sc_pintr)(isc->sc_parg);
+                               retval = 1;
+                       }
+                       if ((status & CS_IRQ_CI) && isc->sc_rintr != NULL) {
+                               (*isc->sc_rintr)(isc->sc_rarg);
+                               retval = 1;
+                       }
+               } else {
+                       if (isc->sc_pintr != NULL) {
+                               (*isc->sc_pintr)(isc->sc_parg);
+                               retval = 1;
+                       }
+               }
 
-       /* clear interrupt */
-       if (status & INTERRUPT_STATUS)
+               /* Clear interrupt */
                ADWRITE(sc, AD1848_STATUS, 0);
-
+       }
        return(retval);
 }
 



Home | Main Index | Thread Index | Old Index