blob: 6fe5b70fb63bfcdb25a31c0f2b0acbb6699ba1f1 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001#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)
8#define AUDIO_SET_MVS_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \
9 (AUDIO_MAX_COMMON_IOCTL_NUM + 1), unsigned)
10
11/* MVS modes */
Sidipotu Ashokea9c9182012-07-04 10:10:11 +053012#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*/
Neema Shetty5b3641d2011-07-29 20:30:25 -070016#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
Phani Kumar Alladaf30d6042012-02-21 16:02:59 +053027#define MVS_MODE_PCM_WB 0x12
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070028
29enum 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
Sidipotu Ashokea9c9182012-07-04 10:10:11 +053050/*The MVS VOC rate type is used to identify the rate of QCELP 13K(IS733),
51EVRC(IS127), 4GV, or 4GV-WB frame.*/
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070052enum 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 */
Sidipotu Ashokea9c9182012-07-04 10:10:11 +053057 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
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070061};
62
63enum 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
75enum msm_audio_g711a_mode {
76 MVS_G711A_MODE_MULAW,
77 MVS_G711A_MODE_ALAW
78};
79
Sidipotu Ashokea9c9182012-07-04 10:10:11 +053080enum msm_audio_g711_mode {
81 MVS_G711_MODE_MULAW,
82 MVS_G711_MODE_ALAW
83};
84
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070085enum 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
93enum 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
100enum 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
Chaithanya Krishna Bacharaju2f2e8a52011-10-17 14:54:07 +0530107struct min_max_rate {
108 uint32_t min_rate;
109 uint32_t max_rate;
110};
111
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700112struct msm_audio_mvs_config {
113 uint32_t mvs_mode;
114 uint32_t rate_type;
Chaithanya Krishna Bacharaju2f2e8a52011-10-17 14:54:07 +0530115 struct min_max_rate min_max_rate;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700116 uint32_t dtx_mode;
117};
118
Neema Shetty5b3641d2011-07-29 20:30:25 -0700119#define MVS_MAX_VOC_PKT_SIZE 640
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700120
Chaithanya Krishna Bacharaju68993b52011-10-18 08:41:30 +0530121struct gsm_header {
122 uint8_t bfi;
123 uint8_t sid;
124 uint8_t taf;
125 uint8_t ufi;
126};
127
Chaithanya Krishna Bacharaju2f2e8a52011-10-17 14:54:07 +0530128struct q6_msm_audio_mvs_frame {
129 union {
130 uint32_t frame_type;
131 uint32_t packet_rate;
Chaithanya Krishna Bacharaju68993b52011-10-18 08:41:30 +0530132 struct gsm_header gsm_frame_type;
Chaithanya Krishna Bacharaju2f2e8a52011-10-17 14:54:07 +0530133 } header;
134 uint32_t len;
135 uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE];
136
137};
138
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700139struct 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
Vinay Vaka71f7dec2012-04-12 21:48:08 +0530146#define Q5V2_MVS_MAX_VOC_PKT_SIZE 320
147
148struct 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};
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700154#endif /* __MSM_AUDIO_MVS_H */