From owner-p4-projects@FreeBSD.ORG Fri Jul 13 03:07:06 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E8C6216A404; Fri, 13 Jul 2007 03:07:05 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A0D116A400 for ; Fri, 13 Jul 2007 03:07:05 +0000 (UTC) (envelope-from loafier@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 89F9413C441 for ; Fri, 13 Jul 2007 03:07:05 +0000 (UTC) (envelope-from loafier@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l6D375lp004708 for ; Fri, 13 Jul 2007 03:07:05 GMT (envelope-from loafier@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l6D374x4004705 for perforce@freebsd.org; Fri, 13 Jul 2007 03:07:04 GMT (envelope-from loafier@FreeBSD.org) Date: Fri, 13 Jul 2007 03:07:04 GMT Message-Id: <200707130307.l6D374x4004705@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to loafier@FreeBSD.org using -f From: Christopher Davis To: Perforce Change Reviews Cc: Subject: PERFORCE change 123415 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2007 03:07:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=123415 Change 123415 by loafier@chrisdsoc on 2007/07/13 03:06:03 Integegrate sound driver.. Affected files ... .. //depot/projects/soc2007/loafier_busalloc/dev/sound/pci/atiixp.c#2 integrate Differences ... ==== //depot/projects/soc2007/loafier_busalloc/dev/sound/pci/atiixp.c#2 (text+ko) ==== @@ -63,7 +63,7 @@ #include -SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/atiixp.c,v 1.18 2007/06/14 11:13:37 ariff Exp $"); +SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pci/atiixp.c,v 1.19 2007/07/09 20:41:23 ariff Exp $"); #define ATI_IXP_DMA_RETRY_MAX 100 @@ -74,6 +74,9 @@ #define ATI_IXP_BLK_MIN 32 #define ATI_IXP_BLK_ALIGN (~(ATI_IXP_BLK_MIN - 1)) +#define ATI_IXP_CHN_RUNNING 0x00000001 +#define ATI_IXP_CHN_SUSPEND 0x00000002 + struct atiixp_dma_op { volatile uint32_t addr; volatile uint16_t status; @@ -93,7 +96,8 @@ uint32_t blksz, blkcnt; uint32_t ptr, prevptr; uint32_t fmt; - int caps_32bit, dir, active; + uint32_t flags; + int caps_32bit, dir; }; struct atiixp_info { @@ -654,7 +658,7 @@ uint32_t sz, delta; volatile uint32_t ptr; - if (ch->active == 0) + if (!(ch->flags & ATI_IXP_CHN_RUNNING)) return (0); sz = ch->blksz * ch->blkcnt; @@ -672,7 +676,8 @@ return (1); } -#define atiixp_chan_active(sc) ((sc)->pch.active + (sc)->rch.active) +#define atiixp_chan_active(sc) (((sc)->pch.flags | (sc)->rch.flags) & \ + ATI_IXP_CHN_RUNNING) static void atiixp_poll_callback(void *arg) @@ -754,19 +759,19 @@ atiixp_poll_callback, sc); } } - ch->active = 1; + ch->flags |= ATI_IXP_CHN_RUNNING; break; case PCMTRIG_STOP: case PCMTRIG_ABORT: atiixp_disable_dma(ch); atiixp_flush_dma(ch); - ch->active = 0; + ch->flags &= ~ATI_IXP_CHN_RUNNING; if (sc->polling != 0) { if (atiixp_chan_active(sc) == 0) { callout_stop(&sc->poll_timer); sc->poll_ticks = 1; } else { - if (sc->pch.active != 0) + if (sc->pch.flags & ATI_IXP_CHN_RUNNING) ch = &sc->pch; else ch = &sc->rch; @@ -874,9 +879,11 @@ return; } - if ((status & ATI_REG_ISR_OUT_STATUS) && sc->pch.active != 0) + if ((status & ATI_REG_ISR_OUT_STATUS) && + (sc->pch.flags & ATI_IXP_CHN_RUNNING)) trigger |= 1; - if ((status & ATI_REG_ISR_IN_STATUS) && sc->rch.active != 0) + if ((status & ATI_REG_ISR_IN_STATUS) && + (sc->rch.flags & ATI_IXP_CHN_RUNNING)) trigger |= 2; #if 0 @@ -1332,10 +1339,14 @@ atiixp_unlock(sc); /* stop everything */ - if (sc->pch.active != 0) + if (sc->pch.flags & ATI_IXP_CHN_RUNNING) { atiixp_chan_trigger(NULL, &sc->pch, PCMTRIG_STOP); - if (sc->rch.active != 0) + sc->pch.flags |= ATI_IXP_CHN_SUSPEND; + } + if (sc->rch.flags & ATI_IXP_CHN_RUNNING) { atiixp_chan_trigger(NULL, &sc->rch, PCMTRIG_STOP); + sc->rch.flags |= ATI_IXP_CHN_SUSPEND; + } /* power down aclink and pci bus */ atiixp_lock(sc); @@ -1374,14 +1385,18 @@ if (sc->pch.channel != NULL) { if (sc->pch.fmt != 0) atiixp_chan_setformat(NULL, &sc->pch, sc->pch.fmt); - if (sc->pch.active != 0) + if (sc->pch.flags & ATI_IXP_CHN_SUSPEND) { + sc->pch.flags &= ~ATI_IXP_CHN_SUSPEND; atiixp_chan_trigger(NULL, &sc->pch, PCMTRIG_START); + } } if (sc->rch.channel != NULL) { if (sc->rch.fmt != 0) atiixp_chan_setformat(NULL, &sc->rch, sc->rch.fmt); - if (sc->rch.active != 0) + if (sc->rch.flags & ATI_IXP_CHN_SUSPEND) { + sc->rch.flags &= ~ATI_IXP_CHN_SUSPEND; atiixp_chan_trigger(NULL, &sc->rch, PCMTRIG_START); + } } /* enable interrupts */