From nobody Thu Oct 08 12:20:45 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j0px93crqz6vZ5w for ; Thu, 08 Oct 2026 12:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4j0px938Lfz4Lj7 for ; Thu, 08 Oct 2026 12:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791462045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CdZHOa3Spgo9m/N4AQ8nyBzW3hqW1zXzXbsurj2vPNI=; b=gmx3u1dZjhDr5pSjUZaxsmy5CvncQbWHWAUgRixSJHLckD1Wxx93I4VRO/eckpMnc/7utD FjUZm/a22IDTOzTaIfXPXvd8bAGpJr3IpN/p10HDlejKGAgCieePOomamn1wwq47Txf8DI zrVoJR5UH1bkVY6FHyf/G8rMBbuQLs9XubPYHFwhOdkVk+QpFcLJ2k/yPWRU/n75jja2+Z lZLu+hypVhysQ/ESpoVDKTj3dPq5uwZaLgqpZjj+xXNdwM35vW8UYKkChKTEAdE8I1a2+5 11MUzkpYVW1QxqhpY9SRlrELnvAdsBWjXjbcJ7nVY446oQ6ZMuB0tRObUcVOTA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1791462045; b=mtCZ6ebQAXJNjyxqctJwkTTOfuBpAr8W595ZFh8zOlvmOAUU2nTaAlVJQ/x/UUrSJ4UbuN ixKBq3KK2N3Y+ssLfVViOKjI79AK7dmDDIp/OHREomVqPDR5uRN5/qyYTl36sROWfkoejP 6vxranINBLu8eCOrd3cZm/Q8e5KqyduYE85XfbpAUokTdh57RCqkHAhLXHUnXFtaqTTvpz 1MTewUt9L9PcNcOec3NPdNOGYSDMNwaYV4SMVPWrxKami1F/mBBxS5dt+U3g7J/758qfm7 Oug8JFr5Kf/NhUmVXukU2fbWE/4pVJlYk3ti1Bq5H62lNV6jF1wNyZlGr+tvig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1791462045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CdZHOa3Spgo9m/N4AQ8nyBzW3hqW1zXzXbsurj2vPNI=; b=x5B6Ko1aadDRT07WdgYdC/9519+FXHoO8Rg3N4igLP9iCa/ULEqmRuPwng7XvobBE4uhEI WUXQakkdt4E8uC6Qg0LAmO/XXXqwcwt0X80CHBCvgF0Gawtd7N5Yul/OFfK+vVKHtDsLaI Wwe/x+0RbErEYvOhtzQREx7M3FZCtCWOJeKMYb8HawtNTkETOwCT3F6mnAGxvDk+fyFYOn FQlnIskMsQtJq4+liBkOKQTrtw1OEtc8Vgfi2bQfqKdw9ZqHNjZEGIOTWv9i5guwTrURNo MRSvLkctAqUnoPHPkAWWbSWonvuFKeb9UasQLBaCGqQGBbZSBkJkHzwkS91fyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j0px92BK4zfcg for ; Thu, 08 Oct 2026 12:20:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d694 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 08 Oct 2026 12:20:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: dd51cef58311 - main - sound: Whitespace cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd51cef58311ee0024be99116238d1c0032bdf2b Auto-Submitted: auto-generated Date: Thu, 08 Oct 2026 12:20:45 +0000 Message-Id: <6ac78a9d.1d694.44516c08@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dd51cef58311ee0024be99116238d1c0032bdf2b commit dd51cef58311ee0024be99116238d1c0032bdf2b Author: Ed Maste AuthorDate: 2023-12-02 02:42:36 +0000 Commit: Ed Maste CommitDate: 2026-10-08 12:19:22 +0000 sound: Whitespace cleanup In advance of additional sound(4) work, remove EOL whitespace and mixed tab/space. Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D60442 --- sys/dev/sound/fdt/audio_soc.c | 14 +-- sys/dev/sound/macio/aoa.c | 76 ++++++------- sys/dev/sound/macio/aoa.h | 2 +- sys/dev/sound/macio/davbus.c | 100 ++++++++-------- sys/dev/sound/macio/davbusreg.h | 26 ++--- sys/dev/sound/macio/i2s.c | 126 ++++++++++----------- sys/dev/sound/macio/snapper.c | 26 ++--- sys/dev/sound/macio/tumbler.c | 36 +++--- sys/dev/sound/pci/allegro_code.h | 8 +- sys/dev/sound/pci/allegro_reg.h | 2 +- sys/dev/sound/pci/als4000.h | 2 +- sys/dev/sound/pci/atiixp.c | 2 +- sys/dev/sound/pci/atiixp.h | 2 +- sys/dev/sound/pci/cmi.c | 52 ++++----- sys/dev/sound/pci/cs4281.c | 22 ++-- sys/dev/sound/pci/cs4281.h | 4 +- sys/dev/sound/pci/csa.c | 2 +- sys/dev/sound/pci/csapcm.c | 20 ++-- sys/dev/sound/pci/csareg.h | 4 +- sys/dev/sound/pci/emu10k1.c | 16 +-- sys/dev/sound/pci/emu10kx-pcm.c | 12 +- sys/dev/sound/pci/emu10kx.c | 66 +++++------ sys/dev/sound/pci/emu10kx.h | 2 +- sys/dev/sound/pci/envy24.c | 18 +-- sys/dev/sound/pci/envy24.h | 2 +- sys/dev/sound/pci/envy24ht.c | 20 ++-- sys/dev/sound/pci/envy24ht.h | 16 +-- sys/dev/sound/pci/es137x.c | 140 +++++++++++------------ sys/dev/sound/pci/fm801.c | 34 +++--- sys/dev/sound/pci/ich.c | 22 ++-- sys/dev/sound/pci/maestro3.c | 22 ++-- sys/dev/sound/pci/neomagic.c | 48 ++++---- sys/dev/sound/pci/solo.c | 200 ++++++++++++++++---------------- sys/dev/sound/pci/spicds.h | 2 +- sys/dev/sound/pci/t4dwave.c | 58 +++++----- sys/dev/sound/pci/t4dwave.h | 8 +- sys/dev/sound/pci/via8233.c | 4 +- sys/dev/sound/pci/via8233.h | 8 +- sys/dev/sound/pci/via82c686.c | 26 ++--- sys/dev/sound/pci/vibes.c | 12 +- sys/dev/sound/pci/vibes.h | 22 ++-- sys/dev/sound/pcm/ac97.c | 66 +++++------ sys/dev/sound/pcm/ac97.h | 8 +- sys/dev/sound/pcm/buffer.c | 2 +- sys/dev/sound/pcm/channel.c | 64 +++++------ sys/dev/sound/pcm/channel.h | 12 +- sys/dev/sound/pcm/dsp.c | 232 +++++++++++++++++++------------------- sys/dev/sound/pcm/feeder.c | 2 +- sys/dev/sound/pcm/feeder.h | 2 +- sys/dev/sound/pcm/feeder_chain.c | 2 +- sys/dev/sound/pcm/feeder_matrix.c | 2 +- sys/dev/sound/pcm/feeder_rate.c | 6 +- sys/dev/sound/pcm/matrix.h | 2 +- sys/dev/sound/pcm/mixer.c | 8 +- sys/dev/sound/pcm/sound.c | 2 +- sys/dev/sound/pcm/vchan.c | 4 +- sys/dev/sound/sndstat.c | 8 +- sys/dev/sound/usb/uaudio.c | 16 +-- sys/dev/sound/usb/uaudioreg.h | 2 +- 59 files changed, 862 insertions(+), 862 deletions(-) diff --git a/sys/dev/sound/fdt/audio_soc.c b/sys/dev/sound/fdt/audio_soc.c index 9cd913004c0e..5e7c5a21fc8b 100644 --- a/sys/dev/sound/fdt/audio_soc.c +++ b/sys/dev/sound/fdt/audio_soc.c @@ -51,7 +51,7 @@ struct audio_soc_aux_node { struct audio_soc_channel { struct audio_soc_softc *sc; /* parent device's softc */ - struct pcm_channel *pcm; /* PCM channel */ + struct pcm_channel *pcm; /* PCM channel */ struct snd_dbuf *buf; /* PCM buffer */ int dir; /* direction */ }; @@ -69,8 +69,8 @@ struct audio_soc_softc { device_t codec_dev; SLIST_HEAD(, audio_soc_aux_node) aux_devs; unsigned int mclk_fs; - struct audio_soc_channel play_channel; - struct audio_soc_channel rec_channel; + struct audio_soc_channel play_channel; + struct audio_soc_channel rec_channel; /* * The format is from the CPU node, for CODEC node clock roles * need to be reversed. @@ -268,10 +268,10 @@ audio_soc_chan_getcaps(kobj_t obj, void *data) } static kobj_method_t audio_soc_chan_methods[] = { - KOBJMETHOD(channel_init, audio_soc_chan_init), - KOBJMETHOD(channel_free, audio_soc_chan_free), - KOBJMETHOD(channel_setformat, audio_soc_chan_setformat), - KOBJMETHOD(channel_setspeed, audio_soc_chan_setspeed), + KOBJMETHOD(channel_init, audio_soc_chan_init), + KOBJMETHOD(channel_free, audio_soc_chan_free), + KOBJMETHOD(channel_setformat, audio_soc_chan_setformat), + KOBJMETHOD(channel_setspeed, audio_soc_chan_setspeed), KOBJMETHOD(channel_setblocksize,audio_soc_chan_setblocksize), KOBJMETHOD(channel_trigger, audio_soc_chan_trigger), KOBJMETHOD(channel_getptr, audio_soc_chan_getptr), diff --git a/sys/dev/sound/macio/aoa.c b/sys/dev/sound/macio/aoa.c index db22dcc4a2d8..076df727361d 100644 --- a/sys/dev/sound/macio/aoa.c +++ b/sys/dev/sound/macio/aoa.c @@ -54,24 +54,24 @@ #include "mixer_if.h" struct aoa_dma { - struct mtx mutex; - struct resource *reg; /* DBDMA registers */ - dbdma_channel_t *channel; /* DBDMA channel */ - bus_dma_tag_t tag; /* bus_dma tag */ - struct pcm_channel *pcm; /* PCM channel */ - struct snd_dbuf *buf; /* PCM buffer */ - unsigned int slots; /* # of slots */ - unsigned int slot; /* current slot */ - unsigned int bufsz; /* buffer size */ - unsigned int blksz; /* block size */ - int running; + struct mtx mutex; + struct resource *reg; /* DBDMA registers */ + dbdma_channel_t *channel; /* DBDMA channel */ + bus_dma_tag_t tag; /* bus_dma tag */ + struct pcm_channel *pcm; /* PCM channel */ + struct snd_dbuf *buf; /* PCM buffer */ + unsigned int slots; /* # of slots */ + unsigned int slot; /* current slot */ + unsigned int bufsz; /* buffer size */ + unsigned int blksz; /* block size */ + int running; }; static void aoa_dma_set_program(struct aoa_dma *dma) { - uint32_t addr; - int i; + uint32_t addr; + int i; addr = (uint32_t)dma->buf->buf_addr; KASSERT(dma->bufsz == dma->buf->bufsize, ("bad size")); @@ -79,7 +79,7 @@ aoa_dma_set_program(struct aoa_dma *dma) dma->slots = dma->bufsz / dma->blksz; for (i = 0; i < dma->slots; ++i) { - dbdma_insert_command(dma->channel, + dbdma_insert_command(dma->channel, i, /* slot */ DBDMA_OUTPUT_MORE, /* command */ 0, /* stream */ @@ -109,19 +109,19 @@ aoa_dma_set_program(struct aoa_dma *dma) #define AOA_BUFFER_SIZE 65536 -static struct aoa_dma * +static struct aoa_dma * aoa_dma_create(struct aoa_softc *sc) { struct aoa_dma *dma; - bus_dma_tag_t tag; - int err; + bus_dma_tag_t tag; + int err; device_t self; self = sc->sc_dev; - err = bus_dma_tag_create(bus_get_dma_tag(self), - 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + err = bus_dma_tag_create(bus_get_dma_tag(self), + 4, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, AOA_BUFFER_SIZE, 1, AOA_BUFFER_SIZE, 0, NULL, NULL, &tag); - if (err != 0) + if (err != 0) return (NULL); dma = malloc(sizeof(*dma), M_DEVBUF, M_WAITOK | M_ZERO); @@ -147,10 +147,10 @@ aoa_dma_delete(struct aoa_dma *dma) static uint32_t aoa_chan_setblocksize(kobj_t obj, void *data, uint32_t blocksz) { - struct aoa_dma *dma = data; - int err, lz; + struct aoa_dma *dma = data; + int err, lz; - DPRINTF(("aoa_chan_setblocksize: blocksz = %u, dma->blksz = %u\n", + DPRINTF(("aoa_chan_setblocksize: blocksz = %u, dma->blksz = %u\n", blocksz, dma->blksz)); KASSERT(!dma->running, ("dma is running")); KASSERT(blocksz > 0, ("bad blocksz")); @@ -209,7 +209,7 @@ aoa_chan_setspeed(kobj_t obj, void *data, uint32_t speed) static uint32_t aoa_chan_getptr(kobj_t obj, void *data) { - struct aoa_dma *dma = data; + struct aoa_dma *dma = data; if (!dma->running) return (0); @@ -218,12 +218,12 @@ aoa_chan_getptr(kobj_t obj, void *data) } static void * -aoa_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, +aoa_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) { - struct aoa_softc *sc = devinfo; + struct aoa_softc *sc = devinfo; struct aoa_dma *dma; - int max_slots, err; + int max_slots, err; KASSERT(dir == PCMDIR_PLAY, ("bad dir")); @@ -257,15 +257,15 @@ aoa_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, static int aoa_chan_trigger(kobj_t obj, void *data, int go) { - struct aoa_dma *dma = data; - int i; + struct aoa_dma *dma = data; + int i; switch (go) { case PCMTRIG_START: /* Start the DMA. */ dma->running = 1; - + dma->slot = 0; dbdma_set_current_cmd(dma->channel, dma->slot); @@ -275,7 +275,7 @@ aoa_chan_trigger(kobj_t obj, void *data, int go) case PCMTRIG_STOP: case PCMTRIG_ABORT: - + mtx_lock(&dma->mutex); dma->running = 0; @@ -304,7 +304,7 @@ aoa_chan_trigger(kobj_t obj, void *data, int go) static int aoa_chan_free(kobj_t obj, void *data) { - struct aoa_dma *dma = data; + struct aoa_dma *dma = data; sndbuf_free(dma->buf); dbdma_free_channel(dma->channel); @@ -313,7 +313,7 @@ aoa_chan_free(kobj_t obj, void *data) return (0); } -void +void aoa_interrupt(void *xsc) { struct aoa_softc *sc = xsc; @@ -349,10 +349,10 @@ aoa_chan_getcaps(kobj_t obj, void *data) } static kobj_method_t aoa_chan_methods[] = { - KOBJMETHOD(channel_init, aoa_chan_init), - KOBJMETHOD(channel_free, aoa_chan_free), - KOBJMETHOD(channel_setformat, aoa_chan_setformat), - KOBJMETHOD(channel_setspeed, aoa_chan_setspeed), + KOBJMETHOD(channel_init, aoa_chan_init), + KOBJMETHOD(channel_free, aoa_chan_free), + KOBJMETHOD(channel_setformat, aoa_chan_setformat), + KOBJMETHOD(channel_setspeed, aoa_chan_setspeed), KOBJMETHOD(channel_setblocksize,aoa_chan_setblocksize), KOBJMETHOD(channel_trigger, aoa_chan_trigger), KOBJMETHOD(channel_getptr, aoa_chan_getptr), @@ -384,7 +384,7 @@ aoa_attach(void *xsc, kobj_class_t mixer_class, void *mixer_devinfo) pcm_addchan(self, PCMDIR_PLAY, &aoa_chan_class, sc); - snprintf(status, sizeof(status), "at %s", ofw_bus_get_name(self)); + snprintf(status, sizeof(status), "at %s", ofw_bus_get_name(self)); return (pcm_register(self, status)); } diff --git a/sys/dev/sound/macio/aoa.h b/sys/dev/sound/macio/aoa.h index b14fad3b6500..2f974754da81 100644 --- a/sys/dev/sound/macio/aoa.h +++ b/sys/dev/sound/macio/aoa.h @@ -35,7 +35,7 @@ #endif struct aoa_softc { - device_t sc_dev; + device_t sc_dev; void *sc_intrp; struct resource *sc_odma; }; diff --git a/sys/dev/sound/macio/davbus.c b/sys/dev/sound/macio/davbus.c index 6ceab21b322c..aa727d35edea 100644 --- a/sys/dev/sound/macio/davbus.c +++ b/sys/dev/sound/macio/davbus.c @@ -57,25 +57,25 @@ #include "mixer_if.h" struct davbus_softc { - struct aoa_softc aoa; - phandle_t node; - phandle_t soundnode; - struct resource *reg; - struct mtx mutex; - int device_id; - unsigned int output_mask; - unsigned int (*read_status)(struct davbus_softc *, unsigned int); + struct aoa_softc aoa; + phandle_t node; + phandle_t soundnode; + struct resource *reg; + struct mtx mutex; + int device_id; + unsigned int output_mask; + unsigned int (*read_status)(struct davbus_softc *, unsigned int); void (*set_outputs)(struct davbus_softc *, unsigned int); }; -static int davbus_probe(device_t); -static int davbus_attach(device_t); +static int davbus_probe(device_t); +static int davbus_attach(device_t); static void davbus_cint(void *); static device_method_t pcm_davbus_methods[] = { /* Device interface. */ DEVMETHOD(device_probe, davbus_probe), - DEVMETHOD(device_attach, davbus_attach), + DEVMETHOD(device_attach, davbus_attach), DEVMETHOD_END }; @@ -94,7 +94,7 @@ MODULE_DEPEND(pcm_davbus, sound, 1, 1, 1); static int davbus_probe(device_t self) { - const char *name; + const char *name; name = ofw_bus_get_name(self); if (!name) @@ -115,7 +115,7 @@ davbus_probe(device_t self) static int burgundy_init(struct snd_mixer *m); static int burgundy_uninit(struct snd_mixer *m); static int burgundy_reinit(struct snd_mixer *m); -static void burgundy_write_locked(struct davbus_softc *, unsigned int, unsigned int); +static void burgundy_write_locked(struct davbus_softc *, unsigned int, unsigned int); static void burgundy_set_outputs(struct davbus_softc *d, unsigned int mask); static unsigned int burgundy_read_status(struct davbus_softc *d, unsigned int status); static int burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left, @@ -123,10 +123,10 @@ static int burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left, static uint32_t burgundy_setrecsrc(struct snd_mixer *m, uint32_t src); static kobj_method_t burgundy_mixer_methods[] = { - KOBJMETHOD(mixer_init, burgundy_init), - KOBJMETHOD(mixer_uninit, burgundy_uninit), - KOBJMETHOD(mixer_reinit, burgundy_reinit), - KOBJMETHOD(mixer_set, burgundy_set), + KOBJMETHOD(mixer_init, burgundy_init), + KOBJMETHOD(mixer_uninit, burgundy_uninit), + KOBJMETHOD(mixer_reinit, burgundy_reinit), + KOBJMETHOD(mixer_set, burgundy_set), KOBJMETHOD(mixer_setrecsrc, burgundy_setrecsrc), KOBJMETHOD_END }; @@ -146,7 +146,7 @@ burgundy_init(struct snd_mixer *m) /* * We configure the Burgundy codec as follows: * - * o Input subframe 0 is connected to input digital + * o Input subframe 0 is connected to input digital * stream A (ISA). * o Stream A (ISA) is mixed in mixer 2 (MIX2). * o Output of mixer 2 (MIX2) is routed to output sources @@ -157,12 +157,12 @@ burgundy_init(struct snd_mixer *m) burgundy_write_locked(d, 0x16700, 0x40); - burgundy_write_locked(d, BURGUNDY_MIX0_REG, 0); + burgundy_write_locked(d, BURGUNDY_MIX0_REG, 0); burgundy_write_locked(d, BURGUNDY_MIX1_REG, 0); burgundy_write_locked(d, BURGUNDY_MIX2_REG, BURGUNDY_MIX_ISA); burgundy_write_locked(d, BURGUNDY_MIX3_REG, 0); - burgundy_write_locked(d, BURGUNDY_OS_REG, BURGUNDY_OS0_MIX2 | + burgundy_write_locked(d, BURGUNDY_OS_REG, BURGUNDY_OS0_MIX2 | BURGUNDY_OS1_MIX2); burgundy_write_locked(d, BURGUNDY_SDIN_REG, BURGUNDY_ISA_SF0); @@ -177,7 +177,7 @@ burgundy_init(struct snd_mixer *m) burgundy_write_locked(d, BURGUNDY_ISSAL_REG, BURGUNDY_ISS_UNITY); burgundy_write_locked(d, BURGUNDY_ISSAR_REG, BURGUNDY_ISS_UNITY); - burgundy_set_outputs(d, burgundy_read_status(d, + burgundy_set_outputs(d, burgundy_read_status(d, bus_read_4(d->reg, DAVBUS_CODEC_STATUS))); mtx_unlock(&d->mutex); @@ -209,7 +209,7 @@ burgundy_write_locked(struct davbus_softc *d, unsigned int reg, unsigned int val offset = reg & 0xFF; for (i = offset; i < offset + size; ++i) { - data = BURGUNDY_CTRL_WRITE | (addr << 12) | + data = BURGUNDY_CTRL_WRITE | (addr << 12) | ((size + offset - 1) << 10) | (i << 8) | (val & 0xFF); if (i == offset) data |= BURGUNDY_CTRL_RESET; @@ -219,9 +219,9 @@ burgundy_write_locked(struct davbus_softc *d, unsigned int reg, unsigned int val while (bus_read_4(d->reg, DAVBUS_CODEC_CTRL) & DAVBUS_CODEC_BUSY) DELAY(1); - + val >>= 8; /* next byte. */ - } + } } /* Must be called with d->mutex held. */ @@ -251,7 +251,7 @@ burgundy_set_outputs(struct davbus_softc *d, unsigned int mask) } if (mask & (1 << 1)) { DPRINTF((" HEADPHONES")); - x |= BURGUNDY_P14L_EN | BURGUNDY_P14R_EN; + x |= BURGUNDY_P14L_EN | BURGUNDY_P14R_EN; } DPRINTF(("\n")); @@ -311,7 +311,7 @@ burgundy_setrecsrc(struct snd_mixer *m, uint32_t src) static int screamer_init(struct snd_mixer *m); static int screamer_uninit(struct snd_mixer *m); static int screamer_reinit(struct snd_mixer *m); -static void screamer_write_locked(struct davbus_softc *, unsigned int, unsigned int); +static void screamer_write_locked(struct davbus_softc *, unsigned int, unsigned int); static void screamer_set_outputs(struct davbus_softc *d, unsigned int mask); static unsigned int screamer_read_status(struct davbus_softc *d, unsigned int status); static int screamer_set(struct snd_mixer *m, unsigned dev, unsigned left, @@ -319,10 +319,10 @@ static int screamer_set(struct snd_mixer *m, unsigned dev, unsigned left, static uint32_t screamer_setrecsrc(struct snd_mixer *m, uint32_t src); static kobj_method_t screamer_mixer_methods[] = { - KOBJMETHOD(mixer_init, screamer_init), - KOBJMETHOD(mixer_uninit, screamer_uninit), - KOBJMETHOD(mixer_reinit, screamer_reinit), - KOBJMETHOD(mixer_set, screamer_set), + KOBJMETHOD(mixer_init, screamer_init), + KOBJMETHOD(mixer_uninit, screamer_uninit), + KOBJMETHOD(mixer_reinit, screamer_reinit), + KOBJMETHOD(mixer_set, screamer_set), KOBJMETHOD(mixer_setrecsrc, screamer_setrecsrc), KOBJMETHOD_END }; @@ -341,10 +341,10 @@ screamer_init(struct snd_mixer *m) mtx_lock(&d->mutex); - screamer_write_locked(d, SCREAMER_CODEC_ADDR0, SCREAMER_INPUT_CD | + screamer_write_locked(d, SCREAMER_CODEC_ADDR0, SCREAMER_INPUT_CD | SCREAMER_DEFAULT_CD_GAIN); - screamer_set_outputs(d, screamer_read_status(d, + screamer_set_outputs(d, screamer_read_status(d, bus_read_4(d->reg, DAVBUS_CODEC_STATUS))); screamer_write_locked(d, SCREAMER_CODEC_ADDR2, 0); @@ -374,7 +374,7 @@ screamer_reinit(struct snd_mixer *m) static void screamer_write_locked(struct davbus_softc *d, unsigned int reg, unsigned int val) { - unsigned int x; + unsigned int x; KASSERT(val == (val & 0xfff), ("bad val")); @@ -394,7 +394,7 @@ screamer_write_locked(struct davbus_softc *d, unsigned int reg, unsigned int val static void screamer_set_outputs(struct davbus_softc *d, unsigned int mask) { - unsigned int x; + unsigned int x; if (mask == d->output_mask) { return; @@ -433,7 +433,7 @@ screamer_set_outputs(struct davbus_softc *d, unsigned int mask) static unsigned int screamer_read_status(struct davbus_softc *d, unsigned int status) { - int headphones; + int headphones; switch (d->device_id) { case 5: /* Sawtooth */ @@ -473,7 +473,7 @@ screamer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) mtx_lock(&d->mutex); screamer_write_locked(d, SCREAMER_CODEC_ADDR2, (lval << 6) | rval); - screamer_write_locked(d, SCREAMER_CODEC_ADDR4, (lval << 6) | + screamer_write_locked(d, SCREAMER_CODEC_ADDR4, (lval << 6) | rval); mtx_unlock(&d->mutex); @@ -492,12 +492,12 @@ screamer_setrecsrc(struct snd_mixer *m, uint32_t src) static int davbus_attach(device_t self) { - struct davbus_softc *sc; - struct resource *dbdma_irq, *cintr; - void *cookie; + struct davbus_softc *sc; + struct resource *dbdma_irq, *cintr; + void *cookie; kobj_class_t mixer_class; char compat[64]; - int rid, oirq, err; + int rid, oirq, err; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); @@ -508,19 +508,19 @@ davbus_attach(device_t self) /* Map the controller register space. */ rid = 0; sc->reg = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); - if (sc->reg == NULL) + if (sc->reg == NULL) return (ENXIO); /* Map the DBDMA channel register space. */ rid = 1; - sc->aoa.sc_odma = bus_alloc_resource_any(self, SYS_RES_MEMORY, + sc->aoa.sc_odma = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->aoa.sc_odma == NULL) return (ENXIO); /* Establish the DBDMA channel edge-triggered interrupt. */ rid = 1; - dbdma_irq = bus_alloc_resource_any(self, SYS_RES_IRQ, + dbdma_irq = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (dbdma_irq == NULL) return (ENXIO); @@ -532,7 +532,7 @@ davbus_attach(device_t self) err = powerpc_config_intr(oirq, INTR_TRIGGER_EDGE, INTR_POLARITY_LOW); if (err != 0) return (err); - + snd_setup_intr(self, dbdma_irq, INTR_MPSAFE, aoa_interrupt, sc, &cookie); @@ -548,14 +548,14 @@ davbus_attach(device_t self) /* Setup the control interrupt. */ rid = 0; - cintr = bus_alloc_resource_any(self, SYS_RES_IRQ, + cintr = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); - if (cintr != NULL) + if (cintr != NULL) bus_setup_intr(self, cintr, INTR_TYPE_MISC | INTR_MPSAFE, NULL, davbus_cint, sc, &cookie); /* Initialize controller registers. */ - bus_write_4(sc->reg, DAVBUS_SOUND_CTRL, DAVBUS_INPUT_SUBFRAME0 | + bus_write_4(sc->reg, DAVBUS_SOUND_CTRL, DAVBUS_INPUT_SUBFRAME0 | DAVBUS_OUTPUT_SUBFRAME0 | DAVBUS_RATE_44100 | DAVBUS_INTR_PORTCHG); /* Pick the codec module */ @@ -574,7 +574,7 @@ davbus_attach(device_t self) return (0); } -static void +static void davbus_cint(void *ptr) { struct davbus_softc *d = ptr; @@ -584,9 +584,9 @@ davbus_cint(void *ptr) reg = bus_read_4(d->reg, DAVBUS_SOUND_CTRL); if (reg & DAVBUS_PORTCHG) { - + status = bus_read_4(d->reg, DAVBUS_CODEC_STATUS); - + if (d->read_status && d->set_outputs) { mask = (*d->read_status)(d, status); (*d->set_outputs)(d, mask); diff --git a/sys/dev/sound/macio/davbusreg.h b/sys/dev/sound/macio/davbusreg.h index d05beb05d01c..e725a887a7e8 100644 --- a/sys/dev/sound/macio/davbusreg.h +++ b/sys/dev/sound/macio/davbusreg.h @@ -152,7 +152,7 @@ #define BURGUNDY_OS3_MIX2 0x00000080 #define BURGUNDY_OS3_MIX3 0x000000C0 #define BURGUNDY_OSA_MIX0 0x00000000 -#define BURGUNDY_OSA_MIX1 0x00010000 +#define BURGUNDY_OSA_MIX1 0x00010000 #define BURGUNDY_OSA_MIX2 0x00020000 #define BURGUNDY_OSA_MIX3 0x00030000 #define BURGUNDY_OSB_MIX0 0x00000000 @@ -195,8 +195,8 @@ #define BURGUNDY_OSS3R_REG 0x13103 #define BURGUNDY_OSS_UNITY 0xDF -/* Digital input streams ISA-ISC. A stream may be derived from data coming - from the controller in subframes 0 to 3 as well as from internal +/* Digital input streams ISA-ISC. A stream may be derived from data coming + from the controller in subframes 0 to 3 as well as from internal output sources OSA-OSD. */ #define BURGUNDY_SDIN_REG 0x17800 #define BURGUNDY_ISA_SF0 0x00 @@ -214,7 +214,7 @@ #define BURGUNDY_ISS_UNITY 0xDF /* - * Screamer codec control bits + * Screamer codec control bits * This codec has the following 12-bit control registers: * cc0 cc1 cc2 cc4 cc5 cc6 cc7 */ @@ -237,7 +237,7 @@ * Bits 7-4 specify the left ADC input gain; * bits 3-0 specify the right ADC input gain. * - * The gain is a 4-bit value expressed in units of 1.5 dB, + * The gain is a 4-bit value expressed in units of 1.5 dB, * ranging from 0 dB (0) to +22.5 dB (15). */ #define SCREAMER_DEFAULT_CD_GAIN 0x000000bb /* +16.5 dB */ @@ -251,8 +251,8 @@ #define SCREAMER_MUTE_SPEAKER 0x00000080 #define SCREAMER_MUTE_HEADPHONES 0x00000200 #define SCREAMER_PARALLEL_OUTPUT 0x00000c00 -#define SCREAMER_PROG_OUTPUT0 0x00000400 -#define SCREAMER_PROG_OUTPUT1 0x00000800 +#define SCREAMER_PROG_OUTPUT0 0x00000400 +#define SCREAMER_PROG_OUTPUT1 0x00000800 /* cc2: headphones/external port attenuation */ /* cc4: internal speaker attenuation */ @@ -265,12 +265,12 @@ */ /* screamer codec status bits. */ -#define SCREAMER_STATUS_MASK 0x00FFFFFF -#define SCREAMER_STATUS_SENSEMASK 0x0000000F -#define SCREAMER_STATUS_SENSE0 0x00000008 -#define SCREAMER_STATUS_SENSE1 0x00000004 -#define SCREAMER_STATUS_SENSE2 0x00000002 -#define SCREAMER_STATUS_SENSE3 0x00000001 +#define SCREAMER_STATUS_MASK 0x00FFFFFF +#define SCREAMER_STATUS_SENSEMASK 0x0000000F +#define SCREAMER_STATUS_SENSE0 0x00000008 +#define SCREAMER_STATUS_SENSE1 0x00000004 +#define SCREAMER_STATUS_SENSE2 0x00000002 +#define SCREAMER_STATUS_SENSE3 0x00000001 #define SCREAMER_STATUS_PARTMASK 0x00000300 #define SCREAMER_STATUS_PARTSHFT 8 #define SCREAMER_PART_CRYSTAL 0x00000100 diff --git a/sys/dev/sound/macio/i2s.c b/sys/dev/sound/macio/i2s.c index 3dabbc93c77c..6acfc5cc0bcd 100644 --- a/sys/dev/sound/macio/i2s.c +++ b/sys/dev/sound/macio/i2s.c @@ -49,8 +49,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * NetBSD: snapper.c,v 1.28 2008/05/16 03:49:54 macallan Exp - * Id: snapper.c,v 1.11 2002/10/31 17:42:13 tsubai Exp + * NetBSD: snapper.c,v 1.28 2008/05/16 03:49:54 macallan Exp + * Id: snapper.c,v 1.11 2002/10/31 17:42:13 tsubai Exp */ /* @@ -83,24 +83,24 @@ #include struct i2s_softc { - struct aoa_softc aoa; - phandle_t node; + struct aoa_softc aoa; + phandle_t node; phandle_t soundnode; - struct resource *reg; - unsigned int output_mask; - struct mtx port_mtx; + struct resource *reg; + unsigned int output_mask; + struct mtx port_mtx; }; -static int i2s_probe(device_t); -static int i2s_attach(device_t); -static void i2s_postattach(void *); -static int i2s_setup(struct i2s_softc *, unsigned int, unsigned int, unsigned int); +static int i2s_probe(device_t); +static int i2s_attach(device_t); +static void i2s_postattach(void *); +static int i2s_setup(struct i2s_softc *, unsigned int, unsigned int, unsigned int); static void i2s_mute_headphone (struct i2s_softc *, int); static void i2s_mute_lineout (struct i2s_softc *, int); static void i2s_mute_speaker (struct i2s_softc *, int); -static void i2s_set_outputs(void *, unsigned int); +static void i2s_set_outputs(void *, unsigned int); -static struct intr_config_hook *i2s_delayed_attach = NULL; +static struct intr_config_hook *i2s_delayed_attach = NULL; kobj_class_t i2s_mixer_class = NULL; device_t i2s_mixer = NULL; @@ -108,7 +108,7 @@ device_t i2s_mixer = NULL; static device_method_t pcm_i2s_methods[] = { /* Device interface. */ DEVMETHOD(device_probe, i2s_probe), - DEVMETHOD(device_attach, i2s_attach), + DEVMETHOD(device_attach, i2s_attach), DEVMETHOD_END }; @@ -122,7 +122,7 @@ DRIVER_MODULE(pcm_i2s, macio, pcm_i2s_driver, 0, 0); MODULE_DEPEND(pcm_i2s, sound, 1, 1, 1); static int aoagpio_probe(device_t); -static int aoagpio_attach(device_t); +static int aoagpio_attach(device_t); static device_method_t aoagpio_methods[] = { /* Device interface. */ @@ -132,8 +132,8 @@ static device_method_t aoagpio_methods[] = { }; struct aoagpio_softc { - device_t dev; - int ctrl; + device_t dev; + int ctrl; int detect_active; /* for extint-gpio */ int level; /* for extint-gpio */ struct i2s_softc *i2s; /* for extint-gpio */ @@ -153,7 +153,7 @@ DRIVER_MODULE(aoagpio, macgpio, aoagpio_driver, 0, 0); static int i2s_probe(device_t self) { - const char *name; + const char *name; phandle_t subchild; char subchildname[255]; @@ -184,11 +184,11 @@ static phandle_t of_find_firstchild_byname(phandle_t, const char *); static int i2s_attach(device_t self) { - struct i2s_softc *sc; - struct resource *dbdma_irq; + struct i2s_softc *sc; + struct resource *dbdma_irq; void *dbdma_ih; - int rid, oirq, err; - phandle_t port; + int rid, oirq, err; + phandle_t port; sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO); @@ -212,14 +212,14 @@ i2s_attach(device_t self) /* Map the DBDMA channel register space. */ rid = 1; - sc->aoa.sc_odma = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, + sc->aoa.sc_odma = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->aoa.sc_odma == NULL) return ENXIO; /* Establish the DBDMA channel edge-triggered interrupt. */ rid = 1; - dbdma_irq = bus_alloc_resource_any(self, SYS_RES_IRQ, + dbdma_irq = bus_alloc_resource_any(self, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (dbdma_irq == NULL) return (ENXIO); @@ -270,7 +270,7 @@ enum gpio_ctrl { ((1 << HEADPHONE_DETECT) | \ (1 << LINEOUT_DETECT)) -static struct aoagpio_softc *gpio_ctrls[GPIO_CTRL_NUM] = +static struct aoagpio_softc *gpio_ctrls[GPIO_CTRL_NUM] = {NULL, NULL, NULL, NULL, NULL, NULL}; static struct gpio_match { @@ -279,21 +279,21 @@ static struct gpio_match { } gpio_controls[] = { {"headphone-mute", HEADPHONE_MUTE}, {"lineout-mute", LINEOUT_MUTE}, - {"amp-mute", AMP_MUTE}, + {"amp-mute", AMP_MUTE}, {"headphone-detect", HEADPHONE_DETECT}, {"lineout-detect", LINEOUT_DETECT}, {"line-output-detect", LINEOUT_DETECT}, {"audio-hw-reset", AUDIO_HW_RESET}, - {"hw-reset", AUDIO_HW_RESET}, - {NULL, GPIO_CTRL_NUM} + {"hw-reset", AUDIO_HW_RESET}, + {NULL, GPIO_CTRL_NUM} }; -static void i2s_cint(struct i2s_softc *); +static void i2s_cint(struct i2s_softc *); static void aoagpio_int(void *cookie) { - device_t self = cookie; + device_t self = cookie; struct aoagpio_softc *sc; sc = device_get_softc(self); @@ -310,9 +310,9 @@ aoagpio_int(void *cookie) static int aoagpio_probe(device_t gpio) { - phandle_t node; + phandle_t node; char bname[32]; - const char *name; + const char *name; struct gpio_match *m; struct aoagpio_softc *sc; @@ -337,7 +337,7 @@ aoagpio_probe(device_t gpio) sc->detect_active = 0; sc->i2s = NULL; - OF_getprop(node, "audio-gpio-active-state", + OF_getprop(node, "audio-gpio-active-state", &sc->detect_active, sizeof(sc->detect_active)); if ((1 << m->ctrl) & GPIO_CTRL_EXTINT_SET) @@ -352,7 +352,7 @@ aoagpio_probe(device_t gpio) return (ENXIO); } -static int +static int aoagpio_attach(device_t gpio) { struct aoagpio_softc *sc; @@ -370,8 +370,8 @@ aoagpio_attach(device_t gpio) irq = rman_get_start(r); DPRINTF(("interrupting at irq %d\n", irq)); - if (powerpc_config_intr(irq, INTR_TRIGGER_EDGE, - INTR_POLARITY_LOW) != 0) + if (powerpc_config_intr(irq, INTR_TRIGGER_EDGE, + INTR_POLARITY_LOW) != 0) return (ENXIO); bus_setup_intr(gpio, r, INTR_TYPE_MISC | INTR_MPSAFE | @@ -418,7 +418,7 @@ aoagpio_attach(device_t gpio) #define OUTPUT_16BIT (0 << 0) #define OUTPUT_24BIT (3 << 0) -/* Master clock, needed by some codecs. We hardcode this +/* Master clock, needed by some codecs. We hardcode this to 256 * fs as this is valid for most codecs. */ #define MCLK_FS 256 @@ -436,7 +436,7 @@ static const struct i2s_clksrc { /* Configure the I2S controller for the required settings. 'rate' is the frame rate. 'wordsize' is the sample size (usually 16 bits). - 'sclk_fs' is the SCLK/framerate ratio, which needs to be equal + 'sclk_fs' is the SCLK/framerate ratio, which needs to be equal or greater to the number of bits per frame. */ static int @@ -487,7 +487,7 @@ i2s_setup(struct i2s_softc *sc, unsigned int rate, unsigned int wordsize, unsign break; } reg |= (x << 24) & MCLK_DIV_MASK; - + switch (sdiv) { case 1: x = 8; @@ -502,8 +502,8 @@ i2s_setup(struct i2s_softc *sc, unsigned int rate, unsigned int wordsize, unsign reg |= (x << 20) & SCLK_DIV_MASK; /* - * XXX use master mode for now. This needs to be - * revisited if we want to add recording from SPDIF some day. + * XXX use master mode for now. This needs to be + * revisited if we want to add recording from SPDIF some day. */ reg |= SCLK_MASTER; @@ -537,8 +537,8 @@ i2s_setup(struct i2s_softc *sc, unsigned int rate, unsigned int wordsize, unsign x = bus_read_4(sc->reg, I2S_FORMAT); if (x != reg) { /* - * XXX to change the format we need to stop the clock - * via the FCR registers. For now, rely on the firmware + * XXX to change the format we need to stop the clock + * via the FCR registers. For now, rely on the firmware * to set sane defaults (44100). */ printf("i2s_setup: changing format not supported yet.\n"); @@ -546,17 +546,17 @@ i2s_setup(struct i2s_softc *sc, unsigned int rate, unsigned int wordsize, unsign #ifdef notyet if (obio_fcr_isset(OBIO_FCR1, I2S0CLKEN)) { - - bus_space_write_4(sc->sc_tag, sc->sc_bsh, I2S_INT, + + bus_space_write_4(sc->sc_tag, sc->sc_bsh, I2S_INT, I2S_INT_CLKSTOPPEND); - + obio_fcr_clear(OBIO_FCR1, I2S0CLKEN); for (timo = 1000; timo > 0; timo--) { if (bus_space_read_4(sc->sc_tag, sc->sc_bsh, I2S_INT) & I2S_INT_CLKSTOPPEND) break; - + DELAY(10); } @@ -566,7 +566,7 @@ i2s_setup(struct i2s_softc *sc, unsigned int rate, unsigned int wordsize, unsign } bus_space_write_4(sc->sc_tag, sc->sc_bsh, I2S_FORMAT, reg); - + obio_fcr_set(OBIO_FCR1, I2S0CLKEN); #endif } @@ -578,8 +578,8 @@ i2s_setup(struct i2s_softc *sc, unsigned int rate, unsigned int wordsize, unsign static phandle_t of_find_firstchild_byname(phandle_t node, const char *req_name) { - char name[32]; /* max name len per OF spec. */ - phandle_t n; + char name[32]; /* max name len per OF spec. */ + phandle_t n; for (n = OF_child(node); n != -1; n = OF_peer(n)) { bzero(name, sizeof(name)); @@ -606,8 +606,8 @@ gpio_read(enum gpio_ctrl ctrl) static void gpio_write(enum gpio_ctrl ctrl, unsigned int x) { - struct aoagpio_softc *sc; - unsigned int reg; + struct aoagpio_softc *sc; + unsigned int reg; if ((sc = gpio_ctrls[ctrl]) == NULL) *** 4126 LINES SKIPPED ***