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 _MSM_AUDIO_MVS_H 20 #define _MSM_AUDIO_MVS_H 21 #include <linux/msm_audio.h> 22 #define AUDIO_GET_MVS_CONFIG _IOW(AUDIO_IOCTL_MAGIC, (AUDIO_MAX_COMMON_IOCTL_NUM + 0), unsigned int) 23 #define AUDIO_SET_MVS_CONFIG _IOR(AUDIO_IOCTL_MAGIC, (AUDIO_MAX_COMMON_IOCTL_NUM + 1), unsigned int) 24 #define MVS_MODE_IS733 0x1 25 #define MVS_MODE_IS127 0x2 26 #define MVS_MODE_4GV_NB 0x3 27 #define MVS_MODE_4GV_WB 0x4 28 #define MVS_MODE_AMR 0x5 29 #define MVS_MODE_EFR 0x6 30 #define MVS_MODE_FR 0x7 31 #define MVS_MODE_HR 0x8 32 #define MVS_MODE_LINEAR_PCM 0x9 33 #define MVS_MODE_G711 0xA 34 #define MVS_MODE_PCM 0xC 35 #define MVS_MODE_AMR_WB 0xD 36 #define MVS_MODE_G729A 0xE 37 #define MVS_MODE_G711A 0xF 38 #define MVS_MODE_G722 0x10 39 #define MVS_MODE_PCM_WB 0x12 40 enum msm_audio_amr_mode { 41 MVS_AMR_MODE_0475, 42 MVS_AMR_MODE_0515, 43 MVS_AMR_MODE_0590, 44 MVS_AMR_MODE_0670, 45 MVS_AMR_MODE_0740, 46 MVS_AMR_MODE_0795, 47 MVS_AMR_MODE_1020, 48 MVS_AMR_MODE_1220, 49 MVS_AMR_MODE_0660, 50 MVS_AMR_MODE_0885, 51 MVS_AMR_MODE_1265, 52 MVS_AMR_MODE_1425, 53 MVS_AMR_MODE_1585, 54 MVS_AMR_MODE_1825, 55 MVS_AMR_MODE_1985, 56 MVS_AMR_MODE_2305, 57 MVS_AMR_MODE_2385, 58 MVS_AMR_MODE_UNDEF 59 }; 60 enum msm_audio_voc_rate { 61 MVS_VOC_0_RATE, 62 MVS_VOC_8_RATE, 63 MVS_VOC_4_RATE, 64 MVS_VOC_2_RATE, 65 MVS_VOC_1_RATE, 66 MVS_VOC_ERASURE, 67 MVS_VOC_RATE_MAX, 68 MVS_VOC_RATE_UNDEF = MVS_VOC_RATE_MAX 69 }; 70 enum msm_audio_amr_frame_type { 71 MVS_AMR_SPEECH_GOOD, 72 MVS_AMR_SPEECH_DEGRADED, 73 MVS_AMR_ONSET, 74 MVS_AMR_SPEECH_BAD, 75 MVS_AMR_SID_FIRST, 76 MVS_AMR_SID_UPDATE, 77 MVS_AMR_SID_BAD, 78 MVS_AMR_NO_DATA, 79 MVS_AMR_SPEECH_LOST 80 }; 81 enum msm_audio_g711a_mode { 82 MVS_G711A_MODE_MULAW, 83 MVS_G711A_MODE_ALAW 84 }; 85 enum msm_audio_g711_mode { 86 MVS_G711_MODE_MULAW, 87 MVS_G711_MODE_ALAW 88 }; 89 enum mvs_g722_mode_type { 90 MVS_G722_MODE_01, 91 MVS_G722_MODE_02, 92 MVS_G722_MODE_03, 93 MVS_G722_MODE_MAX, 94 MVS_G722_MODE_UNDEF 95 }; 96 enum msm_audio_g711a_frame_type { 97 MVS_G711A_SPEECH_GOOD, 98 MVS_G711A_SID, 99 MVS_G711A_NO_DATA, 100 MVS_G711A_ERASURE 101 }; 102 enum msm_audio_g729a_frame_type { 103 MVS_G729A_NO_DATA, 104 MVS_G729A_SPEECH_GOOD, 105 MVS_G729A_SID, 106 MVS_G729A_ERASURE 107 }; 108 struct min_max_rate { 109 uint32_t min_rate; 110 uint32_t max_rate; 111 }; 112 struct msm_audio_mvs_config { 113 uint32_t mvs_mode; 114 uint32_t rate_type; 115 struct min_max_rate min_max_rate; 116 uint32_t dtx_mode; 117 }; 118 #define MVS_MAX_VOC_PKT_SIZE 640 119 struct gsm_header { 120 uint8_t bfi; 121 uint8_t sid; 122 uint8_t taf; 123 uint8_t ufi; 124 }; 125 struct q6_msm_audio_mvs_frame { 126 union { 127 uint32_t frame_type; 128 uint32_t packet_rate; 129 struct gsm_header gsm_frame_type; 130 } header; 131 uint32_t len; 132 uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE]; 133 }; 134 struct msm_audio_mvs_frame { 135 uint32_t frame_type; 136 uint32_t len; 137 uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE]; 138 }; 139 #define Q5V2_MVS_MAX_VOC_PKT_SIZE 320 140 struct q5v2_msm_audio_mvs_frame { 141 uint32_t frame_type; 142 uint32_t len; 143 uint8_t voc_pkt[Q5V2_MVS_MAX_VOC_PKT_SIZE]; 144 }; 145 #endif 146 147