1 #ifndef _MSM_AUDIO_MVS_H 2 #define _MSM_AUDIO_MVS_H 3 4 #include <linux/msm_audio.h> 5 6 #define AUDIO_GET_MVS_CONFIG _IOW(AUDIO_IOCTL_MAGIC, \ 7 (AUDIO_MAX_COMMON_IOCTL_NUM + 0), unsigned int) 8 #define AUDIO_SET_MVS_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \ 9 (AUDIO_MAX_COMMON_IOCTL_NUM + 1), unsigned int) 10 11 /* MVS modes */ 12 #define MVS_MODE_IS733 0x1 /*QCELP 13K*/ 13 #define MVS_MODE_IS127 0x2 /*EVRC-8k*/ 14 #define MVS_MODE_4GV_NB 0x3 /*EVRC-B*/ 15 #define MVS_MODE_4GV_WB 0x4 /*EVRC-WB*/ 16 #define MVS_MODE_AMR 0x5 17 #define MVS_MODE_EFR 0x6 18 #define MVS_MODE_FR 0x7 19 #define MVS_MODE_HR 0x8 20 #define MVS_MODE_LINEAR_PCM 0x9 21 #define MVS_MODE_G711 0xA 22 #define MVS_MODE_PCM 0xC 23 #define MVS_MODE_AMR_WB 0xD 24 #define MVS_MODE_G729A 0xE 25 #define MVS_MODE_G711A 0xF 26 #define MVS_MODE_G722 0x10 27 #define MVS_MODE_PCM_WB 0x12 28 29 enum msm_audio_amr_mode { 30 MVS_AMR_MODE_0475, /* AMR 4.75 kbps */ 31 MVS_AMR_MODE_0515, /* AMR 5.15 kbps */ 32 MVS_AMR_MODE_0590, /* AMR 5.90 kbps */ 33 MVS_AMR_MODE_0670, /* AMR 6.70 kbps */ 34 MVS_AMR_MODE_0740, /* AMR 7.40 kbps */ 35 MVS_AMR_MODE_0795, /* AMR 7.95 kbps */ 36 MVS_AMR_MODE_1020, /* AMR 10.20 kbps */ 37 MVS_AMR_MODE_1220, /* AMR 12.20 kbps */ 38 MVS_AMR_MODE_0660, /* AMR-WB 6.60 kbps */ 39 MVS_AMR_MODE_0885, /* AMR-WB 8.85 kbps */ 40 MVS_AMR_MODE_1265, /* AMR-WB 12.65 kbps */ 41 MVS_AMR_MODE_1425, /* AMR-WB 14.25 kbps */ 42 MVS_AMR_MODE_1585, /* AMR-WB 15.85 kbps */ 43 MVS_AMR_MODE_1825, /* AMR-WB 18.25 kbps */ 44 MVS_AMR_MODE_1985, /* AMR-WB 19.85 kbps */ 45 MVS_AMR_MODE_2305, /* AMR-WB 23.05 kbps */ 46 MVS_AMR_MODE_2385, /* AMR-WB 23.85 kbps */ 47 MVS_AMR_MODE_UNDEF 48 }; 49 50 /* The MVS VOC rate type is used to identify the rate of QCELP 13K(IS733), 51 * EVRC(IS127), 4GV, or 4GV-WB frame. 52 */ 53 enum msm_audio_voc_rate { 54 MVS_VOC_0_RATE, /* Blank frame */ 55 MVS_VOC_8_RATE, /* 1/8 rate */ 56 MVS_VOC_4_RATE, /* 1/4 rate */ 57 MVS_VOC_2_RATE, /* 1/2 rate */ 58 MVS_VOC_1_RATE, /* Full rate */ 59 MVS_VOC_ERASURE, /* erasure frame */ 60 MVS_VOC_RATE_MAX, 61 MVS_VOC_RATE_UNDEF = MVS_VOC_RATE_MAX 62 }; 63 64 enum msm_audio_amr_frame_type { 65 MVS_AMR_SPEECH_GOOD, /* Good speech frame */ 66 MVS_AMR_SPEECH_DEGRADED, /* Speech degraded */ 67 MVS_AMR_ONSET, /* Onset */ 68 MVS_AMR_SPEECH_BAD, /* Corrupt speech frame (bad CRC) */ 69 MVS_AMR_SID_FIRST, /* First silence descriptor */ 70 MVS_AMR_SID_UPDATE, /* Comfort noise frame */ 71 MVS_AMR_SID_BAD, /* Corrupt SID frame (bad CRC) */ 72 MVS_AMR_NO_DATA, /* Nothing to transmit */ 73 MVS_AMR_SPEECH_LOST /* Downlink speech lost */ 74 }; 75 76 enum msm_audio_g711a_mode { 77 MVS_G711A_MODE_MULAW, 78 MVS_G711A_MODE_ALAW 79 }; 80 81 enum msm_audio_g711_mode { 82 MVS_G711_MODE_MULAW, 83 MVS_G711_MODE_ALAW 84 }; 85 86 enum mvs_g722_mode_type { 87 MVS_G722_MODE_01, 88 MVS_G722_MODE_02, 89 MVS_G722_MODE_03, 90 MVS_G722_MODE_MAX, 91 MVS_G722_MODE_UNDEF 92 }; 93 94 enum msm_audio_g711a_frame_type { 95 MVS_G711A_SPEECH_GOOD, 96 MVS_G711A_SID, 97 MVS_G711A_NO_DATA, 98 MVS_G711A_ERASURE 99 }; 100 101 enum msm_audio_g729a_frame_type { 102 MVS_G729A_NO_DATA, 103 MVS_G729A_SPEECH_GOOD, 104 MVS_G729A_SID, 105 MVS_G729A_ERASURE 106 }; 107 108 struct min_max_rate { 109 uint32_t min_rate; 110 uint32_t max_rate; 111 }; 112 113 struct msm_audio_mvs_config { 114 uint32_t mvs_mode; 115 uint32_t rate_type; 116 struct min_max_rate min_max_rate; 117 uint32_t dtx_mode; 118 }; 119 120 #define MVS_MAX_VOC_PKT_SIZE 640 121 122 struct gsm_header { 123 uint8_t bfi; 124 uint8_t sid; 125 uint8_t taf; 126 uint8_t ufi; 127 }; 128 129 struct q6_msm_audio_mvs_frame { 130 union { 131 uint32_t frame_type; 132 uint32_t packet_rate; 133 struct gsm_header gsm_frame_type; 134 } header; 135 uint32_t len; 136 uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE]; 137 138 }; 139 140 struct msm_audio_mvs_frame { 141 uint32_t frame_type; 142 uint32_t len; 143 uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE]; 144 145 }; 146 147 #define Q5V2_MVS_MAX_VOC_PKT_SIZE 320 148 149 struct q5v2_msm_audio_mvs_frame { 150 uint32_t frame_type; 151 uint32_t len; 152 uint8_t voc_pkt[Q5V2_MVS_MAX_VOC_PKT_SIZE]; 153 154 }; 155 #endif /* _MSM_AUDIO_MVS_H */ 156