Clean up a little.

This commit is contained in:
augustss 2001-01-22 01:44:56 +00:00
parent 62fe0f7f69
commit 972d156775
4 changed files with 9 additions and 30 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cs4281.c,v 1.1 2001/01/22 01:34:42 augustss Exp $ */ /* $NetBSD: cs4281.c,v 1.2 2001/01/22 01:44:56 augustss Exp $ */
/* /*
* Copyright (c) 2000 Tatoku Ogaito. All rights reserved. * Copyright (c) 2000 Tatoku Ogaito. All rights reserved.
@ -78,11 +78,6 @@
#define MAX_FIFO_SIZE 64 /* 128/2channels */ #define MAX_FIFO_SIZE 64 /* 128/2channels */
#endif #endif
/* XXX: now this is required only to support NetBSD-1.5.... */
#ifndef PCI_PRODUCT_CIRRUS_CS4281
#define PCI_PRODUCT_CIRRUS_CS4281 (0x6005)
#endif
/* IF functions for audio driver */ /* IF functions for audio driver */
int cs4281_match(struct device *, struct cfdata *, void *); int cs4281_match(struct device *, struct cfdata *, void *);
void cs4281_attach(struct device *, struct device *, void *); void cs4281_attach(struct device *, struct device *, void *);
@ -104,7 +99,7 @@ void cs4281_set_adc_rate(struct cs428x_softc *, int );
int cs4281_init(struct cs428x_softc *); int cs4281_init(struct cs428x_softc *);
/* Power Management */ /* Power Management */
void cs4281_power __P((int, void *)); void cs4281_power(int, void *);
#define NOT_SHARED #define NOT_SHARED
@ -128,7 +123,8 @@ void cs4281_free(void *, void *, int);
paddr_t cs4281_mappage(void *, void *, off_t, int); paddr_t cs4281_mappage(void *, void *, off_t, int);
/* internal functions */ /* internal functions */
int cs4281_allocmem(struct cs428x_softc*, size_t, int, int, struct cs428x_dma *); int cs4281_allocmem(struct cs428x_softc*, size_t, int, int,
struct cs428x_dma *);
int cs4281_src_wait(struct cs428x_softc *); int cs4281_src_wait(struct cs428x_softc *);
#if defined(CS4281_DEBUG) #if defined(CS4281_DEBUG)
@ -170,7 +166,7 @@ struct audio_hw_if cs4281_hw_if = {
cs4281_trigger_input, cs4281_trigger_input,
}; };
#if NMIDI > 0 #if NMIDI > 0 && 0
/* Midi Interface */ /* Midi Interface */
void cs4281_midi_close(void*); void cs4281_midi_close(void*);
void cs4281_midi_getinfo(void *, struct midi_info *); void cs4281_midi_getinfo(void *, struct midi_info *);
@ -198,7 +194,6 @@ struct audio_device cs4281_device = {
}; };
/* trivial */
int int
cs4281_match(parent, match, aux) cs4281_match(parent, match, aux)
struct device *parent; struct device *parent;
@ -214,7 +209,6 @@ cs4281_match(parent, match, aux)
return 0; return 0;
} }
/* It seems to work */
void void
cs4281_attach(parent, self, aux) cs4281_attach(parent, self, aux)
struct device *parent; struct device *parent;
@ -264,12 +258,7 @@ cs4281_attach(parent, self, aux)
#endif #endif
/* Map and establish the interrupt. */ /* Map and establish the interrupt. */
#if 1
if (pci_intr_map(pa, &ih)) { if (pci_intr_map(pa, &ih)) {
#else /* old */
if (pci_intr_map(pc, pa->pa_intrtag, pa->pa_intrpin,
pa->pa_intrline, &ih)) {
#endif
printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname); printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname);
return; return;
} }
@ -311,7 +300,7 @@ cs4281_attach(parent, self, aux)
} }
audio_attach_mi(&cs4281_hw_if, sc, &sc->sc_dev); audio_attach_mi(&cs4281_hw_if, sc, &sc->sc_dev);
#if NMIDI > 0 #if NMIDI > 0 && 0
midi_attach_mi(&cs4281_midi_hw_if, sc, &sc->sc_dev); midi_attach_mi(&cs4281_midi_hw_if, sc, &sc->sc_dev);
#endif #endif
@ -525,7 +514,6 @@ cs4281_set_params(addr, setmode, usemode, play, rec)
return 0; return 0;
} }
/* Confirmed 2000/12/26 */
int int
cs4281_halt_output(addr) cs4281_halt_output(addr)
void *addr; void *addr;
@ -539,7 +527,6 @@ cs4281_halt_output(addr)
return 0; return 0;
} }
/* Confirmed 2000/12/26 */
int int
cs4281_halt_input(addr) cs4281_halt_input(addr)
void *addr; void *addr;
@ -553,7 +540,6 @@ cs4281_halt_input(addr)
return 0; return 0;
} }
/* trivial */
int int
cs4281_getdev(addr, retp) cs4281_getdev(addr, retp)
void *addr; void *addr;
@ -758,7 +744,6 @@ cs4281_trigger_input(addr, start, end, blksize, intr, arg, param)
} }
/* convert sample rate to register value */ /* convert sample rate to register value */
/* Confirmed 2000/12/26 */
u_int8_t u_int8_t
cs4281_sr2regval(rate) cs4281_sr2regval(rate)
int rate; int rate;
@ -797,7 +782,6 @@ cs4281_sr2regval(rate)
} }
/* Confirmed 2000/12/26 */
void void
cs4281_set_dac_rate(sc, rate) cs4281_set_dac_rate(sc, rate)
struct cs428x_softc *sc; struct cs428x_softc *sc;
@ -806,7 +790,6 @@ cs4281_set_dac_rate(sc, rate)
BA0WRITE4(sc, CS4281_DACSR, cs4281_sr2regval(rate)); BA0WRITE4(sc, CS4281_DACSR, cs4281_sr2regval(rate));
} }
/* Confirmed 2000/12/26 */
void void
cs4281_set_adc_rate(sc, rate) cs4281_set_adc_rate(sc, rate)
struct cs428x_softc *sc; struct cs428x_softc *sc;
@ -815,7 +798,6 @@ cs4281_set_adc_rate(sc, rate)
BA0WRITE4(sc, CS4281_ADCSR, cs4281_sr2regval(rate)); BA0WRITE4(sc, CS4281_ADCSR, cs4281_sr2regval(rate));
} }
/* Confirmed 2000/12/26 */
int int
cs4281_init(sc) cs4281_init(sc)
struct cs428x_softc *sc; struct cs428x_softc *sc;

