Subject: Re: TC bba audio problem on DEC3000/300
To: Gregory McGarry <g.mcgarry@ieee.org>
From: Jason R Thorpe <thorpej@zembu.com>
List: port-alpha
Date: 07/13/2000 16:03:57
On Fri, Jul 14, 2000 at 07:38:07AM +1000, Gregory McGarry wrote:
> I tested your patch on pmax and there are no problems.
Okay, how about the following? This more correctly shows what is going on,
per Chris's comments.
--
-- Jason R. Thorpe <thorpej@zembu.com>
Index: bba.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/tc/bba.c,v
retrieving revision 1.8
diff -c -r1.8 bba.c
*** bba.c 2000/06/28 17:05:20 1.8
--- bba.c 2000/07/13 23:05:35
***************
*** 63,69 ****
#define DPRINTF(x)
#endif /* AUDIO_DEBUG */
- #define BBA_REGISTER_SHIFT 6
#define BBA_MAX_DMA_SEGMENTS 16
#define BBA_DMABUF_SIZE (BBA_MAX_DMA_SEGMENTS*PAGE_SIZE)
#define BBA_DMABUF_ALIGN PAGE_SIZE
--- 63,68 ----
***************
*** 786,799 ****
u_int8_t val;
{
struct bba_softc *sc = (struct bba_softc *)asc;
- int i;
DPRINTF(("bba_codec_dwrite(): sc=%p, reg=%d, val=%d\n",sc,reg,val));
bus_space_write_4(sc->sc_bst, sc->sc_codec_bsh,
! (reg<<BBA_REGISTER_SHIFT), val);
!
! for (i=0; i<TIMETOWASTE; i++) {};
}
/* direct read */
--- 785,795 ----
u_int8_t val;
{
struct bba_softc *sc = (struct bba_softc *)asc;
DPRINTF(("bba_codec_dwrite(): sc=%p, reg=%d, val=%d\n",sc,reg,val));
bus_space_write_4(sc->sc_bst, sc->sc_codec_bsh,
! reg * 4, val << 8);
}
/* direct read */
***************
*** 803,817 ****
int reg;
{
struct bba_softc *sc = (struct bba_softc *)asc;
- u_int8_t val;
- int i;
DPRINTF(("bba_codec_dread(): sc=%p, reg=%d\n",sc,reg));
-
- val = bus_space_read_1(sc->sc_bst, sc->sc_codec_bsh,
- (reg<<BBA_REGISTER_SHIFT));
! for (i=0; i<TIMETOWASTE; i++) {};
!
! return val;
}
--- 799,807 ----
int reg;
{
struct bba_softc *sc = (struct bba_softc *)asc;
DPRINTF(("bba_codec_dread(): sc=%p, reg=%d\n",sc,reg));
! return ((bus_space_read_4(sc->sc_bst, sc->sc_codec_bsh,
! reg * 4) >> 8) & 0xff);
}