1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _LINUX_MSM_AUDIO_H 20 #define _LINUX_MSM_AUDIO_H 21 #include <linux/types.h> 22 #include <linux/ioctl.h> 23 #define AUDIO_IOCTL_MAGIC 'a' 24 #define AUDIO_START _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned int) 25 #define AUDIO_STOP _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned int) 26 #define AUDIO_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned int) 27 #define AUDIO_GET_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 3, struct msm_audio_config) 28 #define AUDIO_SET_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 4, struct msm_audio_config) 29 #define AUDIO_GET_STATS _IOR(AUDIO_IOCTL_MAGIC, 5, struct msm_audio_stats) 30 #define AUDIO_ENABLE_AUDPP _IOW(AUDIO_IOCTL_MAGIC, 6, unsigned int) 31 #define AUDIO_SET_ADRC _IOW(AUDIO_IOCTL_MAGIC, 7, unsigned int) 32 #define AUDIO_SET_EQ _IOW(AUDIO_IOCTL_MAGIC, 8, unsigned int) 33 #define AUDIO_SET_RX_IIR _IOW(AUDIO_IOCTL_MAGIC, 9, unsigned int) 34 #define AUDIO_SET_VOLUME _IOW(AUDIO_IOCTL_MAGIC, 10, unsigned int) 35 #define AUDIO_PAUSE _IOW(AUDIO_IOCTL_MAGIC, 11, unsigned int) 36 #define AUDIO_PLAY_DTMF _IOW(AUDIO_IOCTL_MAGIC, 12, unsigned int) 37 #define AUDIO_GET_EVENT _IOR(AUDIO_IOCTL_MAGIC, 13, struct msm_audio_event) 38 #define AUDIO_ABORT_GET_EVENT _IOW(AUDIO_IOCTL_MAGIC, 14, unsigned int) 39 #define AUDIO_REGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 15, unsigned int) 40 #define AUDIO_DEREGISTER_PMEM _IOW(AUDIO_IOCTL_MAGIC, 16, unsigned int) 41 #define AUDIO_ASYNC_WRITE _IOW(AUDIO_IOCTL_MAGIC, 17, struct msm_audio_aio_buf) 42 #define AUDIO_ASYNC_READ _IOW(AUDIO_IOCTL_MAGIC, 18, struct msm_audio_aio_buf) 43 #define AUDIO_SET_INCALL _IOW(AUDIO_IOCTL_MAGIC, 19, struct msm_voicerec_mode) 44 #define AUDIO_GET_NUM_SND_DEVICE _IOR(AUDIO_IOCTL_MAGIC, 20, unsigned int) 45 #define AUDIO_GET_SND_DEVICES _IOWR(AUDIO_IOCTL_MAGIC, 21, struct msm_snd_device_list) 46 #define AUDIO_ENABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 22, unsigned int) 47 #define AUDIO_DISABLE_SND_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 23, unsigned int) 48 #define AUDIO_ROUTE_STREAM _IOW(AUDIO_IOCTL_MAGIC, 24, struct msm_audio_route_config) 49 #define AUDIO_GET_PCM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 30, unsigned int) 50 #define AUDIO_SET_PCM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 31, unsigned int) 51 #define AUDIO_SWITCH_DEVICE _IOW(AUDIO_IOCTL_MAGIC, 32, unsigned int) 52 #define AUDIO_SET_MUTE _IOW(AUDIO_IOCTL_MAGIC, 33, unsigned int) 53 #define AUDIO_UPDATE_ACDB _IOW(AUDIO_IOCTL_MAGIC, 34, unsigned int) 54 #define AUDIO_START_VOICE _IOW(AUDIO_IOCTL_MAGIC, 35, unsigned int) 55 #define AUDIO_STOP_VOICE _IOW(AUDIO_IOCTL_MAGIC, 36, unsigned int) 56 #define AUDIO_REINIT_ACDB _IOW(AUDIO_IOCTL_MAGIC, 39, unsigned int) 57 #define AUDIO_OUTPORT_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 40, unsigned short) 58 #define AUDIO_SET_ERR_THRESHOLD_VALUE _IOW(AUDIO_IOCTL_MAGIC, 41, unsigned short) 59 #define AUDIO_GET_BITSTREAM_ERROR_INFO _IOR(AUDIO_IOCTL_MAGIC, 42, struct msm_audio_bitstream_error_info) 60 #define AUDIO_SET_SRS_TRUMEDIA_PARAM _IOW(AUDIO_IOCTL_MAGIC, 43, unsigned int) 61 #define AUDIO_SET_STREAM_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 80, struct msm_audio_stream_config) 62 #define AUDIO_GET_STREAM_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 81, struct msm_audio_stream_config) 63 #define AUDIO_GET_SESSION_ID _IOR(AUDIO_IOCTL_MAGIC, 82, unsigned short) 64 #define AUDIO_GET_STREAM_INFO _IOR(AUDIO_IOCTL_MAGIC, 83, struct msm_audio_bitstream_info) 65 #define AUDIO_SET_PAN _IOW(AUDIO_IOCTL_MAGIC, 84, unsigned int) 66 #define AUDIO_SET_QCONCERT_PLUS _IOW(AUDIO_IOCTL_MAGIC, 85, unsigned int) 67 #define AUDIO_SET_MBADRC _IOW(AUDIO_IOCTL_MAGIC, 86, unsigned int) 68 #define AUDIO_SET_VOLUME_PATH _IOW(AUDIO_IOCTL_MAGIC, 87, struct msm_vol_info) 69 #define AUDIO_SET_MAX_VOL_ALL _IOW(AUDIO_IOCTL_MAGIC, 88, unsigned int) 70 #define AUDIO_ENABLE_AUDPRE _IOW(AUDIO_IOCTL_MAGIC, 89, unsigned int) 71 #define AUDIO_SET_AGC _IOW(AUDIO_IOCTL_MAGIC, 90, unsigned int) 72 #define AUDIO_SET_NS _IOW(AUDIO_IOCTL_MAGIC, 91, unsigned int) 73 #define AUDIO_SET_TX_IIR _IOW(AUDIO_IOCTL_MAGIC, 92, unsigned int) 74 #define AUDIO_GET_BUF_CFG _IOW(AUDIO_IOCTL_MAGIC, 93, struct msm_audio_buf_cfg) 75 #define AUDIO_SET_BUF_CFG _IOW(AUDIO_IOCTL_MAGIC, 94, struct msm_audio_buf_cfg) 76 #define AUDIO_SET_ACDB_BLK _IOW(AUDIO_IOCTL_MAGIC, 95, struct msm_acdb_cmd_device) 77 #define AUDIO_GET_ACDB_BLK _IOW(AUDIO_IOCTL_MAGIC, 96, struct msm_acdb_cmd_device) 78 #define AUDIO_REGISTER_ION _IOW(AUDIO_IOCTL_MAGIC, 97, struct msm_audio_ion_info) 79 #define AUDIO_DEREGISTER_ION _IOW(AUDIO_IOCTL_MAGIC, 98, struct msm_audio_ion_info) 80 #define AUDIO_SET_EFFECTS_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 99, struct msm_hwacc_effects_config) 81 #define AUDIO_EFFECTS_SET_BUF_LEN _IOW(AUDIO_IOCTL_MAGIC, 100, struct msm_hwacc_buf_cfg) 82 #define AUDIO_EFFECTS_GET_BUF_AVAIL _IOW(AUDIO_IOCTL_MAGIC, 101, struct msm_hwacc_buf_avail) 83 #define AUDIO_EFFECTS_WRITE _IOW(AUDIO_IOCTL_MAGIC, 102, void *) 84 #define AUDIO_EFFECTS_READ _IOWR(AUDIO_IOCTL_MAGIC, 103, void *) 85 #define AUDIO_EFFECTS_SET_PP_PARAMS _IOW(AUDIO_IOCTL_MAGIC, 104, void *) 86 #define AUDIO_PM_AWAKE _IOW(AUDIO_IOCTL_MAGIC, 105, unsigned int) 87 #define AUDIO_PM_RELAX _IOW(AUDIO_IOCTL_MAGIC, 106, unsigned int) 88 #define AUDIO_MAX_COMMON_IOCTL_NUM 107 89 #define HANDSET_MIC 0x01 90 #define HANDSET_SPKR 0x02 91 #define HEADSET_MIC 0x03 92 #define HEADSET_SPKR_MONO 0x04 93 #define HEADSET_SPKR_STEREO 0x05 94 #define SPKR_PHONE_MIC 0x06 95 #define SPKR_PHONE_MONO 0x07 96 #define SPKR_PHONE_STEREO 0x08 97 #define BT_SCO_MIC 0x09 98 #define BT_SCO_SPKR 0x0A 99 #define BT_A2DP_SPKR 0x0B 100 #define TTY_HEADSET_MIC 0x0C 101 #define TTY_HEADSET_SPKR 0x0D 102 #define DEFAULT_TX 0x0E 103 #define DEFAULT_RX 0x0F 104 #define BT_A2DP_TX 0x10 105 #define HEADSET_MONO_PLUS_SPKR_MONO_RX 0x11 106 #define HEADSET_MONO_PLUS_SPKR_STEREO_RX 0x12 107 #define HEADSET_STEREO_PLUS_SPKR_MONO_RX 0x13 108 #define HEADSET_STEREO_PLUS_SPKR_STEREO_RX 0x14 109 #define I2S_RX 0x20 110 #define I2S_TX 0x21 111 #define ADRC_ENABLE 0x0001 112 #define EQUALIZER_ENABLE 0x0002 113 #define IIR_ENABLE 0x0004 114 #define QCONCERT_PLUS_ENABLE 0x0008 115 #define MBADRC_ENABLE 0x0010 116 #define SRS_ENABLE 0x0020 117 #define SRS_DISABLE 0x0040 118 #define AGC_ENABLE 0x0001 119 #define NS_ENABLE 0x0002 120 #define TX_IIR_ENABLE 0x0004 121 #define FLUENCE_ENABLE 0x0008 122 #define VOC_REC_UPLINK 0x00 123 #define VOC_REC_DOWNLINK 0x01 124 #define VOC_REC_BOTH 0x02 125 struct msm_audio_config { 126 uint32_t buffer_size; 127 uint32_t buffer_count; 128 uint32_t channel_count; 129 uint32_t sample_rate; 130 uint32_t type; 131 uint32_t meta_field; 132 uint32_t bits; 133 uint32_t unused[3]; 134 }; 135 struct msm_audio_stream_config { 136 uint32_t buffer_size; 137 uint32_t buffer_count; 138 }; 139 struct msm_audio_buf_cfg { 140 uint32_t meta_info_enable; 141 uint32_t frames_per_buf; 142 }; 143 struct msm_audio_stats { 144 uint32_t byte_count; 145 uint32_t sample_count; 146 uint32_t unused[2]; 147 }; 148 struct msm_audio_ion_info { 149 int fd; 150 void * vaddr; 151 }; 152 struct msm_audio_pmem_info { 153 int fd; 154 void * vaddr; 155 }; 156 struct msm_audio_aio_buf { 157 void * buf_addr; 158 uint32_t buf_len; 159 uint32_t data_len; 160 void * private_data; 161 unsigned short mfield_sz; 162 }; 163 #define SND_IOCTL_MAGIC 's' 164 #define SND_MUTE_UNMUTED 0 165 #define SND_MUTE_MUTED 1 166 struct msm_mute_info { 167 uint32_t mute; 168 uint32_t path; 169 }; 170 struct msm_vol_info { 171 uint32_t vol; 172 uint32_t path; 173 }; 174 struct msm_voicerec_mode { 175 uint32_t rec_mode; 176 }; 177 struct msm_snd_device_config { 178 uint32_t device; 179 uint32_t ear_mute; 180 uint32_t mic_mute; 181 }; 182 #define SND_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_device_config *) 183 enum cad_device_path_type { 184 CAD_DEVICE_PATH_RX, 185 CAD_DEVICE_PATH_TX, 186 CAD_DEVICE_PATH_RX_TX, 187 CAD_DEVICE_PATH_LB, 188 CAD_DEVICE_PATH_MAX 189 }; 190 struct cad_devices_type { 191 uint32_t rx_device; 192 uint32_t tx_device; 193 enum cad_device_path_type pathtype; 194 }; 195 struct msm_cad_device_config { 196 struct cad_devices_type device; 197 uint32_t ear_mute; 198 uint32_t mic_mute; 199 }; 200 #define CAD_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_cad_device_config *) 201 #define SND_METHOD_VOICE 0 202 #define SND_METHOD_MIDI 4 203 struct msm_snd_volume_config { 204 uint32_t device; 205 uint32_t method; 206 uint32_t volume; 207 }; 208 #define SND_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_snd_volume_config *) 209 struct msm_cad_volume_config { 210 struct cad_devices_type device; 211 uint32_t method; 212 uint32_t volume; 213 }; 214 #define CAD_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_cad_volume_config *) 215 #define SND_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned int *) 216 struct msm_snd_endpoint { 217 int id; 218 char name[64]; 219 }; 220 #define SND_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_snd_endpoint *) 221 #define SND_AVC_CTL _IOW(SND_IOCTL_MAGIC, 6, unsigned int *) 222 #define SND_AGC_CTL _IOW(SND_IOCTL_MAGIC, 7, unsigned int *) 223 #define CAD_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned int *) 224 struct msm_cad_endpoint { 225 int id; 226 char name[64]; 227 }; 228 #define CAD_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_cad_endpoint *) 229 struct msm_audio_pcm_config { 230 uint32_t pcm_feedback; 231 uint32_t buffer_count; 232 uint32_t buffer_size; 233 }; 234 #define AUDIO_EVENT_SUSPEND 0 235 #define AUDIO_EVENT_RESUME 1 236 #define AUDIO_EVENT_WRITE_DONE 2 237 #define AUDIO_EVENT_READ_DONE 3 238 #define AUDIO_EVENT_STREAM_INFO 4 239 #define AUDIO_EVENT_BITSTREAM_ERROR_INFO 5 240 #define AUDIO_CODEC_TYPE_MP3 0 241 #define AUDIO_CODEC_TYPE_AAC 1 242 struct msm_audio_bitstream_info { 243 uint32_t codec_type; 244 uint32_t chan_info; 245 uint32_t sample_rate; 246 uint32_t bit_stream_info; 247 uint32_t bit_rate; 248 uint32_t unused[3]; 249 }; 250 struct msm_audio_bitstream_error_info { 251 uint32_t dec_id; 252 uint32_t err_msg_indicator; 253 uint32_t err_type; 254 }; 255 union msm_audio_event_payload { 256 struct msm_audio_aio_buf aio_buf; 257 struct msm_audio_bitstream_info stream_info; 258 struct msm_audio_bitstream_error_info error_info; 259 int reserved; 260 }; 261 struct msm_audio_event { 262 int event_type; 263 int timeout_ms; 264 union msm_audio_event_payload event_payload; 265 }; 266 #define MSM_SNDDEV_CAP_RX 0x1 267 #define MSM_SNDDEV_CAP_TX 0x2 268 #define MSM_SNDDEV_CAP_VOICE 0x4 269 struct msm_snd_device_info { 270 uint32_t dev_id; 271 uint32_t dev_cap; 272 char dev_name[64]; 273 }; 274 struct msm_snd_device_list { 275 uint32_t num_dev; 276 struct msm_snd_device_info * list; 277 }; 278 struct msm_dtmf_config { 279 uint16_t path; 280 uint16_t dtmf_hi; 281 uint16_t dtmf_low; 282 uint16_t duration; 283 uint16_t tx_gain; 284 uint16_t rx_gain; 285 uint16_t mixing; 286 }; 287 #define AUDIO_ROUTE_STREAM_VOICE_RX 0 288 #define AUDIO_ROUTE_STREAM_VOICE_TX 1 289 #define AUDIO_ROUTE_STREAM_PLAYBACK 2 290 #define AUDIO_ROUTE_STREAM_REC 3 291 struct msm_audio_route_config { 292 uint32_t stream_type; 293 uint32_t stream_id; 294 uint32_t dev_id; 295 }; 296 #define AUDIO_MAX_EQ_BANDS 12 297 struct msm_audio_eq_band { 298 uint16_t band_idx; 299 uint32_t filter_type; 300 uint32_t center_freq_hz; 301 uint32_t filter_gain; 302 uint32_t q_factor; 303 } __attribute__((packed)); 304 struct msm_audio_eq_stream_config { 305 uint32_t enable; 306 uint32_t num_bands; 307 struct msm_audio_eq_band eq_bands[AUDIO_MAX_EQ_BANDS]; 308 } __attribute__((packed)); 309 struct msm_acdb_cmd_device { 310 uint32_t command_id; 311 uint32_t device_id; 312 uint32_t network_id; 313 uint32_t sample_rate_id; 314 uint32_t interface_id; 315 uint32_t algorithm_block_id; 316 uint32_t total_bytes; 317 uint32_t * phys_buf; 318 }; 319 struct msm_hwacc_data_config { 320 __u32 buf_size; 321 __u32 num_buf; 322 __u32 num_channels; 323 __u8 channel_map[8]; 324 __u32 sample_rate; 325 __u32 bits_per_sample; 326 }; 327 struct msm_hwacc_buf_cfg { 328 __u32 input_len; 329 __u32 output_len; 330 }; 331 struct msm_hwacc_buf_avail { 332 __u32 input_num_avail; 333 __u32 output_num_avail; 334 }; 335 struct msm_hwacc_effects_config { 336 struct msm_hwacc_data_config input; 337 struct msm_hwacc_data_config output; 338 struct msm_hwacc_buf_cfg buf_cfg; 339 __u32 meta_mode_enabled; 340 __u32 overwrite_topology; 341 __s32 topology; 342 }; 343 #define ADSP_STREAM_PP_EVENT 0 344 #define ADSP_STREAM_ENCDEC_EVENT 1 345 #define ADSP_STREAM_IEC_61937_FMT_UPDATE_EVENT 2 346 #define ADSP_STREAM_EVENT_MAX 3 347 struct msm_adsp_event_data { 348 __u32 event_type; 349 __u32 payload_len; 350 __u8 payload[0]; 351 }; 352 #endif 353 354