Ensure FMODE_NONOTIFY is not set by userspace
[pandora-kernel.git] / drivers / staging / dream / include / linux / msm_audio.h
1 /* drivers/staging/dream/include/linux/msm_audio.h
2  *
3  * Copyright (C) 2008 Google, Inc.
4  *
5  * This software is licensed under the terms of the GNU General Public
6  * License version 2, as published by the Free Software Foundation, and
7  * may be copied, distributed, and modified under those terms.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  */
15
16 #ifndef __LINUX_MSM_AUDIO_H
17 #define __LINUX_MSM_AUDIO_H
18
19 #include <linux/types.h>
20 #include <linux/ioctl.h>
21 #include <asm/sizes.h>
22
23 /* PCM Audio */
24
25 #define AUDIO_IOCTL_MAGIC 'a'
26
27 #define AUDIO_START        _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned)
28 #define AUDIO_STOP         _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned)
29 #define AUDIO_FLUSH        _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned)
30 #define AUDIO_GET_CONFIG   _IOR(AUDIO_IOCTL_MAGIC, 3, unsigned)
31 #define AUDIO_SET_CONFIG   _IOW(AUDIO_IOCTL_MAGIC, 4, unsigned)
32 #define AUDIO_GET_STATS    _IOR(AUDIO_IOCTL_MAGIC, 5, unsigned)
33 #define AUDIO_ENABLE_AUDPP _IOW(AUDIO_IOCTL_MAGIC, 6, unsigned)
34 #define AUDIO_SET_ADRC     _IOW(AUDIO_IOCTL_MAGIC, 7, unsigned)
35 #define AUDIO_SET_EQ       _IOW(AUDIO_IOCTL_MAGIC, 8, unsigned)
36 #define AUDIO_SET_RX_IIR   _IOW(AUDIO_IOCTL_MAGIC, 9, unsigned)
37 #define AUDIO_SET_VOLUME   _IOW(AUDIO_IOCTL_MAGIC, 10, unsigned)
38 #define AUDIO_ENABLE_AUDPRE  _IOW(AUDIO_IOCTL_MAGIC, 11, unsigned)
39 #define AUDIO_SET_AGC        _IOW(AUDIO_IOCTL_MAGIC, 12, unsigned)
40 #define AUDIO_SET_NS         _IOW(AUDIO_IOCTL_MAGIC, 13, unsigned)
41 #define AUDIO_SET_TX_IIR     _IOW(AUDIO_IOCTL_MAGIC, 14, unsigned)
42 #define AUDIO_PAUSE          _IOW(AUDIO_IOCTL_MAGIC, 15, unsigned)
43 #define AUDIO_GET_PCM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 30, unsigned)
44 #define AUDIO_SET_PCM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 31, unsigned)
45 #define AUDIO_SWITCH_DEVICE  _IOW(AUDIO_IOCTL_MAGIC, 32, unsigned)
46
47 #define AUDIO_MAX_COMMON_IOCTL_NUM      100
48
49 #define AUDIO_MAX_COMMON_IOCTL_NUM      100
50
51 struct msm_audio_config {
52         uint32_t buffer_size;
53         uint32_t buffer_count;
54         uint32_t channel_count;
55         uint32_t sample_rate;
56         uint32_t type;
57         uint32_t unused[3];
58 };
59
60 struct msm_audio_stats {
61         uint32_t byte_count;
62         uint32_t sample_count;
63         uint32_t unused[2];
64 };
65
66 /* Audio routing */
67
68 #define SND_IOCTL_MAGIC 's'
69
70 #define SND_MUTE_UNMUTED 0
71 #define SND_MUTE_MUTED   1
72
73 struct msm_snd_device_config {
74         uint32_t device;
75         uint32_t ear_mute;
76         uint32_t mic_mute;
77 };
78
79 #define SND_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_device_config *)
80
81 #define SND_METHOD_VOICE 0
82
83 struct msm_snd_volume_config {
84         uint32_t device;
85         uint32_t method;
86         uint32_t volume;
87 };
88
89 #define SND_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_snd_volume_config *)
90
91 /* Returns the number of SND endpoints supported. */
92
93 #define SND_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned *)
94
95 struct msm_snd_endpoint {
96         int id; /* input and output */
97         char name[64]; /* output only */
98 };
99
100 /* Takes an index between 0 and one less than the number returned by
101  * SND_GET_NUM_ENDPOINTS, and returns the SND index and name of a
102  * SND endpoint.  On input, the .id field contains the number of the
103  * endpoint, and on exit it contains the SND index, while .name contains
104  * the description of the endpoint.
105  */
106
107 #define SND_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_snd_endpoint *)
108
109 struct msm_audio_pcm_config {
110         uint32_t pcm_feedback;  /* 0 - disable > 0 - enable */
111         uint32_t buffer_count;  /* Number of buffers to allocate */
112         uint32_t buffer_size;   /* Size of buffer for capturing of
113                                    PCM samples */
114 };
115 #endif