Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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) |
| 8 | #define AUDIO_SET_MVS_CONFIG _IOR(AUDIO_IOCTL_MAGIC, \ |
| 9 | (AUDIO_MAX_COMMON_IOCTL_NUM + 1), unsigned) |
| 10 | |
| 11 | /* MVS modes */ |
Neema Shetty | 5b3641d | 2011-07-29 20:30:25 -0700 | [diff] [blame] | 12 | #define MVS_MODE_IS733 0x1 |
| 13 | #define MVS_MODE_IS127 0x2 |
| 14 | #define MVS_MODE_4GV_NB 0x3 |
| 15 | #define MVS_MODE_4GV_WB 0x4 |
| 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 |
Phani Kumar Allada | f30d604 | 2012-02-21 16:02:59 +0530 | [diff] [blame] | 27 | #define MVS_MODE_PCM_WB 0x12 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 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 | enum msm_audio_voc_rate { |
| 51 | MVS_VOC_0_RATE, /* Blank frame */ |
| 52 | MVS_VOC_8_RATE, /* 1/8 rate */ |
| 53 | MVS_VOC_4_RATE, /* 1/4 rate */ |
| 54 | MVS_VOC_2_RATE, /* 1/2 rate */ |
| 55 | MVS_VOC_1_RATE /* Full rate */ |
| 56 | }; |
| 57 | |
| 58 | enum msm_audio_amr_frame_type { |
| 59 | MVS_AMR_SPEECH_GOOD, /* Good speech frame */ |
| 60 | MVS_AMR_SPEECH_DEGRADED, /* Speech degraded */ |
| 61 | MVS_AMR_ONSET, /* Onset */ |
| 62 | MVS_AMR_SPEECH_BAD, /* Corrupt speech frame (bad CRC) */ |
| 63 | MVS_AMR_SID_FIRST, /* First silence descriptor */ |
| 64 | MVS_AMR_SID_UPDATE, /* Comfort noise frame */ |
| 65 | MVS_AMR_SID_BAD, /* Corrupt SID frame (bad CRC) */ |
| 66 | MVS_AMR_NO_DATA, /* Nothing to transmit */ |
| 67 | MVS_AMR_SPEECH_LOST /* Downlink speech lost */ |
| 68 | }; |
| 69 | |
| 70 | enum msm_audio_g711a_mode { |
| 71 | MVS_G711A_MODE_MULAW, |
| 72 | MVS_G711A_MODE_ALAW |
| 73 | }; |
| 74 | |
| 75 | enum mvs_g722_mode_type { |
| 76 | MVS_G722_MODE_01, |
| 77 | MVS_G722_MODE_02, |
| 78 | MVS_G722_MODE_03, |
| 79 | MVS_G722_MODE_MAX, |
| 80 | MVS_G722_MODE_UNDEF |
| 81 | }; |
| 82 | |
| 83 | enum msm_audio_g711a_frame_type { |
| 84 | MVS_G711A_SPEECH_GOOD, |
| 85 | MVS_G711A_SID, |
| 86 | MVS_G711A_NO_DATA, |
| 87 | MVS_G711A_ERASURE |
| 88 | }; |
| 89 | |
| 90 | enum msm_audio_g729a_frame_type { |
| 91 | MVS_G729A_NO_DATA, |
| 92 | MVS_G729A_SPEECH_GOOD, |
| 93 | MVS_G729A_SID, |
| 94 | MVS_G729A_ERASURE |
| 95 | }; |
| 96 | |
Chaithanya Krishna Bacharaju | 2f2e8a5 | 2011-10-17 14:54:07 +0530 | [diff] [blame] | 97 | struct min_max_rate { |
| 98 | uint32_t min_rate; |
| 99 | uint32_t max_rate; |
| 100 | }; |
| 101 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 102 | struct msm_audio_mvs_config { |
| 103 | uint32_t mvs_mode; |
| 104 | uint32_t rate_type; |
Chaithanya Krishna Bacharaju | 2f2e8a5 | 2011-10-17 14:54:07 +0530 | [diff] [blame] | 105 | struct min_max_rate min_max_rate; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 106 | uint32_t dtx_mode; |
| 107 | }; |
| 108 | |
Neema Shetty | 5b3641d | 2011-07-29 20:30:25 -0700 | [diff] [blame] | 109 | #define MVS_MAX_VOC_PKT_SIZE 640 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 110 | |
Chaithanya Krishna Bacharaju | 68993b5 | 2011-10-18 08:41:30 +0530 | [diff] [blame] | 111 | struct gsm_header { |
| 112 | uint8_t bfi; |
| 113 | uint8_t sid; |
| 114 | uint8_t taf; |
| 115 | uint8_t ufi; |
| 116 | }; |
| 117 | |
Chaithanya Krishna Bacharaju | 2f2e8a5 | 2011-10-17 14:54:07 +0530 | [diff] [blame] | 118 | struct q6_msm_audio_mvs_frame { |
| 119 | union { |
| 120 | uint32_t frame_type; |
| 121 | uint32_t packet_rate; |
Chaithanya Krishna Bacharaju | 68993b5 | 2011-10-18 08:41:30 +0530 | [diff] [blame] | 122 | struct gsm_header gsm_frame_type; |
Chaithanya Krishna Bacharaju | 2f2e8a5 | 2011-10-17 14:54:07 +0530 | [diff] [blame] | 123 | } header; |
| 124 | uint32_t len; |
| 125 | uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE]; |
| 126 | |
| 127 | }; |
| 128 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 129 | struct msm_audio_mvs_frame { |
| 130 | uint32_t frame_type; |
| 131 | uint32_t len; |
| 132 | uint8_t voc_pkt[MVS_MAX_VOC_PKT_SIZE]; |
| 133 | |
| 134 | }; |
| 135 | |
| 136 | #endif /* __MSM_AUDIO_MVS_H */ |