xref: /titanic_51/usr/src/uts/common/sys/usb/clients/audio/usb_mixer.h (revision 643918928169438203a594dfc3fc1b3e9afe5ba3)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_USB_MIXER_H
27 #define	_SYS_USB_MIXER_H
28 
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #define	USB_AUDIO_MIXER_REGISTRATION	1
36 
37 /* Valid for the current alternate */
38 typedef struct usb_audio_formats {
39 	uchar_t		fmt_alt;	/* current alternate */
40 	uchar_t		fmt_chns;	/* 1-255 */
41 	uchar_t		fmt_precision;	/* 8, 16, 24, or 32 */
42 	uchar_t		fmt_encoding;	/* AUDIO_ENCODING_LINEAR, etc. */
43 	uchar_t		fmt_termlink;	/* for feature unit */
44 	uchar_t		fmt_n_srs;	/* number of sample rates */
45 	uint_t		*fmt_srs;	/* same as alt_sample_rates */
46 } usb_audio_formats_t;
47 
48 _NOTE(SCHEME_PROTECTS_DATA("unshared", usb_audio_formats))
49 
50 
51 typedef struct usb_audio_play_req {
52 	int 		up_samples;
53 	void		*up_handle;
54 } usb_audio_play_req_t;
55 
56 #define	USB_AS_N_FORMATS	20
57 
58 typedef struct usb_as_registration {
59 	uchar_t			reg_valid;
60 	uchar_t			reg_mode;	/* play or record */
61 	uchar_t			reg_n_formats;
62 	int			reg_ifno;
63 	usb_audio_formats_t	reg_formats[USB_AS_N_FORMATS];
64 } usb_as_registration_t;
65 
66 /* MCTLs between usb_ac and usb_as */
67 #define	USB_AUDIO_SETUP			0x0100
68 #define	USB_AUDIO_TEARDOWN		0x0200
69 #define	USB_AUDIO_START_PLAY		0x0300
70 #define	USB_AUDIO_STOP_PLAY		0x0400
71 #define	USB_AUDIO_PAUSE_PLAY		0x0500
72 #define	USB_AUDIO_START_RECORD		0x0600
73 #define	USB_AUDIO_STOP_RECORD		0x0700
74 #define	USB_AUDIO_SET_FORMAT		0x0800
75 #define	USB_AUDIO_SET_SAMPLE_FREQ	0x0900
76 
77 /* MCTLs between usb_ac and usb_ah */
78 #define	USB_AUDIO_VOL_CHANGE		0x1
79 #define	USB_AUDIO_BALANCE		0x2
80 #define	USB_AUDIO_MUTE			0x3
81 #define	USB_AUDIO_BASS			0x4
82 #define	USB_AUDIO_TREBLE		0x5
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif	/* _SYS_USB_MIXER_H */
89