View File

@ -1,5 +1,4 @@
/* $NetBSD: cs4281reg.h,v 1.1 2001/01/22 01:34:42 augustss Exp $ */ /* $NetBSD: cs4281reg.h,v 1.2 2001/01/22 01:44:56 augustss Exp $ */
/* $Tera: cs4281reg.h,v 1.11 2001/01/21 04:13:13 tacha Exp $ */
/* /*
* Copyright (c) 2000 Tatoku Ogaito. All rights reserved. * Copyright (c) 2000 Tatoku Ogaito. All rights reserved.

View File

@ -1,5 +1,4 @@
/* $NetBSD: cs428x.h,v 1.1 2001/01/22 01:34:42 augustss Exp $ */ /* $NetBSD: cs428x.h,v 1.2 2001/01/22 01:44:57 augustss Exp $ */
/* $Tera: cs428x.h,v 1.1 2000/12/22 07:07:58 tacha Exp $ */
/* /*
* Copyright (c) 2000 Tatoku Ogaito. All rights reserved. * Copyright (c) 2000 Tatoku Ogaito. All rights reserved.

View File

@ -1,5 +1,4 @@
/* $NetBSD: cs428xreg.h,v 1.1 2001/01/22 01:34:42 augustss Exp $ */ /* $NetBSD: cs428xreg.h,v 1.2 2001/01/22 01:44:57 augustss Exp $ */
/* $Tera: cs428xreg.h,v 1.1 2000/12/22 07:07:58 tacha Exp $ */
/* /*
* Copyright (c) 2000 Tatoku Ogaito. All rights reserved. * Copyright (c) 2000 Tatoku Ogaito. All rights reserved.