Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/vax/vsa White space -> TAB, fix indent, and add RCS...
details: https://anonhg.NetBSD.org/src/rev/d46bda80e55c
branches: trunk
changeset: 450265:d46bda80e55c
user: isaki <isaki%NetBSD.org@localhost>
date: Mon Apr 08 14:48:33 2019 +0000
description:
White space -> TAB, fix indent, and add RCS Id.
No functional changes intended.
diffstat:
sys/arch/vax/vsa/vsaudio.c | 442 ++++++++++++++++++++++----------------------
1 files changed, 222 insertions(+), 220 deletions(-)
diffs (truncated from 670 to 300 lines):
diff -r 75359bd3b303 -r d46bda80e55c sys/arch/vax/vsa/vsaudio.c
--- a/sys/arch/vax/vsa/vsaudio.c Mon Apr 08 14:08:16 2019 +0000
+++ b/sys/arch/vax/vsa/vsaudio.c Mon Apr 08 14:48:33 2019 +0000
@@ -1,3 +1,4 @@
+/* $NetBSD: vsaudio.c,v 1.4 2019/04/08 14:48:33 isaki Exp $ */
/* $OpenBSD: vsaudio.c,v 1.4 2013/05/15 21:21:11 ratchov Exp $ */
/*
@@ -83,56 +84,56 @@
#include <dev/ic/am7930var.h>
#ifdef AUDIO_DEBUG
-#define DPRINTF(x) if (am7930debug) printf x
-#define DPRINTFN(n,x) if (am7930debug>(n)) printf x
+#define DPRINTF(x) if (am7930debug) printf x
+#define DPRINTFN(n,x) if (am7930debug>(n)) printf x
#else
#define DPRINTF(x)
#define DPRINTFN(n,x)
#endif /* AUDIO_DEBUG */
/* physical addresses of the AM79C30 chip */
-#define VSAUDIO_CSR 0x200d0000
-#define VSAUDIO_CSR_KA49 0x26800000
+#define VSAUDIO_CSR 0x200d0000
+#define VSAUDIO_CSR_KA49 0x26800000
/* pdma state */
struct auio {
- bus_space_tag_t au_bt; /* bus tag */
- bus_space_handle_t au_bh; /* handle to chip registers */
+ bus_space_tag_t au_bt; /* bus tag */
+ bus_space_handle_t au_bh; /* handle to chip registers */
- uint8_t *au_rdata; /* record data */
- uint8_t *au_rend; /* end of record data */
- uint8_t *au_pdata; /* play data */
- uint8_t *au_pend; /* end of play data */
- struct evcnt au_intrcnt; /* statistics */
+ uint8_t *au_rdata; /* record data */
+ uint8_t *au_rend; /* end of record data */
+ uint8_t *au_pdata; /* play data */
+ uint8_t *au_pend; /* end of play data */
+ struct evcnt au_intrcnt; /* statistics */
};
struct am7930_intrhand {
- int (*ih_fun)(void *);
- void *ih_arg;
+ int (*ih_fun)(void *);
+ void *ih_arg;
};
struct vsaudio_softc {
- struct am7930_softc sc_am7930; /* glue to MI code */
- bus_space_tag_t sc_bt; /* bus cookie */
- bus_space_handle_t sc_bh; /* device registers */
+ struct am7930_softc sc_am7930; /* glue to MI code */
+ bus_space_tag_t sc_bt; /* bus cookie */
+ bus_space_handle_t sc_bh; /* device registers */
- struct am7930_intrhand sc_ih; /* interrupt vector (hw or sw) */
- void (*sc_rintr)(void*); /* input completion intr handler */
- void *sc_rarg; /* arg for sc_rintr() */
- void (*sc_pintr)(void*); /* output completion intr handler */
- void *sc_parg; /* arg for sc_pintr() */
+ struct am7930_intrhand sc_ih; /* interrupt vector (hw or sw) */
+ void (*sc_rintr)(void*); /* input completion intr handler */
+ void *sc_rarg; /* arg for sc_rintr() */
+ void (*sc_pintr)(void*); /* output completion intr handler */
+ void *sc_parg; /* arg for sc_pintr() */
- uint8_t *sc_rdata; /* record data */
- uint8_t *sc_rend; /* end of record data */
- uint8_t *sc_pdata; /* play data */
- uint8_t *sc_pend; /* end of play data */
+ uint8_t *sc_rdata; /* record data */
+ uint8_t *sc_rend; /* end of record data */
+ uint8_t *sc_pdata; /* play data */
+ uint8_t *sc_pend; /* end of play data */
- struct auio sc_au; /* recv and xmit buffers, etc */
-#define sc_intrcnt sc_au.au_intrcnt /* statistics */
- void *sc_sicookie; /* softintr(9) cookie */
- int sc_cvec;
- kmutex_t sc_lock;
+ struct auio sc_au; /* recv and xmit buffers, etc */
+#define sc_intrcnt sc_au.au_intrcnt /* statistics */
+ void *sc_sicookie; /* softintr(9) cookie */
+ int sc_cvec;
+ kmutex_t sc_lock;
};
static int vsaudio_match(struct device *parent, struct cfdata *match, void *);
@@ -144,14 +145,14 @@
/*
* Hardware access routines for the MI code
*/
-uint8_t vsaudio_codec_iread(struct am7930_softc *, int);
-uint16_t vsaudio_codec_iread16(struct am7930_softc *, int);
-uint8_t vsaudio_codec_dread(struct vsaudio_softc *, int);
-void vsaudio_codec_iwrite(struct am7930_softc *, int, uint8_t);
-void vsaudio_codec_iwrite16(struct am7930_softc *, int, uint16_t);
-void vsaudio_codec_dwrite(struct vsaudio_softc *, int, uint8_t);
-void vsaudio_onopen(struct am7930_softc *);
-void vsaudio_onclose(struct am7930_softc *);
+uint8_t vsaudio_codec_iread(struct am7930_softc *, int);
+uint16_t vsaudio_codec_iread16(struct am7930_softc *, int);
+uint8_t vsaudio_codec_dread(struct vsaudio_softc *, int);
+void vsaudio_codec_iwrite(struct am7930_softc *, int, uint8_t);
+void vsaudio_codec_iwrite16(struct am7930_softc *, int, uint16_t);
+void vsaudio_codec_dwrite(struct vsaudio_softc *, int, uint8_t);
+void vsaudio_onopen(struct am7930_softc *);
+void vsaudio_onclose(struct am7930_softc *);
/*
static stream_filter_factory_t vsaudio_output_conv;
@@ -163,15 +164,15 @@
*/
struct am7930_glue vsaudio_glue = {
- vsaudio_codec_iread,
- vsaudio_codec_iwrite,
- vsaudio_codec_iread16,
- vsaudio_codec_iwrite16,
- vsaudio_onopen,
- vsaudio_onclose,
- 0,
- /*vsaudio_input_conv*/0,
- /*vsaudio_output_conv*/0,
+ vsaudio_codec_iread,
+ vsaudio_codec_iwrite,
+ vsaudio_codec_iread16,
+ vsaudio_codec_iwrite16,
+ vsaudio_onopen,
+ vsaudio_onclose,
+ 0,
+ /*vsaudio_input_conv*/0,
+ /*vsaudio_output_conv*/0,
};
/*
@@ -180,7 +181,7 @@
int vsaudio_start_output(void *, void *, int, void (*)(void *), void *);
int vsaudio_start_input(void *, void *, int, void (*)(void *), void *);
int vsaudio_getdev(void *, struct audio_device *);
-void vsaudio_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread);
+void vsaudio_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread);
struct audio_hw_if vsaudio_hw_if = {
.open = am7930_open,
@@ -203,13 +204,13 @@
struct audio_device vsaudio_device = {
- "am7930",
- "x",
- "vsaudio"
+ "am7930",
+ "x",
+ "vsaudio"
};
-void vsaudio_hwintr(void *);
-void vsaudio_swintr(void *);
+void vsaudio_hwintr(void *);
+void vsaudio_swintr(void *);
struct auio *auiop;
@@ -223,43 +224,43 @@
switch (vax_boardtype) {
#if defined(VAX_BTYP_46) || defined(VAX_BTYP_48)
- case VAX_BTYP_46:
- case VAX_BTYP_48:
- if (va->va_paddr != VSAUDIO_CSR)
- return 0;
- break;
+ case VAX_BTYP_46:
+ case VAX_BTYP_48:
+ if (va->va_paddr != VSAUDIO_CSR)
+ return 0;
+ break;
#endif
#if defined(VAX_BTYP_49)
- case VAX_BTYP_49:
- if (va->va_paddr != VSAUDIO_CSR_KA49)
- return 0;
- break;
+ case VAX_BTYP_49:
+ if (va->va_paddr != VSAUDIO_CSR_KA49)
+ return 0;
+ break;
#endif
- default:
- return 0;
+ default:
+ return 0;
}
regs = (volatile uint32_t *)va->va_addr;
- regs[AM7930_DREG_CR] = AM7930_IREG_INIT;
- regs[AM7930_DREG_DR] = AM7930_INIT_PMS_ACTIVE | AM7930_INIT_INT_ENABLE;
+ regs[AM7930_DREG_CR] = AM7930_IREG_INIT;
+ regs[AM7930_DREG_DR] = AM7930_INIT_PMS_ACTIVE | AM7930_INIT_INT_ENABLE;
- regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR1;
- regs[AM7930_DREG_DR] = 0;
+ regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR1;
+ regs[AM7930_DREG_DR] = 0;
- regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR2;
- regs[AM7930_DREG_DR] = 0;
+ regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR2;
+ regs[AM7930_DREG_DR] = 0;
- regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR3;
- regs[AM7930_DREG_DR] = (AM7930_MCRCHAN_BB << 4) | AM7930_MCRCHAN_BA;
+ regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR3;
+ regs[AM7930_DREG_DR] = (AM7930_MCRCHAN_BB << 4) | AM7930_MCRCHAN_BA;
- regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR4;
- regs[AM7930_DREG_DR] = AM7930_MCR4_INT_ENABLE;
+ regs[AM7930_DREG_CR] = AM7930_IREG_MUX_MCR4;
+ regs[AM7930_DREG_DR] = AM7930_MCR4_INT_ENABLE;
- for (i = 10; i < 20; i++)
- regs[AM7930_DREG_BBTB] = i;
- delay(1000000); /* XXX too large */
+ for (i = 10; i < 20; i++)
+ regs[AM7930_DREG_BBTB] = i;
+ delay(1000000); /* XXX too large */
- return 1;
+ return 1;
}
@@ -270,59 +271,60 @@
struct vsaudio_softc *sc = device_private(self);
if (bus_space_map(va->va_memt, va->va_paddr, AM7930_DREG_SIZE << 2, 0,
- &sc->sc_bh) != 0) {
+ &sc->sc_bh) != 0) {
printf(": can't map registers\n");
- return;
- }
- sc->sc_bt = va->va_memt;
- sc->sc_am7930.sc_dev = device_private(self);
- sc->sc_am7930.sc_glue = &vsaudio_glue;
- mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH);
- am7930_init(&sc->sc_am7930, AUDIOAMD_POLL_MODE);
- auiop = &sc->sc_au;
- /* Copy bus tag & handle for use by am7930_trap */
+ return;
+ }
+ sc->sc_bt = va->va_memt;
+ sc->sc_am7930.sc_dev = device_private(self);
+ sc->sc_am7930.sc_glue = &vsaudio_glue;
+ mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH);
+ am7930_init(&sc->sc_am7930, AUDIOAMD_POLL_MODE);
+ auiop = &sc->sc_au;
+ /* Copy bus tag & handle for use by am7930_trap */
sc->sc_au.au_bt = sc->sc_bt;
sc->sc_au.au_bh = sc->sc_bh;
- scb_vecalloc(va->va_cvec, vsaudio_hwintr, sc, SCB_ISTACK,
- &sc->sc_intrcnt);
- sc->sc_cvec = va->va_cvec;
+ scb_vecalloc(va->va_cvec, vsaudio_hwintr, sc, SCB_ISTACK,
+ &sc->sc_intrcnt);
+ sc->sc_cvec = va->va_cvec;
evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
- device_xname(self), "intr");
+ device_xname(self), "intr");
- sc->sc_sicookie = softint_establish(SOFTINT_SERIAL, &vsaudio_swintr, sc);
- if (sc->sc_sicookie == NULL) {
- aprint_normal("\n%s: cannot establish software interrupt\n",
- device_xname(self));
- return;
+ sc->sc_sicookie = softint_establish(SOFTINT_SERIAL,
+ &vsaudio_swintr, sc);
+ if (sc->sc_sicookie == NULL) {
+ aprint_normal("\n%s: cannot establish software interrupt\n",
+ device_xname(self));
+ return;
}
- aprint_normal("\n");
- audio_attach_mi(&vsaudio_hw_if, sc, self);
+ aprint_normal("\n");
+ audio_attach_mi(&vsaudio_hw_if, sc, self);
}
void
vsaudio_onopen(struct am7930_softc *sc)
{
Home |
Main Index |
Thread Index |
Old Index