fix AUTO_CAL_ENABLE bug, & misc. cleanup.

This commit is contained in:
mikel 1996-12-05 07:01:30 +00:00
parent 94909aee07
commit 179a058e17
1 changed files with 21 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ad1848.c,v 1.13 1996/10/16 01:12:25 jtk Exp $ */ /* $NetBSD: ad1848.c,v 1.14 1996/12/05 07:01:30 mikel Exp $ */
/* /*
* Copyright (c) 1994 John Brezak * Copyright (c) 1994 John Brezak
@ -115,12 +115,12 @@ static int ad1848_init_values[] = {
ATTEN_12, /* Left Aux #2 Input Control */ ATTEN_12, /* Left Aux #2 Input Control */
ATTEN_12, /* Right Aux #2 Input Control */ ATTEN_12, /* Right Aux #2 Input Control */
/* bits 5-0 are attenuation select */ /* bits 5-0 are attenuation select */
0x19, /* Left DAC output Control */ ATTEN_12, /* Left DAC output Control */
0x19, /* Right DAC output Control */ ATTEN_12, /* Right DAC output Control */
/* Clock and Data Format */ /* Clock and Data Format */
CLOCK_XTAL1|FMT_PCM8|AUTO_CAL_ENABLE, CLOCK_XTAL1|FMT_PCM8,
/* Interface Config */ /* Interface Config */
SINGLE_DMA, SINGLE_DMA|AUTO_CAL_ENABLE,
INTERRUPT_ENABLE, /* Pin control */ INTERRUPT_ENABLE, /* Pin control */
0x00, /* Test and Init */ 0x00, /* Test and Init */
0xca, /* Misc control */ 0xca, /* Misc control */
@ -128,7 +128,7 @@ static int ad1848_init_values[] = {
0, /* Upper base Count */ 0, /* Upper base Count */
0, /* Lower base Count */ 0, /* Lower base Count */
/* Thse are for CS4231 only (additional registers): */ /* These are for CS4231 &c. only (additional registers): */
0, /* Alt feature 1 */ 0, /* Alt feature 1 */
0, /* Alt feature 2 */ 0, /* Alt feature 2 */
ATTEN_12, /* Left line in */ ATTEN_12, /* Left line in */
@ -144,8 +144,7 @@ static int ad1848_init_values[] = {
0, /* unused */ 0, /* unused */
0, /* record format */ 0, /* record format */
0, /* upper record count */ 0, /* upper record count */
0, /* lower record count */ 0 /* lower record count */
}; };
void ad1848_reset __P((struct ad1848_softc *)); void ad1848_reset __P((struct ad1848_softc *));
@ -250,18 +249,19 @@ ad1848_dump_regs(sc)
int i; int i;
u_char r; u_char r;
printf("ad1848 status=%x", inb(sc->sc_iobase+AD1848_STATUS)); printf("ad1848 status=%02x", inb(sc->sc_iobase+AD1848_STATUS));
printf(" regs: "); printf(" regs: ");
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
r = ad_read(sc, i); r = ad_read(sc, i);
printf("%x ", r); printf("%02x ", r);
} }
if (sc->mode == 2) if (sc->mode == 2) {
for (i = 16; i < 32; i++) { for (i = 16; i < 32; i++) {
r = ad_read(sc, i); r = ad_read(sc, i);
printf("%x ", r); printf("%02x ", r);
} }
printf("\n"); printf("\n");
}
} }
#endif #endif
@ -303,7 +303,9 @@ ad1848_probe(sc)
int i; int i;
if (!AD1848_BASE_VALID(iobase)) { if (!AD1848_BASE_VALID(iobase)) {
printf("ad1848: configured iobase %x invalid\n", iobase); #ifdef AUDIO_DEBUG
printf("ad1848: configured iobase %04x invalid\n", iobase);
#endif
return 0; return 0;
} }