Home | History | Annotate | Download | only in linux
      1 #ifndef _UAPI_MSM_AUDIO_MVS_H
      2 #define _UAPI_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)
      8 #define AUDIO_SET_MVS_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
      9 	(AUDIO_MAX_COMMON_IOCTL_NUM + 1), unsigned)
     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 enum msm_audio_voc_rate {
     53 		MVS_VOC_0_RATE, /* Blank frame */
     54 		MVS_VOC_8_RATE, /* 1/8 rate    */
     55 		MVS_VOC_4_RATE, /* 1/4 rate    */
     56 		MVS_VOC_2_RATE, /* 1/2 rate    */
     57 		MVS_VOC_1_RATE,/* Full rate   */
     58 		MVS_VOC_ERASURE, /* erasure frame */
     59 		MVS_VOC_RATE_MAX,
     60 		MVS_VOC_RATE_UNDEF = MVS_VOC_RATE_MAX
     61 };
     62 
     63 enum msm_audio_amr_frame_type {
     64 	MVS_AMR_SPEECH_GOOD,	      /* Good speech frame              */
     65 	MVS_AMR_SPEECH_DEGRADED,      /* Speech degraded                */
     66 	MVS_AMR_ONSET,		      /* Onset                          */
     67 	MVS_AMR_SPEECH_BAD,	      /* Corrupt speech frame (bad CRC) */
     68 	MVS_AMR_SID_FIRST,	      /* First silence descriptor       */
     69 	MVS_AMR_SID_UPDATE,	      /* Comfort noise frame            */
     70 	MVS_AMR_SID_BAD,	      /* Corrupt SID frame (bad CRC)    */
     71 	MVS_AMR_NO_DATA,	      /* Nothing to transmit            */
     72 	MVS_AMR_SPEECH_LOST	      /* Downlink speech lost           */
     73 };
     74 
     75 enum msm_audio_g711a_mode {
     76 	MVS_G711A_MODE_MULAW,
     77 	MVS_G711A_MODE_ALAW
     78 };
     79 
     80 enum msm_audio_g711_mode {
     81 	MVS_G711_MODE_MULAW,
     82 	MVS_G711_MODE_ALAW
     83 };
     84 
     85 enum mvs_g722_mode_type {
     86 	MVS_G722_MODE_01,
     87 	MVS_G722_MODE_02,
     88 	MVS_G722_MODE_03,
     89 	MVS_G722_MODE_MAX,
     90 	MVS_G722_MODE_UNDEF
     91 };
     92 
     93 enum msm_audio_g711a_frame_type {
     94 	MVS_G711A_SPEECH_GOOD,
     95 	MVS_G711A_SID,
     96 	MVS_G711A_NO_DATA,
     97 	MVS_G711A_ERASURE
     98 };
     99 
    100 enum msm_audio_g729a_frame_type {
    101 	MVS_G729A_NO_DATA,
    102 	MVS_G729A_SPEECH_GOOD,
    103 	MVS_G729A_SID,
    104 	MVS_G729A_ERASURE
    105 };
    106 
    107 struct min_max_rate {
    108 	uint32_t min_rate;
    109 	uint32_t max_rate;
    110 };
    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 
    119 #define MVS_MAX_VOC_PKT_SIZE 640
    120 
    121 struct gsm_header {
    122 	uint8_t bfi;
    123 	uint8_t sid;
    124 	uint8_t taf;
    125 	uint8_t ufi;
    126 };
    127 
    128 struct q6_msm_audio_mvs_frame {
    129 	union {
    130 	uint32_t frame_type;
    131 	uint32_t packet_rate;
    132 	struct gsm_header gsm_frame_type;
    133 	} header;
    134 	uint32_t len;
    135 	uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE];
    136 
    137 };
    138 
    139 struct msm_audio_mvs_frame {
    140 	uint32_t frame_type;
    141 	uint32_t len;
    142 	uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE];
    143 
    144 };
    145 
    146 #define Q5V2_MVS_MAX_VOC_PKT_SIZE 320
    147 
    148 struct q5v2_msm_audio_mvs_frame {
    149 	uint32_t frame_type;
    150 	uint32_t len;
    151 	uint8_t voc_pkt[Q5V2_MVS_MAX_VOC_PKT_SIZE];
    152 
    153 };
    154 #endif /* _UAPI_MSM_AUDIO_MVS_H */
    155