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;	/* MONO or STEREO */
41 	uchar_t		fmt_precision;	/* 8 or 16 */
42 	uchar_t		fmt_encoding;	/* AUDIO_ENCODING_LINEAR, etc. */
43 	uchar_t		fmt_termlink;	/* for feature unit */
44 	uint_t		fmt_sr;		/* current sample rate */
45 } usb_audio_formats_t;
46 
47 _NOTE(SCHEME_PROTECTS_DATA("unshared", usb_audio_formats))
48 
49 
50 typedef struct usb_audio_play_req {
51 	int 		up_samples;
52 	void		*up_handle;
53 } usb_audio_play_req_t;
54 
55 #define	USB_AS_N_SRS		20
56 #define	USB_AS_N_FORMATS	20
57 #define	USB_AS_N_CHANNELS	3
58 
59 typedef struct usb_as_registration {
60 	uchar_t			reg_valid;
61 	uchar_t			reg_mode;	/* play or record */
62 	uchar_t			reg_n_formats;
63 	int			reg_ifno;
64 	uint_t			reg_srs[USB_AS_N_SRS];
65 	usb_audio_formats_t	reg_formats[USB_AS_N_FORMATS];
66 	uint_t			reg_channels[USB_AS_N_CHANNELS];
67 } usb_as_registration_t;
68 
69 /* MCTLs between usb_ac and usb_as */
70 #define	USB_AUDIO_SETUP			0x0100
71 #define	USB_AUDIO_TEARDOWN		0x0200
72 #define	USB_AUDIO_START_PLAY		0x0300
73 #define	USB_AUDIO_STOP_PLAY		0x0400
74 #define	USB_AUDIO_PAUSE_PLAY		0x0500
75 #define	USB_AUDIO_START_RECORD		0x0600
76 #define	USB_AUDIO_STOP_RECORD		0x0700
77 #define	USB_AUDIO_SET_FORMAT		0x0800
78 #define	USB_AUDIO_SET_SAMPLE_FREQ	0x0900
79 
80 /* MCTLs between usb_ac and usb_ah */
81 #define	USB_AUDIO_VOL_CHANGE		0x1
82 #define	USB_AUDIO_BALANCE		0x2
83 #define	USB_AUDIO_MUTE			0x3
84 #define	USB_AUDIO_BASS			0x4
85 #define	USB_AUDIO_TREBLE		0x5
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif	/* _SYS_USB_MIXER_H */
92