1 /* include/linux/cpcap_audio.h
3 * Copyright (C) 2010 Google, Inc.
6 * Iliyan Malchev <malchev@google.com>
8 * This software is licensed under the terms of the GNU General Public
9 * License version 2, as published by the Free Software Foundation, and
10 * may be copied, distributed, and modified under those terms.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
19 #ifndef _CPCAP_AUDIO_H
20 #define _CPCAP_AUDIO_H
22 #include <linux/ioctl.h>
24 #define CPCAP_AUDIO_MAGIC 'c'
26 #define CPCAP_AUDIO_OUT_SPEAKER 0
27 #define CPCAP_AUDIO_OUT_HEADSET 1
28 #define CPCAP_AUDIO_OUT_HEADSET_AND_SPEAKER 2
29 #define CPCAP_AUDIO_OUT_STANDBY 3
30 #define CPCAP_AUDIO_OUT_ANLG_DOCK_HEADSET 4
31 #define CPCAP_AUDIO_OUT_MAX 4
33 struct cpcap_audio_stream {
34 unsigned id; /* e.g., CPCAP_AUDIO_OUT_SPEAKER or CPCAP_AUDIO_IN_MIC1 */
35 int on; /* enable/disable for output, unmute/mute for input */
38 #define CPCAP_AUDIO_OUT_SET_OUTPUT _IOW(CPCAP_AUDIO_MAGIC, 0, \
39 const struct cpcap_audio_stream *)
41 #define CPCAP_AUDIO_OUT_VOL_MIN 0
42 #define CPCAP_AUDIO_OUT_VOL_MAX 15
44 #define CPCAP_AUDIO_OUT_SET_VOLUME _IOW(CPCAP_AUDIO_MAGIC, 1, unsigned int)
46 #define CPCAP_AUDIO_OUT_GET_OUTPUT \
47 _IOR(CPCAP_AUDIO_MAGIC, 2, struct cpcap_audio_stream *)
48 #define CPCAP_AUDIO_OUT_GET_VOLUME \
49 _IOR(CPCAP_AUDIO_MAGIC, 3, unsigned int *)
51 #define CPCAP_AUDIO_IN_MIC1 0
52 #define CPCAP_AUDIO_IN_MIC2 1
53 #define CPCAP_AUDIO_IN_STANDBY 2
54 #define CPCAP_AUDIO_IN_MAX 2
56 #define CPCAP_AUDIO_IN_SET_INPUT _IOW(CPCAP_AUDIO_MAGIC, 4, \
57 const struct cpcap_audio_stream *)
59 #define CPCAP_AUDIO_IN_GET_INPUT _IOR(CPCAP_AUDIO_MAGIC, 5, \
60 struct cpcap_audio_stream *)
62 #define CPCAP_AUDIO_IN_VOL_MIN 0
63 #define CPCAP_AUDIO_IN_VOL_MAX 31
65 #define CPCAP_AUDIO_IN_SET_VOLUME _IOW(CPCAP_AUDIO_MAGIC, 6, unsigned int)
67 #define CPCAP_AUDIO_IN_GET_VOLUME _IOR(CPCAP_AUDIO_MAGIC, 7, unsigned int *)
69 #define CPCAP_AUDIO_OUT_GET_RATE _IOR(CPCAP_AUDIO_MAGIC, 8, unsigned int *)
70 #define CPCAP_AUDIO_OUT_SET_RATE _IOW(CPCAP_AUDIO_MAGIC, 9, unsigned int)
71 #define CPCAP_AUDIO_IN_GET_RATE _IOR(CPCAP_AUDIO_MAGIC, 10, unsigned int *)
72 #define CPCAP_AUDIO_IN_SET_RATE _IOW(CPCAP_AUDIO_MAGIC, 11, unsigned int)
74 #define CPCAP_AUDIO_SET_BLUETOOTH_BYPASS _IOW(CPCAP_AUDIO_MAGIC, 12, unsigned int)
76 #endif/*_CPCAP_AUDIO_H*/