temp revert rk change
[firefly-linux-kernel-4.4.55.git] / include / linux / cpcap_audio.h
1 /* include/linux/cpcap_audio.h
2  *
3  * Copyright (C) 2010 Google, Inc.
4  *
5  * Author:
6  *     Iliyan Malchev <malchev@google.com>
7  *
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.
11  *
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.
16  *
17  */
18
19 #ifndef _CPCAP_AUDIO_H
20 #define _CPCAP_AUDIO_H
21
22 #include <linux/ioctl.h>
23
24 #define CPCAP_AUDIO_MAGIC 'c'
25
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
32
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 */
36 };
37
38 #define CPCAP_AUDIO_OUT_SET_OUTPUT _IOW(CPCAP_AUDIO_MAGIC, 0, \
39                         const struct cpcap_audio_stream *)
40
41 #define CPCAP_AUDIO_OUT_VOL_MIN 0
42 #define CPCAP_AUDIO_OUT_VOL_MAX 15
43
44 #define CPCAP_AUDIO_OUT_SET_VOLUME _IOW(CPCAP_AUDIO_MAGIC, 1, unsigned int)
45
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 *)
50
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
55
56 #define CPCAP_AUDIO_IN_SET_INPUT   _IOW(CPCAP_AUDIO_MAGIC, 4, \
57                         const struct cpcap_audio_stream *)
58
59 #define CPCAP_AUDIO_IN_GET_INPUT   _IOR(CPCAP_AUDIO_MAGIC, 5, \
60                         struct cpcap_audio_stream *)
61
62 #define CPCAP_AUDIO_IN_VOL_MIN 0
63 #define CPCAP_AUDIO_IN_VOL_MAX 31
64
65 #define CPCAP_AUDIO_IN_SET_VOLUME  _IOW(CPCAP_AUDIO_MAGIC, 6, unsigned int)
66
67 #define CPCAP_AUDIO_IN_GET_VOLUME  _IOR(CPCAP_AUDIO_MAGIC, 7, unsigned int *)
68
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)
73
74 #define CPCAP_AUDIO_SET_BLUETOOTH_BYPASS _IOW(CPCAP_AUDIO_MAGIC, 12, unsigned int)
75
76 #endif/*_CPCAP_AUDIO_H*/