FreeBSD kernel sound device code
davbus.c
Go to the documentation of this file.
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright 2008 by Marco Trillo. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD$
28 */
29
30/*
31 * Apple DAVbus audio controller.
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/bus.h>
37#include <sys/kernel.h>
38#include <sys/lock.h>
39#include <sys/malloc.h>
40#include <sys/module.h>
41#include <sys/mutex.h>
42#include <sys/rman.h>
43
44#include <dev/ofw/ofw_bus.h>
45
46#ifdef HAVE_KERNEL_OPTION_HEADERS
47#include "opt_snd.h"
48#endif
49
50#include <dev/sound/pcm/sound.h>
51
52#include <dev/sound/macio/aoa.h>
54
55#include <machine/intr_machdep.h>
56#include <machine/resource.h>
57#include <machine/bus.h>
58
59#include "mixer_if.h"
60
62 struct aoa_softc aoa;
63 phandle_t node;
64 phandle_t soundnode;
65 struct resource *reg;
66 struct mtx mutex;
69 u_int (*read_status)(struct davbus_softc *, u_int);
70 void (*set_outputs)(struct davbus_softc *, u_int);
71};
72
73static int davbus_probe(device_t);
74static int davbus_attach(device_t);
75static void davbus_cint(void *);
76
77static device_method_t pcm_davbus_methods[] = {
78 /* Device interface. */
79 DEVMETHOD(device_probe, davbus_probe),
80 DEVMETHOD(device_attach, davbus_attach),
81 { 0, 0 }
82};
83
84static driver_t pcm_davbus_driver = {
85 "pcm",
88};
89
90DRIVER_MODULE(pcm_davbus, macio, pcm_davbus_driver, pcm_devclass, 0, 0);
92
93/*****************************************************************************
94 Probe and attachment routines.
95 *****************************************************************************/
96static int
97davbus_probe(device_t self)
98{
99 const char *name;
100
101 name = ofw_bus_get_name(self);
102 if (!name)
103 return (ENXIO);
104
105 if (strcmp(name, "davbus") != 0)
106 return (ENXIO);
107
108 device_set_desc(self, "Apple DAVBus Audio Controller");
109
110 return (0);
111}
112
113/*
114 * Burgundy codec control
115 */
116
117static int burgundy_init(struct snd_mixer *m);
118static int burgundy_uninit(struct snd_mixer *m);
119static int burgundy_reinit(struct snd_mixer *m);
120static void burgundy_write_locked(struct davbus_softc *, u_int, u_int);
121static void burgundy_set_outputs(struct davbus_softc *d, u_int mask);
122static u_int burgundy_read_status(struct davbus_softc *d, u_int status);
123static int burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left,
124 unsigned right);
125static u_int32_t burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src);
126
127static kobj_method_t burgundy_mixer_methods[] = {
128 KOBJMETHOD(mixer_init, burgundy_init),
129 KOBJMETHOD(mixer_uninit, burgundy_uninit),
130 KOBJMETHOD(mixer_reinit, burgundy_reinit),
131 KOBJMETHOD(mixer_set, burgundy_set),
134};
135
136MIXER_DECLARE(burgundy_mixer);
137
138static int
140{
141 struct davbus_softc *d;
142
143 d = mix_getdevinfo(m);
144
147
148 /*
149 * We configure the Burgundy codec as follows:
150 *
151 * o Input subframe 0 is connected to input digital
152 * stream A (ISA).
153 * o Stream A (ISA) is mixed in mixer 2 (MIX2).
154 * o Output of mixer 2 (MIX2) is routed to output sources
155 * OS0 and OS1 which can be converted to analog.
156 *
157 */
158 mtx_lock(&d->mutex);
159
160 burgundy_write_locked(d, 0x16700, 0x40);
161
166
169
171
172 /* Set several digital scalers to unity gain. */
181
183 bus_read_4(d->reg, DAVBUS_CODEC_STATUS)));
184
185 mtx_unlock(&d->mutex);
186
187 mix_setdevs(m, SOUND_MASK_VOLUME);
188
189 return (0);
190}
191
192static int
194{
195 return (0);
196}
197
198static int
200{
201 return (0);
202}
203
204static void
205burgundy_write_locked(struct davbus_softc *d, u_int reg, u_int val)
206{
207 u_int size, addr, offset, data, i;
208
209 size = (reg & 0x00FF0000) >> 16;
210 addr = (reg & 0x0000FF00) >> 8;
211 offset = reg & 0xFF;
212
213 for (i = offset; i < offset + size; ++i) {
214 data = BURGUNDY_CTRL_WRITE | (addr << 12) |
215 ((size + offset - 1) << 10) | (i << 8) | (val & 0xFF);
216 if (i == offset)
218
219 bus_write_4(d->reg, DAVBUS_CODEC_CTRL, data);
220
221 while (bus_read_4(d->reg, DAVBUS_CODEC_CTRL) &
223 DELAY(1);
224
225 val >>= 8; /* next byte. */
226 }
227}
228
229/* Must be called with d->mutex held. */
230static void
232{
233 u_int x = 0;
234
235 if (mask == d->output_mask)
236 return;
237
238 /*
239 * Bordeaux card wirings:
240 * Port 15: RCA out
241 * Port 16: Minijack out
242 * Port 17: Internal speaker
243 *
244 * B&W G3 wirings:
245 * Port 14: Minijack out
246 * Port 17: Internal speaker
247 */
248
249 DPRINTF(("Enabled outputs:"));
250 if (mask & (1 << 0)) {
251 DPRINTF((" SPEAKER"));
252 x |= BURGUNDY_P17M_EN;
253 }
254 if (mask & (1 << 1)) {
255 DPRINTF((" HEADPHONES"));
257 }
258 DPRINTF(("\n"));
259
261 d->output_mask = mask;
262}
263
264static u_int
265burgundy_read_status(struct davbus_softc *d, u_int status)
266{
267 if (status & 0x4)
268 return (1 << 1);
269 else
270 return (1 << 0);
271}
272
273static int
274burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
275{
276 struct davbus_softc *d;
277 int lval, rval;
278
279 lval = ((100 - left) * 15 / 100) & 0xf;
280 rval = ((100 - right) * 15 / 100) & 0xf;
281 DPRINTF(("volume %d %d\n", lval, rval));
282
283 d = mix_getdevinfo(m);
284
285 switch (dev) {
286 case SOUND_MIXER_VOLUME:
287 mtx_lock(&d->mutex);
288
290 burgundy_write_locked(d, BURGUNDY_OL14_REG, (rval << 4) | lval);
291 burgundy_write_locked(d, BURGUNDY_OL15_REG, (rval << 4) | lval);
292 burgundy_write_locked(d, BURGUNDY_OL16_REG, (rval << 4) | lval);
294
295 mtx_unlock(&d->mutex);
296
297 return (left | (right << 8));
298 }
299
300 return (0);
301}
302
303static u_int32_t
305{
306 return (0);
307}
308
309/*
310 * Screamer Codec Control
311 */
312
313static int screamer_init(struct snd_mixer *m);
314static int screamer_uninit(struct snd_mixer *m);
315static int screamer_reinit(struct snd_mixer *m);
316static void screamer_write_locked(struct davbus_softc *, u_int, u_int);
317static void screamer_set_outputs(struct davbus_softc *d, u_int mask);
318static u_int screamer_read_status(struct davbus_softc *d, u_int status);
319static int screamer_set(struct snd_mixer *m, unsigned dev, unsigned left,
320 unsigned right);
321static u_int32_t screamer_setrecsrc(struct snd_mixer *m, u_int32_t src);
322
323static kobj_method_t screamer_mixer_methods[] = {
324 KOBJMETHOD(mixer_init, screamer_init),
325 KOBJMETHOD(mixer_uninit, screamer_uninit),
326 KOBJMETHOD(mixer_reinit, screamer_reinit),
327 KOBJMETHOD(mixer_set, screamer_set),
330};
331
332MIXER_DECLARE(screamer_mixer);
333
334static int
336{
337 struct davbus_softc *d;
338
339 d = mix_getdevinfo(m);
340
343
344 mtx_lock(&d->mutex);
345
348
350 bus_read_4(d->reg, DAVBUS_CODEC_STATUS)));
351
356
357 mtx_unlock(&d->mutex);
358
359 mix_setdevs(m, SOUND_MASK_VOLUME);
360
361 return (0);
362}
363
364static int
366{
367 return (0);
368}
369
370static int
372{
373 return (0);
374}
375
376static void
377screamer_write_locked(struct davbus_softc *d, u_int reg, u_int val)
378{
379 u_int x;
380
381 KASSERT(val == (val & 0xfff), ("bad val"));
382
383 while (bus_read_4(d->reg, DAVBUS_CODEC_CTRL) & DAVBUS_CODEC_BUSY)
384 DELAY(100);
385
386 x = reg;
388 x |= val;
389 bus_write_4(d->reg, DAVBUS_CODEC_CTRL, x);
390
391 while (bus_read_4(d->reg, DAVBUS_CODEC_CTRL) & DAVBUS_CODEC_BUSY)
392 DELAY(100);
393}
394
395/* Must be called with d->mutex held. */
396static void
398{
399 u_int x;
400
401 if (mask == d->output_mask) {
402 return;
403 }
404
406
407 DPRINTF(("Enabled outputs: "));
408
409 if (mask & (1 << 0)) {
410 DPRINTF(("SPEAKER "));
411 x &= ~SCREAMER_MUTE_SPEAKER;
412 }
413 if (mask & (1 << 1)) {
414 DPRINTF(("HEADPHONES "));
415 x &= ~SCREAMER_MUTE_HEADPHONES;
416 }
417
418 DPRINTF(("\n"));
419
420 if (d->device_id == 5 || d->device_id == 11) {
421 DPRINTF(("Enabling programmable output.\n"));
423 }
424 if (d->device_id == 8 || d->device_id == 11) {
425 x &= ~SCREAMER_MUTE_SPEAKER;
426
427 if (mask & (1 << 0))
428 x |= SCREAMER_PROG_OUTPUT1; /* enable speaker. */
429 }
430
432 d->output_mask = mask;
433}
434
435static u_int
436screamer_read_status(struct davbus_softc *d, u_int status)
437{
438 int headphones;
439
440 switch (d->device_id) {
441 case 5: /* Sawtooth */
442 headphones = (status & 0x4);
443 break;
444
445 case 8:
446 case 11: /* iMac DV */
447 /* The iMac DV has 2 headphone outputs. */
448 headphones = (status & 0x7);
449 break;
450
451 default:
452 headphones = (status & 0x8);
453 }
454
455 if (headphones)
456 return (1 << 1);
457 else
458 return (1 << 0);
459}
460
461static int
462screamer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
463{
464 struct davbus_softc *d;
465 int lval, rval;
466
467 lval = ((100 - left) * 15 / 100) & 0xf;
468 rval = ((100 - right) * 15 / 100) & 0xf;
469 DPRINTF(("volume %d %d\n", lval, rval));
470
471 d = mix_getdevinfo(m);
472
473 switch (dev) {
474 case SOUND_MIXER_VOLUME:
475 mtx_lock(&d->mutex);
477 rval);
479 rval);
480 mtx_unlock(&d->mutex);
481
482 return (left | (right << 8));
483 }
484
485 return (0);
486}
487
488static u_int32_t
490{
491 return (0);
492}
493
494static int
495davbus_attach(device_t self)
496{
497 struct davbus_softc *sc;
498 struct resource *dbdma_irq, *cintr;
499 void *cookie;
500 char compat[64];
501 int rid, oirq, err;
502
503 sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
504
505 sc->aoa.sc_dev = self;
506 sc->node = ofw_bus_get_node(self);
507 sc->soundnode = OF_child(sc->node);
508
509 /* Map the controller register space. */
510 rid = 0;
511 sc->reg = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE);
512 if (sc->reg == NULL)
513 return (ENXIO);
514
515 /* Map the DBDMA channel register space. */
516 rid = 1;
517 sc->aoa.sc_odma = bus_alloc_resource_any(self, SYS_RES_MEMORY,
518 &rid, RF_ACTIVE);
519 if (sc->aoa.sc_odma == NULL)
520 return (ENXIO);
521
522 /* Establish the DBDMA channel edge-triggered interrupt. */
523 rid = 1;
524 dbdma_irq = bus_alloc_resource_any(self, SYS_RES_IRQ,
525 &rid, RF_SHAREABLE | RF_ACTIVE);
526 if (dbdma_irq == NULL)
527 return (ENXIO);
528
529 oirq = rman_get_start(dbdma_irq);
530
531 DPRINTF(("interrupting at irq %d\n", oirq));
532
533 err = powerpc_config_intr(oirq, INTR_TRIGGER_EDGE, INTR_POLARITY_LOW);
534 if (err != 0)
535 return (err);
536
537 snd_setup_intr(self, dbdma_irq, INTR_MPSAFE, aoa_interrupt,
538 sc, &cookie);
539
540 /* Now initialize the controller. */
541
542 bzero(compat, sizeof(compat));
543 OF_getprop(sc->soundnode, "compatible", compat, sizeof(compat));
544 OF_getprop(sc->soundnode, "device-id", &sc->device_id, sizeof(u_int));
545
546 mtx_init(&sc->mutex, "DAVbus", NULL, MTX_DEF);
547
548 device_printf(self, "codec: <%s>\n", compat);
549
550 /* Setup the control interrupt. */
551 rid = 0;
552 cintr = bus_alloc_resource_any(self, SYS_RES_IRQ,
553 &rid, RF_SHAREABLE | RF_ACTIVE);
554 if (cintr != NULL)
555 bus_setup_intr(self, cintr, INTR_TYPE_MISC | INTR_MPSAFE,
556 NULL, davbus_cint, sc, &cookie);
557
558 /* Initialize controller registers. */
559 bus_write_4(sc->reg, DAVBUS_SOUND_CTRL, DAVBUS_INPUT_SUBFRAME0 |
561
562 /* Attach DBDMA engine and PCM layer */
563 err = aoa_attach(sc);
564 if (err)
565 return (err);
566
567 /* Install codec module */
568 if (strcmp(compat, "screamer") == 0)
569 mixer_init(self, &screamer_mixer_class, sc);
570 else if (strcmp(compat, "burgundy") == 0)
571 mixer_init(self, &burgundy_mixer_class, sc);
572
573 return (0);
574}
575
576static void
577davbus_cint(void *ptr)
578{
579 struct davbus_softc *d = ptr;
580 u_int reg, status, mask;
581
582 mtx_lock(&d->mutex);
583
584 reg = bus_read_4(d->reg, DAVBUS_SOUND_CTRL);
585 if (reg & DAVBUS_PORTCHG) {
586
587 status = bus_read_4(d->reg, DAVBUS_CODEC_STATUS);
588
589 if (d->read_status && d->set_outputs) {
590 mask = (*d->read_status)(d, status);
591 (*d->set_outputs)(d, mask);
592 }
593
594 /* Clear the interrupt. */
595 bus_write_4(d->reg, DAVBUS_SOUND_CTRL, reg);
596 }
597
598 mtx_unlock(&d->mutex);
599}
u_int32_t data
Definition: ac97_if.m:60
void aoa_interrupt(void *xsc)
Definition: aoa.c:319
int aoa_attach(void *xsc)
Definition: aoa.c:367
#define DPRINTF(x)
Definition: aoa.h:34
const char * name
Definition: audio_soc.c:90
struct pcmchan_matrix * m
Definition: channel_if.m:232
static void davbus_cint(void *)
Definition: davbus.c:577
DRIVER_MODULE(pcm_davbus, macio, pcm_davbus_driver, pcm_devclass, 0, 0)
static int burgundy_uninit(struct snd_mixer *m)
Definition: davbus.c:193
static int burgundy_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: davbus.c:274
MODULE_DEPEND(pcm_davbus, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
static int screamer_uninit(struct snd_mixer *m)
Definition: davbus.c:365
static kobj_method_t screamer_mixer_methods[]
Definition: davbus.c:323
static u_int screamer_read_status(struct davbus_softc *d, u_int status)
Definition: davbus.c:436
static int burgundy_reinit(struct snd_mixer *m)
Definition: davbus.c:199
static void screamer_set_outputs(struct davbus_softc *d, u_int mask)
Definition: davbus.c:397
static void burgundy_write_locked(struct davbus_softc *, u_int, u_int)
Definition: davbus.c:205
static int screamer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right)
Definition: davbus.c:462
static int davbus_attach(device_t)
Definition: davbus.c:495
static void burgundy_set_outputs(struct davbus_softc *d, u_int mask)
Definition: davbus.c:231
static device_method_t pcm_davbus_methods[]
Definition: davbus.c:77
static u_int32_t burgundy_setrecsrc(struct snd_mixer *m, u_int32_t src)
Definition: davbus.c:304
static u_int burgundy_read_status(struct davbus_softc *d, u_int status)
Definition: davbus.c:265
static driver_t pcm_davbus_driver
Definition: davbus.c:84
static u_int32_t screamer_setrecsrc(struct snd_mixer *m, u_int32_t src)
Definition: davbus.c:489
static int screamer_reinit(struct snd_mixer *m)
Definition: davbus.c:371
static int burgundy_init(struct snd_mixer *m)
Definition: davbus.c:139
static void screamer_write_locked(struct davbus_softc *, u_int, u_int)
Definition: davbus.c:377
MIXER_DECLARE(burgundy_mixer)
static kobj_method_t burgundy_mixer_methods[]
Definition: davbus.c:127
static int screamer_init(struct snd_mixer *m)
Definition: davbus.c:335
static int davbus_probe(device_t)
Definition: davbus.c:97
#define BURGUNDY_MUTE_REG
Definition: davbusreg.h:90
#define BURGUNDY_ISA_SF0
Definition: davbusreg.h:204
#define DAVBUS_CODEC_STATUS
Definition: davbusreg.h:40
#define SCREAMER_DEFAULT_CD_GAIN
Definition: davbusreg.h:245
#define BURGUNDY_MIX3_REG
Definition: davbusreg.h:111
#define BURGUNDY_MIX1_REG
Definition: davbusreg.h:109
#define BURGUNDY_OSS0R_REG
Definition: davbusreg.h:191
#define SCREAMER_CODEC_ADDR5
Definition: davbusreg.h:229
#define BURGUNDY_OS0_MIX2
Definition: davbusreg.h:142
#define BURGUNDY_CTRL_RESET
Definition: davbusreg.h:86
#define BURGUNDY_OSS_UNITY
Definition: davbusreg.h:198
#define BURGUNDY_OS_REG
Definition: davbusreg.h:139
#define SCREAMER_CODEC_ADDR4
Definition: davbusreg.h:228
#define BURGUNDY_MIX2_REG
Definition: davbusreg.h:110
#define BURGUNDY_MXS2R_REG
Definition: davbusreg.h:132
#define SCREAMER_MUTE_HEADPHONES
Definition: davbusreg.h:254
#define BURGUNDY_SDIN_REG
Definition: davbusreg.h:203
#define SCREAMER_CODEC_ADDR2
Definition: davbusreg.h:227
#define BURGUNDY_P14L_EN
Definition: davbusreg.h:92
#define DAVBUS_PORTCHG
Definition: davbusreg.h:72
#define SCREAMER_CODEC_ADDR1
Definition: davbusreg.h:226
#define BURGUNDY_CTRL_WRITE
Definition: davbusreg.h:87
#define BURGUNDY_OSS1L_REG
Definition: davbusreg.h:192
#define BURGUNDY_MIX0_REG
Definition: davbusreg.h:108
#define BURGUNDY_P17M_EN
Definition: davbusreg.h:98
#define SCREAMER_PROG_OUTPUT1
Definition: davbusreg.h:257
#define BURGUNDY_OL14_REG
Definition: davbusreg.h:102
#define SCREAMER_CODEC_ADDR0
Definition: davbusreg.h:225
#define BURGUNDY_OS1_MIX2
Definition: davbusreg.h:146
#define BURGUNDY_OSS0L_REG
Definition: davbusreg.h:190
#define BURGUNDY_OL15_REG
Definition: davbusreg.h:103
#define BURGUNDY_ISSAL_REG
Definition: davbusreg.h:214
#define SCREAMER_CODEC_ADDR6
Definition: davbusreg.h:230
#define DAVBUS_INPUT_SUBFRAME0
Definition: davbusreg.h:51
#define DAVBUS_CODEC_BUSY
Definition: davbusreg.h:79
#define DAVBUS_OUTPUT_SUBFRAME0
Definition: davbusreg.h:56
#define DAVBUS_INTR_PORTCHG
Definition: davbusreg.h:74
#define SCREAMER_MUTE_SPEAKER
Definition: davbusreg.h:253
#define BURGUNDY_MIX_ISA
Definition: davbusreg.h:117
#define BURGUNDY_P14R_EN
Definition: davbusreg.h:93
#define BURGUNDY_MXS_UNITY
Definition: davbusreg.h:135
#define DAVBUS_RATE_44100
Definition: davbusreg.h:61
#define BURGUNDY_OSS1R_REG
Definition: davbusreg.h:193
#define DAVBUS_SOUND_CTRL
Definition: davbusreg.h:38
#define BURGUNDY_MXS2L_REG
Definition: davbusreg.h:131
#define BURGUNDY_OL16_REG
Definition: davbusreg.h:104
#define BURGUNDY_ISS_UNITY
Definition: davbusreg.h:216
#define BURGUNDY_ISSAR_REG
Definition: davbusreg.h:215
#define BURGUNDY_OL13_REG
Definition: davbusreg.h:101
#define SCREAMER_INPUT_CD
Definition: davbusreg.h:246
#define BURGUNDY_OL17_REG
Definition: davbusreg.h:105
#define DAVBUS_CODEC_CTRL
Definition: davbusreg.h:39
#define SCREAMER_CODEC_EMSEL0
Definition: davbusreg.h:232
#define SCREAMER_PROG_OUTPUT0
Definition: davbusreg.h:256
unsigned right
Definition: es137x.c:261
unsigned left
Definition: es137x.c:260
uint8_t mask
Definition: hdac.c:212
uint8_t reg
Definition: hdac.c:211
uint8_t size
#define KOBJMETHOD_END
Definition: midi.c:76
static int mixer_setrecsrc(struct snd_mixer *mixer, u_int32_t src)
Definition: mixer.c:373
int mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
Definition: mixer.c:725
static int mixer_set(struct snd_mixer *m, u_int dev, u_int32_t muted, u_int lev)
Definition: mixer.c:247
int mixer_uninit(device_t dev)
Definition: mixer.c:805
void mix_setdevs(struct snd_mixer *m, u_int32_t v)
Definition: mixer.c:489
int mixer_reinit(device_t dev)
Definition: mixer.c:860
void * mix_getdevinfo(struct snd_mixer *m)
Definition: mixer.c:645
unsigned dev
Definition: mixer_if.m:59
u_int32_t src
Definition: mixer_if.m:66
bool * status
uint16_t rid
u_int32_t val
uint64_t * addr
devclass_t pcm_devclass
Definition: sound.c:49
int snd_setup_intr(device_t dev, struct resource *res, int flags, driver_intr_t hand, void *param, void **cookiep)
Definition: sound.c:117
#define SOUND_PREFVER
Definition: sound.h:103
#define SOUND_MAXVER
Definition: sound.h:104
#define SOUND_MINVER
Definition: sound.h:102
#define PCM_SOFTC_SIZE
Definition: sound.h:96
Definition: aoa.h:39
device_t sc_dev
Definition: aoa.h:40
struct resource * sc_odma
Definition: aoa.h:42
phandle_t soundnode
Definition: davbus.c:64
struct resource * reg
Definition: davbus.c:65
u_int(* read_status)(struct davbus_softc *, u_int)
Definition: davbus.c:69
phandle_t node
Definition: davbus.c:63
void(* set_outputs)(struct davbus_softc *, u_int)
Definition: davbus.c:70
struct mtx mutex
Definition: davbus.c:66
int device_id
Definition: davbus.c:67
struct aoa_softc aoa
Definition: davbus.c:62
u_int output_mask
Definition: davbus.c:68
uint16_t offset