1 /* $NetBSD: toccata.c,v 1.11 2005/12/11 12:16:28 christos Exp $ */
4 * Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Paul Kranenburg and Ignatios Souvatzis.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: toccata.c,v 1.11 2005/12/11 12:16:28 christos Exp $");
35 #include <sys/types.h>
36 #include <sys/param.h>
37 #include <sys/systm.h>
38 #include <sys/kernel.h>
39 #include <sys/device.h>
40 #include <sys/fcntl.h> /* FREAD */
42 #include <machine/bus.h>
44 #include <sys/audioio.h>
45 #include <dev/audio_if.h>
47 #include <dev/ic/ad1848reg.h>
48 #include <dev/ic/ad1848var.h>
50 #include <amiga/dev/zbusvar.h>
51 #include <amiga/amiga/isr.h>
54 /* Register offsets. XXX All of this is guesswork. */
57 * The Toccata board consists of: GALs for ZBus AutoConfig(tm) glue, GALs
58 * that interface the FIFO chips and the audio codec chip to the ZBus,
59 * an AD1848 (or AD1845), and 2 Integrated Device Technology 7202LA
60 * (1024x9bit FIFO) chips.
63 #define TOCC_FIFO_STAT 0x1ffe
64 #define TOCC_FIFO_DATA 0x2000
67 * I don't know whether the AD1848 PIO data registers are connected... and
68 * at 2 or 3 accesses to read or write a data byte in the best case, I better
69 * don't even think about it. The AD1848 address/status and data port are
72 #define TOCC_CODEC_ADDR 0x67FF
73 #define TOCC_CODEC_STAT TOCC_CODEC_ADDR
74 #define TOCC_CODEC_REG 0x6801
76 /* fifo status bits, read */
78 #define TOCC_FIFO_INT 0x80 /* active low; together with one of those: */
80 #define TOCC_FIFO_PBHE 0x08 /* playback fifo is half empty (active high) */
81 #define TOCC_FIFO_CPHF 0x04 /* capture fifo is half full (active high) */
83 /* fifo status bits, write */
86 * seems to work like this:
87 * init: write 2; delay; write 1
89 * capture: write 1; write 1+4+8+0x40 (0x4D)
90 * capt. int: read 512 bytes out of fifo.
91 * capt. int off by writing 1+4+8 (0x0D)
93 * playback: write 1; write 1 + 0x10; (0x11)
94 * 3/4 fill fifo with silence; init codec;
95 * write 1+4+0x10+0x80 (0x95)
96 * pb int: write 512 bytes to fifo
97 * pb int off by writing 1+4+0x10 (0x15)
100 #define TOCC_RST 0x02
101 #define TOCC_ACT 0x01
102 #define TOCC_MAGIC 0x04
104 #define TOCC_PB_INTENA 0x80
105 #define TOCC_PB_FILL 0x10
107 #define TOCC_PB_PREP (TOCC_ACT + TOCC_PB_FILL)
108 #define TOCC_PB_TAIL (TOCC_PB_PREP + TOCC_MAGIC)
109 #define TOCC_PB_MAIN (TOCC_PB_TAIL + TOCC_PB_INTENA)
111 #define TOCC_CP_INTENA 0x40
112 #define TOCC_CP_RUN 0x08
114 #define TOCC_CP_TAIL (TOCC_ACT + TOCC_CP_RUN)
115 #define TOCC_CP_MAIN (TOCC_CP_TAIL + TOCC_CP_INTENA + TOCC_MAGIC)
118 * For the port stuff. Similar to the cs4231 table, but MONO is not wired
119 * on the Toccata, which was designed for the AD1848. Also we know how
123 #define TOCCATA_INPUT_CLASS 0
124 #define TOCCATA_OUTPUT_CLASS 1
125 #define TOCCATA_MONITOR_CLASS 2
126 #define TOCCATA_RECORD_CLASS 3
128 #define TOCCATA_RECORD_SOURCE 4
129 #define TOCCATA_REC_LVL 5
131 #define TOCCATA_MIC_IN_LVL 6
133 #define TOCCATA_AUX1_LVL 7
134 #define TOCCATA_AUX1_MUTE 8
136 #define TOCCATA_AUX2_LVL 9
137 #define TOCCATA_AUX2_MUTE 10
139 #define TOCCATA_MONITOR_LVL 11
140 #define TOCCATA_MONITOR_MUTE 12
141 #define TOCCATA_OUTPUT_LVL 13
143 /* only on AD1845 in mode 2 */
145 #define TOCCATA_LINE_IN_LVL 14
146 #define TOCCATA_LINE_IN_MUTE 15
148 /* special, need support */
149 #define TOCCATA_MIC_LVL 16
150 #define TOCCATA_MIC_MUTE 17
156 int toccata_intr(void *);
157 int toccata_readreg(struct ad1848_softc
*, int);
158 void toccata_writereg(struct ad1848_softc
*, int, int);
160 int toccata_round_blocksize(void *, int, int, const audio_params_t
*);
161 size_t toccata_round_buffersize(void *, int, size_t);
163 int toccata_open(void *, int);
164 void toccata_close(void *);
165 int toccata_getdev(void *, struct audio_device
*);
166 int toccata_get_props(void *);
168 int toccata_halt_input(void *);
169 int toccata_halt_output(void *);
170 int toccata_start_input(void *, void *, int, void (*)(void *), void *);
171 int toccata_start_output(void *, void *, int, void (*)(void *), void *);
173 /* I suspect those should be in a shared file */
174 int toccata_set_port(void *, mixer_ctrl_t
*);
175 int toccata_get_port(void *, mixer_ctrl_t
*);
176 int toccata_query_devinfo(void *, mixer_devinfo_t
*);
178 const struct audio_hw_if audiocs_hw_if
= {
182 * XXX toccata_drain could be written:
183 * sleep for play interrupt. This loses less then 512 bytes of
184 * sample data, otherwise up to 1024.
186 ad1848_query_encoding
,
188 toccata_round_blocksize
,
189 ad1848_commit_settings
,
190 0, /* init_output */ /* XXX need this to prefill? */
192 toccata_start_output
,
201 toccata_query_devinfo
,
204 toccata_round_buffersize
, /* round_buffer */
207 0, /* trigger_output */
211 struct toccata_softc
{
212 struct ad1848_softc sc_ad
;
214 volatile uint8_t *sc_boardp
; /* only need a few addresses! */
216 void (*sc_captmore
)(void *);
221 void (*sc_playmore
)(void *);
225 int toccata_match(struct device
*, struct cfdata
*, void *);
226 void toccata_attach(struct device
*, struct device
*, void *);
228 CFATTACH_DECL(toccata
, sizeof(struct toccata_softc
),
229 toccata_match
, toccata_attach
, NULL
, NULL
);
232 toccata_match(struct device
*parent
, struct cfdata
*cfp
, void *aux
)
234 struct zbus_args
*zap
;
238 if (zap
->manid
!= 18260)
241 if (zap
->prodid
!= 12)
248 toccata_attach(struct device
*parent
, struct device
*self
, void *aux
)
250 struct toccata_softc
*sc
;
251 struct ad1848_softc
*asc
;
252 struct zbus_args
*zap
;
253 volatile uint8_t *boardp
;
255 sc
= (struct toccata_softc
*)self
;
259 boardp
= (volatile uint8_t *)zap
->va
;
260 sc
->sc_boardp
= boardp
;
263 delay(500000); /* look up value */
267 asc
->sc_readreg
= toccata_readreg
;
268 asc
->sc_writereg
= toccata_writereg
;
270 asc
->chip_name
= "ad1848";
278 sc
->sc_isr
.isr_ipl
= 6;
279 sc
->sc_isr
.isr_arg
= sc
;
280 sc
->sc_isr
.isr_intr
= toccata_intr
;
281 add_isr(&sc
->sc_isr
);
283 audio_attach_mi(&audiocs_hw_if
, sc
, &asc
->sc_dev
);
287 /* interrupt handler */
289 toccata_intr(void *tag
) {
290 struct toccata_softc
*sc
;
292 volatile uint8_t *fifo
;
297 status
= *(sc
->sc_boardp
);
299 if (status
& TOCC_FIFO_INT
) /* active low */
302 if (status
& TOCC_FIFO_PBHE
) {
303 if (sc
->sc_playmore
) {
304 (*sc
->sc_playmore
)(sc
->sc_playarg
);
307 } else if (status
& TOCC_FIFO_CPHF
) {
308 if (sc
->sc_captbuf
) {
309 buf
= sc
->sc_captbuf
;
310 fifo
= sc
->sc_boardp
+ TOCC_FIFO_DATA
;
312 for (i
= sc
->sc_captbufsz
/4 - 1; i
>=0; --i
) {
319 /* XXX if (sc->sc_captmore) { */
320 (*sc
->sc_captmore
)(sc
->sc_captarg
);
326 * Something is wrong; switch interrupts off to avoid wedging the
327 * machine, and notify the alpha tester.
328 * Normally, the halt_* functions should have switched off the
332 printf("%s: got unexpected interrupt %x\n", sc
->sc_ad
.sc_dev
.dv_xname
,
335 *sc
->sc_boardp
= TOCC_ACT
;
339 /* support for ad1848 functions */
342 toccata_readreg(struct ad1848_softc
*asc
, int offset
)
344 struct toccata_softc
*sc
;
346 sc
= (struct toccata_softc
*)asc
;
347 return *(sc
->sc_boardp
+ TOCC_CODEC_ADDR
+
348 offset
* (TOCC_CODEC_REG
- TOCC_CODEC_ADDR
));
352 toccata_writereg(struct ad1848_softc
*asc
, int offset
, int value
)
354 struct toccata_softc
*sc
;
356 sc
= (struct toccata_softc
*)asc
;
357 *(sc
->sc_boardp
+ TOCC_CODEC_ADDR
+
358 offset
* (TOCC_CODEC_REG
- TOCC_CODEC_ADDR
)) = value
;
361 /* our own copy of open/close; we don't ever enable the ad1848 interrupts */
363 toccata_open(void *addr
, int flags
)
365 struct toccata_softc
*sc
;
366 struct ad1848_softc
*asc
;
371 asc
->open_mode
= flags
;
372 /* If recording && monitoring, the playback part is also used. */
373 if (flags
& FREAD
&& asc
->mute
[AD1848_MONITOR_CHANNEL
] == 0)
374 ad1848_mute_wave_output(asc
, WAVE_UNMUTE1
, 1);
378 ad1848_dump_regs(asc
);
385 toccata_close(void *addr
)
387 struct toccata_softc
*sc
;
388 struct ad1848_softc
*asc
;
395 ad1848_mute_wave_output(asc
, WAVE_UNMUTE1
, 0);
397 reg
= ad_read(&sc
->sc_ad
, SP_INTERFACE_CONFIG
);
398 ad_write(&sc
->sc_ad
, SP_INTERFACE_CONFIG
,
399 (reg
& ~(CAPTURE_ENABLE
|PLAYBACK_ENABLE
)));
401 /* Disable interrupts */
402 *sc
->sc_boardp
= TOCC_ACT
;
405 ad1848_dump_regs(asc
);
410 toccata_round_blocksize(void *addr
, int blk
,
411 int mode
, const audio_params_t
*param
)
415 ret
= blk
> 512 ? 512 : (blk
& -4);
421 toccata_round_buffersize(void *addr
, int direction
, size_t suggested
)
424 return suggested
& -4;
427 struct audio_device toccata_device
= {
428 "toccata", "x", "audio"
432 toccata_getdev(void *addr
, struct audio_device
*retp
)
435 *retp
= toccata_device
;
440 toccata_get_props(void *addr
)
446 toccata_halt_input(void *addr
)
448 struct toccata_softc
*sc
;
449 struct ad1848_softc
*asc
;
455 /* we're half_duplex; be brutal */
456 *sc
->sc_boardp
= TOCC_CP_TAIL
;
460 reg
= ad_read(&sc
->sc_ad
, SP_INTERFACE_CONFIG
);
461 ad_write(&sc
->sc_ad
, SP_INTERFACE_CONFIG
, (reg
& ~CAPTURE_ENABLE
));
467 toccata_start_input(void *addr
, void *block
, int blksize
,
468 void (*intr
)(void *), void *intrarg
)
470 struct toccata_softc
*sc
;
472 volatile uint8_t *cmd
;
477 if (sc
->sc_captmore
== 0) {
479 /* we're half-duplex, be brutal */
483 reg
= ad_read(&sc
->sc_ad
, SP_INTERFACE_CONFIG
);
484 ad_write(&sc
->sc_ad
, SP_INTERFACE_CONFIG
,
485 (reg
| CAPTURE_ENABLE
));
489 sc
->sc_captarg
= intrarg
;
490 sc
->sc_captmore
= intr
;
491 sc
->sc_captbuf
= (uint8_t *)block
;
492 sc
->sc_captbufsz
= blksize
;
498 toccata_halt_output(void *addr
)
500 struct toccata_softc
*sc
;
501 struct ad1848_softc
*asc
;
507 /* we're half_duplex; be brutal */
508 *sc
->sc_boardp
= TOCC_PB_TAIL
;
511 reg
= ad_read(&sc
->sc_ad
, SP_INTERFACE_CONFIG
);
512 ad_write(&sc
->sc_ad
, SP_INTERFACE_CONFIG
, (reg
& ~PLAYBACK_ENABLE
));
518 toccata_start_output(void *addr
, void *block
, int blksize
,
519 void (*intr
)(void*), void *intrarg
)
521 struct toccata_softc
*sc
;
524 volatile uint8_t *cmd
, *fifo
;
531 fifo
= sc
->sc_boardp
+ TOCC_FIFO_DATA
;
533 if (sc
->sc_playmore
== 0) {
539 * We rounded the blocksize to a multiple of 4 bytes. Modest
540 * unrolling saves 2% of cputime playing 48000 16bit stereo
544 for (i
= blksize
/4 - 1; i
>=0; --i
) {
551 if (sc
->sc_playmore
== 0) {
552 reg
= ad_read(&sc
->sc_ad
, SP_INTERFACE_CONFIG
);
553 ad_write(&sc
->sc_ad
, SP_INTERFACE_CONFIG
,
554 (reg
| PLAYBACK_ENABLE
));
556 /* we're half-duplex, be brutal */
557 *sc
->sc_boardp
= TOCC_PB_MAIN
;
560 sc
->sc_playarg
= intrarg
;
561 sc
->sc_playmore
= intr
;
566 static ad1848_devmap_t csmapping
[] = {
567 { TOCCATA_MIC_IN_LVL
, AD1848_KIND_MICGAIN
, -1 },
568 { TOCCATA_AUX1_LVL
, AD1848_KIND_LVL
, AD1848_AUX1_CHANNEL
},
569 { TOCCATA_AUX1_MUTE
, AD1848_KIND_MUTE
, AD1848_AUX1_CHANNEL
},
570 { TOCCATA_AUX2_LVL
, AD1848_KIND_LVL
, AD1848_AUX2_CHANNEL
},
571 { TOCCATA_AUX2_MUTE
, AD1848_KIND_MUTE
, AD1848_AUX2_CHANNEL
},
572 { TOCCATA_OUTPUT_LVL
, AD1848_KIND_LVL
, AD1848_DAC_CHANNEL
},
573 { TOCCATA_MONITOR_LVL
, AD1848_KIND_LVL
, AD1848_MONITOR_CHANNEL
},
574 { TOCCATA_MONITOR_MUTE
, AD1848_KIND_MUTE
, AD1848_MONITOR_CHANNEL
},
575 { TOCCATA_REC_LVL
, AD1848_KIND_RECORDGAIN
, -1 },
576 { TOCCATA_RECORD_SOURCE
, AD1848_KIND_RECORDSOURCE
, -1 },
577 /* only in mode 2: */
578 { TOCCATA_LINE_IN_LVL
, AD1848_KIND_LVL
, AD1848_LINE_CHANNEL
},
579 { TOCCATA_LINE_IN_MUTE
, AD1848_KIND_MUTE
, AD1848_LINE_CHANNEL
},
582 #define nummap (sizeof(csmapping) / sizeof(csmapping[0]))
585 toccata_set_port(void *addr
, mixer_ctrl_t
*cp
)
587 struct ad1848_softc
*ac
;
589 /* printf("set_port(%d)\n", cp->dev); */
591 return ad1848_mixer_set_port(ac
, csmapping
,
592 ac
->mode
== 2 ? nummap
: nummap
- 2, cp
);
596 toccata_get_port(void *addr
, mixer_ctrl_t
*cp
)
598 struct ad1848_softc
*ac
;
600 /* printf("get_port(%d)\n", cp->dev); */
602 return ad1848_mixer_get_port(ac
, csmapping
,
603 ac
->mode
== 2 ? nummap
: nummap
- 2, cp
);
607 toccata_query_devinfo(void *addr
, mixer_devinfo_t
*dip
)
611 case TOCCATA_MIC_IN_LVL
: /* Microphone */
612 dip
->type
= AUDIO_MIXER_VALUE
;
613 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
614 dip
->prev
= dip
->next
= AUDIO_MIXER_LAST
;
615 strcpy(dip
->label
.name
, AudioNmicrophone
);
616 dip
->un
.v
.num_channels
= 1;
617 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
621 case TOCCATA_MONO_LVL
: /* mono/microphone mixer */
622 dip
->type
= AUDIO_MIXER_VALUE
;
623 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
624 dip
->prev
= AUDIO_MIXER_LAST
;
625 dip
->next
= TOCCATA_MONO_MUTE
;
626 strcpy(dip
->label
.name
, AudioNmicrophone
);
627 dip
->un
.v
.num_channels
= 1;
628 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
632 case TOCCATA_AUX1_LVL
: /* dacout */
633 dip
->type
= AUDIO_MIXER_VALUE
;
634 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
635 dip
->prev
= AUDIO_MIXER_LAST
;
636 dip
->next
= TOCCATA_AUX1_MUTE
;
637 strcpy(dip
->label
.name
, "aux1");
638 dip
->un
.v
.num_channels
= 2;
639 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
642 case TOCCATA_AUX1_MUTE
:
643 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
644 dip
->type
= AUDIO_MIXER_ENUM
;
645 dip
->prev
= TOCCATA_AUX1_LVL
;
646 dip
->next
= AUDIO_MIXER_LAST
;
651 case TOCCATA_AUX2_LVL
:
652 dip
->type
= AUDIO_MIXER_VALUE
;
653 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
654 dip
->prev
= AUDIO_MIXER_LAST
;
655 dip
->next
= TOCCATA_AUX2_MUTE
;
656 strcpy(dip
->label
.name
, "aux2");
657 dip
->un
.v
.num_channels
= 2;
658 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
661 case TOCCATA_AUX2_MUTE
:
662 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
663 dip
->type
= AUDIO_MIXER_ENUM
;
664 dip
->prev
= TOCCATA_AUX2_LVL
;
665 dip
->next
= AUDIO_MIXER_LAST
;
669 case TOCCATA_MONITOR_LVL
: /* monitor level */
670 dip
->type
= AUDIO_MIXER_VALUE
;
671 dip
->mixer_class
= TOCCATA_MONITOR_CLASS
;
672 dip
->next
= TOCCATA_MONITOR_MUTE
;
673 dip
->prev
= AUDIO_MIXER_LAST
;
674 strcpy(dip
->label
.name
, AudioNmonitor
);
675 dip
->un
.v
.num_channels
= 1;
676 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
679 case TOCCATA_OUTPUT_LVL
: /* output volume */
680 dip
->type
= AUDIO_MIXER_VALUE
;
681 dip
->mixer_class
= TOCCATA_OUTPUT_CLASS
;
682 dip
->prev
= dip
->next
= AUDIO_MIXER_LAST
;
683 strcpy(dip
->label
.name
, AudioNmaster
);
684 dip
->un
.v
.num_channels
= 2;
685 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
688 case TOCCATA_LINE_IN_LVL
: /* line */
689 dip
->type
= AUDIO_MIXER_VALUE
;
690 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
691 dip
->prev
= AUDIO_MIXER_LAST
;
692 dip
->next
= TOCCATA_LINE_IN_MUTE
;
693 strcpy(dip
->label
.name
, AudioNline
);
694 dip
->un
.v
.num_channels
= 2;
695 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
698 case TOCCATA_LINE_IN_MUTE
:
699 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
700 dip
->type
= AUDIO_MIXER_ENUM
;
701 dip
->prev
= TOCCATA_LINE_IN_LVL
;
702 dip
->next
= AUDIO_MIXER_LAST
;
705 case TOCCATA_MONITOR_MUTE
:
706 dip
->mixer_class
= TOCCATA_MONITOR_CLASS
;
707 dip
->type
= AUDIO_MIXER_ENUM
;
708 dip
->prev
= TOCCATA_MONITOR_LVL
;
709 dip
->next
= AUDIO_MIXER_LAST
;
711 strcpy(dip
->label
.name
, AudioNmute
);
712 dip
->un
.e
.num_mem
= 2;
713 strcpy(dip
->un
.e
.member
[0].label
.name
, AudioNoff
);
714 dip
->un
.e
.member
[0].ord
= 0;
715 strcpy(dip
->un
.e
.member
[1].label
.name
, AudioNon
);
716 dip
->un
.e
.member
[1].ord
= 1;
719 case TOCCATA_REC_LVL
: /* record level */
720 dip
->type
= AUDIO_MIXER_VALUE
;
721 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
722 dip
->prev
= AUDIO_MIXER_LAST
;
723 dip
->next
= TOCCATA_RECORD_SOURCE
;
724 strcpy(dip
->label
.name
, AudioNrecord
);
725 dip
->un
.v
.num_channels
= 2;
726 strcpy(dip
->un
.v
.units
.name
, AudioNvolume
);
729 case TOCCATA_RECORD_SOURCE
:
730 dip
->mixer_class
= TOCCATA_RECORD_CLASS
;
731 dip
->type
= AUDIO_MIXER_ENUM
;
732 dip
->prev
= TOCCATA_REC_LVL
;
733 dip
->next
= AUDIO_MIXER_LAST
;
734 strcpy(dip
->label
.name
, AudioNsource
);
735 dip
->un
.e
.num_mem
= 4;
736 strcpy(dip
->un
.e
.member
[0].label
.name
, AudioNmicrophone
);
737 dip
->un
.e
.member
[1].ord
= MIC_IN_PORT
;
738 strcpy(dip
->un
.e
.member
[1].label
.name
, AudioNline
);
739 dip
->un
.e
.member
[3].ord
= LINE_IN_PORT
;
740 strcpy(dip
->un
.e
.member
[2].label
.name
, "aux1");
741 dip
->un
.e
.member
[2].ord
= AUX1_IN_PORT
;
742 strcpy(dip
->un
.e
.member
[3].label
.name
, AudioNoutput
);
743 dip
->un
.e
.member
[0].ord
= DAC_IN_PORT
;
746 case TOCCATA_INPUT_CLASS
: /* input class descriptor */
747 dip
->type
= AUDIO_MIXER_CLASS
;
748 dip
->mixer_class
= TOCCATA_INPUT_CLASS
;
749 dip
->next
= dip
->prev
= AUDIO_MIXER_LAST
;
750 strcpy(dip
->label
.name
, AudioCinputs
);
753 case TOCCATA_OUTPUT_CLASS
: /* output class descriptor */
754 dip
->type
= AUDIO_MIXER_CLASS
;
755 dip
->mixer_class
= TOCCATA_OUTPUT_CLASS
;
756 dip
->next
= dip
->prev
= AUDIO_MIXER_LAST
;
757 strcpy(dip
->label
.name
, AudioCoutputs
);
760 case TOCCATA_MONITOR_CLASS
: /* monitor class descriptor */
761 dip
->type
= AUDIO_MIXER_CLASS
;
762 dip
->mixer_class
= TOCCATA_MONITOR_CLASS
;
763 dip
->next
= dip
->prev
= AUDIO_MIXER_LAST
;
764 strcpy(dip
->label
.name
, AudioCmonitor
);
767 case TOCCATA_RECORD_CLASS
: /* record source class */
768 dip
->type
= AUDIO_MIXER_CLASS
;
769 dip
->mixer_class
= TOCCATA_RECORD_CLASS
;
770 dip
->next
= dip
->prev
= AUDIO_MIXER_LAST
;
771 strcpy(dip
->label
.name
, AudioCrecord
);