b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /*------------------------------------------------------------
|
| 2 | (C) Copyright [2006-2008] Marvell International Ltd.
|
| 3 | All Rights Reserved
|
| 4 | ------------------------------------------------------------*/
|
| 5 |
|
| 6 | /*--------------------------------------------------------------------------------------------------------------------
|
| 7 | INTEL CONFIDENTIAL
|
| 8 | Copyright 2006 Intel Corporation All Rights Reserved.
|
| 9 | The source code contained or described herein and all documents related to the source code ("Material") are owned
|
| 10 | by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or
|
| 11 | its suppliers and licensors. The Material contains trade secrets and proprietary and confidential information of
|
| 12 | Intel or its suppliers and licensors. The Material is protected by worldwide copyright and trade secret laws and
|
| 13 | treaty provisions. No part of the Material may be used, copied, reproduced, modified, published, uploaded, posted,
|
| 14 | transmitted, distributed, or disclosed in any way without Intel's prior express written permission.
|
| 15 |
|
| 16 | No license under any patent, copyright, trade secret or other intellectual property right is granted to or
|
| 17 | conferred upon you by disclosure or delivery of the Materials, either expressly, by implication, inducement,
|
| 18 | estoppel or otherwise. Any license under such intellectual property rights must be express and approved by
|
| 19 | Intel in writing.
|
| 20 | -------------------------------------------------------------------------------------------------------------------*/
|
| 21 |
|
| 22 | /**********************************************************************
|
| 23 | *
|
| 24 | * Filename: AuC.h
|
| 25 | *
|
| 26 | * Programmers: Tal Rotbart
|
| 27 | *
|
| 28 | * Description: Declarations of Common AuC services and variables
|
| 29 | *
|
| 30 | * --------------------------------------------------------------------
|
| 31 | * Revision History
|
| 32 | *
|
| 33 | * Date Who Version Description
|
| 34 | * --------------------------------------------------------------------
|
| 35 | *
|
| 36 | **********************************************************************/
|
| 37 | #ifndef AUC_H
|
| 38 | #define AUC_H
|
| 39 |
|
| 40 | #if 0
|
| 41 | #define MAX_VOLUME_VALUE (0x31)
|
| 42 | #define MUTE_ON (0x0)
|
| 43 | #define MUTE_OFF (0x1)
|
| 44 | #endif
|
| 45 |
|
| 46 | //ICAT EXPORTED ENUM
|
| 47 | typedef enum {
|
| 48 | NON_INITIALIZED // 0
|
| 49 | , VOICE_IDLE // 1
|
| 50 | , WAIT_FOR_CSDI_START // 2
|
| 51 | , WAIT_FOR_CSDI_START_AND_PCM_STREAM // 3
|
| 52 | , WBCDMA_VOICE // 4
|
| 53 | , WBCDMA_VOICE_AND_PCM_STREAM // 5
|
| 54 | , VOICE_HAND_OVER // 6
|
| 55 | , VOICE_HAND_OVER_AND_PCM_STREAM // 7
|
| 56 | , WAIT_FOR_CSDI_STOP // 8
|
| 57 | , WAIT_FOR_CSDI_STOP_AND_PCM_STREAM // 9
|
| 58 | , GSM_VOICE // 10
|
| 59 | , GSM_VOICE_AND_PCM_STREAM // 11
|
| 60 | , PCM_STREAM_ONLY // 12
|
| 61 | , VOCODER_STREAM // 13
|
| 62 | , VOCODER_STREAM_AND_PCM_STREAM // 14
|
| 63 |
|
| 64 | #ifdef SS_VT
|
| 65 | //New state for VT(H.223 in CP side)
|
| 66 | , VT_H223_VOICE
|
| 67 | #endif
|
| 68 | } Audio_Ctrl_State;
|
| 69 |
|
| 70 |
|
| 71 | typedef enum {
|
| 72 | TRI_STATE = 0,
|
| 73 | ACTIVE
|
| 74 | }TriStateMode;
|
| 75 |
|
| 76 |
|
| 77 | // Opcodes:
|
| 78 | enum AudioCtrlCmd {
|
| 79 | START_VOICE_PATH = 0x0040
|
| 80 | , END_VOICE_PATH = 0x0041
|
| 81 | , VOICE_HANDOVER = 0x0042
|
| 82 | , VOICE_RX_PACKET = 0x0043
|
| 83 | , AUDIOTOOL_CONTROL = 0x0044
|
| 84 | , CODEC_IF_CHANGE = 0x0045
|
| 85 | , VOICE_TEST_CONTROL = 0x0046
|
| 86 | , PCM_STREAM_CONTROL = 0x0047
|
| 87 | , VOICE_ACTIVATE_PATH = 0x0048
|
| 88 | , SELF_INVOCATION = 0x0049
|
| 89 | , CONFIG_CODEC_DB = 0x004c
|
| 90 | , AUDIO_DEVICE_CONTROL = 0x004d
|
| 91 | , AUDIO_PLL_CONTROL = 0x004E
|
| 92 | , AUDIO_MISCELLANEOUS_FUNC = 0x004F
|
| 93 | #ifdef OPT_IPC
|
| 94 | , AUDIO_IPC_CONTROL = 0x0050
|
| 95 | , INIT_IPC_CONTROL = 0x0051
|
| 96 | #endif
|
| 97 | , COMPANDER_CONTROL_CMD = 0x0052
|
| 98 | , VAD_DUMP_CMD = 0x0053
|
| 99 | , COMPANDER_MODE_CMD = 0x0054
|
| 100 | //,POCVOICE_RX_PCM = 0x0055 // Opcode : 0x55 CP send Rx PCM to MSA
|
| 101 | , KWS_CONTROL = 0x0055 //
|
| 102 | , VOICE_RXB_PCM = 0x005b
|
| 103 | , VOCODER_CONTROL = 0x0060
|
| 104 | , VOICE_CONTROL = 0x0061
|
| 105 | , VOLUME_CONTROL = 0x0062
|
| 106 | , MUTE_CONTROL = 0x0063
|
| 107 | , NS_CONTROL = 0x0064
|
| 108 | , EC_CONTROL = 0x0065
|
| 109 | , EQ_CONTROL = 0x0066
|
| 110 | , AVC_CONTROL = 0x0067
|
| 111 | , DTMF_CONTROL = 0x0068
|
| 112 | , AUX_MODE_CONTROL = 0x0069
|
| 113 | , EC_TEST_CMD = 0x006a
|
| 114 | , NS_TEST_CMD = 0x006b
|
| 115 | , DMA_INT_IND = 0x006b
|
| 116 | , AVC_TEST_CMD = 0x006c
|
| 117 | , DITHER_GEN_CONTROL = 0x006d
|
| 118 | , CTM_CONTROL = 0x006e
|
| 119 | , EC_FIR_UPDATE_CMD = 0x006f //obsolete
|
| 120 |
|
| 121 | /*
|
| 122 | * Jackie, 2011-0107
|
| 123 | * For the MSA detection of far-end DTMF.
|
| 124 | * We need to set control parameters into MSA
|
| 125 | */
|
| 126 | , DTMFDETECTION_CONTROL = 0x0070
|
| 127 | #if defined (SAMSUNG_NXP)
|
| 128 | , SPEECH_PLUGIN_TX_OUTPUT_CMD = 0x0071
|
| 129 | , SPEECH_PLUGIN_CONTROL = 0x0072
|
| 130 | , SPEECH_PLUGIN_MODULE_CONTROL = 0x0073
|
| 131 | #endif
|
| 132 |
|
| 133 | , FILTERS_CONTROL = 0x0074 // Opcode : 0x74 for HPF&LPF
|
| 134 |
|
| 135 | #if defined (MSA_MISC_PARAMETERS)
|
| 136 | , AUDIO_MISC_CONTROL = 0x0075 // Opcode : 0x75 for MISC ITEM new feature
|
| 137 | #endif
|
| 138 |
|
| 139 | ////Samsung DiamondVoice
|
| 140 | #if defined (SAMSUNG_TOTORO_DIAMONDVOICE)
|
| 141 | , DIAMONDVOICE_OUTPCMDATA = 0x0076 // DSP send tx/rx PCM to CP audio, which will be sent to DiamondVoice to process.
|
| 142 | #endif
|
| 143 | , AUDIO_FM_MODE = 0x0076
|
| 144 |
|
| 145 | , AUDIO_DUALMIC_CONTROL = 0x0077 // Opcode : 0x77 set dual mic parameters
|
| 146 | , AUDIO_ECALL_CONTROL = 0x0078 // Opcode : 0x78 set ECALL parameters
|
| 147 |
|
| 148 | , AUDIO_GSSP_CONTROL = 0x0079 // Opcode : 0x79 turn on/off GSSP clock
|
| 149 | , AUDIO_SSPA_CONTROL = 0x0079 // Opcode : 0x79 turn on/off GSSP clock
|
| 150 | , AUDIO_GSSP_READ = 0x007a // Opcode : 0x7a read GSSP count
|
| 151 |
|
| 152 | , AUDIO_TX_PCM = 0x007b // Opcode : 0x7b CP send Tx PCM into MSA
|
| 153 |
|
| 154 | , HEADPHONE_TYPE_CHECK_WAIT_ACK = 0x007c
|
| 155 |
|
| 156 | , AUDIO_CODECSET = 0x007d // Opcode : 0x7d CP send codec setting into MSA
|
| 157 | , AUDIO_CODECGET = 0x007e // Opcode : 0x7e CP request codec setting from MSA
|
| 158 |
|
| 159 | , AUDIO_VIBRATION_CONTROL = 0x007F
|
| 160 |
|
| 161 | };
|
| 162 |
|
| 163 | enum AudioCtrlMsg {
|
| 164 | VOICE_TX_PACKET = 0x0040
|
| 165 | , VOICE_DRIFT_REPORT = 0x0041
|
| 166 | , END_VOICE_ACK = 0x0042
|
| 167 | , PCM_STREAM_RECORD = 0x0043
|
| 168 | , GET_PCM_FRAME = 0x0044
|
| 169 | , VOICE_DECODER_ACK = 0x0045
|
| 170 | , VOICE_START_ACK = 0x0046
|
| 171 | , VOICE_PCM_ACK = 0x0047
|
| 172 | , VOICE_DEBUG_RX_PACKET = 0x0048
|
| 173 | , VOICE_DEBUG_PCM = 0x004A
|
| 174 | , VOICE_CTM_NEGO_REPORT = 0x004B
|
| 175 |
|
| 176 | //MSA will report detected DTMF code(in ASCII code)
|
| 177 | , VOICE_GET_DTMF = 0x004C
|
| 178 |
|
| 179 | #if defined (SAMSUNG_NXP)
|
| 180 | , VOICE_RESERVED = 0x004D
|
| 181 | #endif
|
| 182 | , VOICE_MISC_REPORT = 0x004E
|
| 183 | , VOICE_CODEC_REPORT = 0x004F
|
| 184 |
|
| 185 |
|
| 186 | #ifdef OPT_IPC
|
| 187 | , AUDIO_IPC_REPORT = 0x0050
|
| 188 | #endif
|
| 189 |
|
| 190 | #if defined (MSA_MISC_PARAMETERS)
|
| 191 | , AUDIO_MISC_REPORT = 0x52 // AUDIO_MISC_REPORT OpCode : 0x52
|
| 192 | #endif
|
| 193 |
|
| 194 | ////Samsung DiamondVoice
|
| 195 | //#if defined (SAMSUNG_TOTORO_DIAMONDVOICE)
|
| 196 | // ,DIAMONDVOICE_INPCMDATA = 0x0053 // DSP send tx/rx PCM to CP audio, which will be sent to DiamondVoice to process.
|
| 197 | //#endif
|
| 198 | , VAD_DUMP_MSG = 0x0053
|
| 199 | , COMPANDER_REPORT_MSG = 0x0054
|
| 200 | , WISE_VOICE_MSG = 0x0055
|
| 201 | , KWS_DETECT_MSG = 0x0056
|
| 202 | , ECALL_REPORT_MSG = 0x0077
|
| 203 |
|
| 204 | , AUDIO_GSSP_COUNT = 0x007a // Opcode : 0x7a got GSSP count
|
| 205 |
|
| 206 | , AUDIO_RX_PCM = 0x007b // Opcode : 0x7b MSA send Rx PCM into CP
|
| 207 | , HEADPHONE_EVENT_MSG = 0x007c //
|
| 208 | };
|
| 209 |
|
| 210 |
|
| 211 | #if 0
|
| 212 | typedef enum {
|
| 213 | ECALL_DATA_SET = 0,
|
| 214 | ECALL_DATA_GET = 1,
|
| 215 | ECALL_VOICE_SET = 2,
|
| 216 | ECALL_VOICE_GET = 3,
|
| 217 | ECALL_TEST_CONTROL = 4,
|
| 218 | ECALL_TEST_DATA_CONTROL = 5,
|
| 219 | ECALL_CONNECTED = 6
|
| 220 | }EcallIpcCmdSubOpEnum;
|
| 221 |
|
| 222 | typedef enum {
|
| 223 | ECALL_DATA_INDICATION = 0,
|
| 224 | ECALL_DATA_GET_MSG = 1,
|
| 225 | ECALL_VOICE_INDICATION = 2,
|
| 226 | ECALL_VOICE_GET_MSG = 3,
|
| 227 | ECALL_TEST_DATA_ACK = 4,
|
| 228 | ECALL_TEST_TX_BUFFER_END = 5,
|
| 229 | ECALL_TEST_RX_CTRL = 6,
|
| 230 | ECALL_DEBUG = 7
|
| 231 | }EcallIpcMsgSubOpEnum;
|
| 232 |
|
| 233 | //ICAT EXPORTED ENUM
|
| 234 | typedef enum {
|
| 235 | ECALL_CMD_EIM_ABORT_TERMINATED = 0,
|
| 236 | ECALL_CMD_EIM_ARM_ACTIVATE = 1,
|
| 237 | ECALL_CMD_UPDATE_MSD = 2,
|
| 238 | ECALL_CMD_URC_CONTROL = 3,
|
| 239 | ECALL_CMD_FEATURE_CONTROL = 4,
|
| 240 | ECALL_CMD_TIMERS_UPDATE = 5,
|
| 241 | ECALL_CMD_MSD_UPDATE_CONFIG = 6,
|
| 242 | ECALL_CMD_RESERVED_3 = 7,
|
| 243 | ECALL_CMD_NUM_OPCODES
|
| 244 | } EcallUecallDataCmdIdEnum;
|
| 245 | #endif
|
| 246 |
|
| 247 | enum VolumeSide {
|
| 248 | TX_VOLUME
|
| 249 | , RX_VOLUME
|
| 250 | , SIDETONE_VOLUME
|
| 251 | };
|
| 252 |
|
| 253 | enum MuteSide {
|
| 254 | TX_MUTE,
|
| 255 | RX_MUTE
|
| 256 | };
|
| 257 |
|
| 258 | enum VoiceHandOver {
|
| 259 | VOICE_RESUME,
|
| 260 | VOICE_SUSPEND
|
| 261 | };
|
| 262 |
|
| 263 |
|
| 264 | #if 0
|
| 265 | typedef enum {
|
| 266 | AMRInitFunc,
|
| 267 | EnableHwPathCodecFunc,
|
| 268 | DisableHwPathCodecFunc,
|
| 269 | EnableHwPathBTFunc,
|
| 270 | DisableHwPathBTFunc
|
| 271 | }CalledFunctionT;
|
| 272 |
|
| 273 | void AudioTriStateControl(CalledFunctionT CalledFunction);
|
| 274 |
|
| 275 | /*
|
| 276 | Frame Type AMRcodec Total Class A Class B Class C
|
| 277 | 0 4,75 95 42 53 0
|
| 278 | 1 5,15 103 49 54 0
|
| 279 | 2 5,90 118 55 63 0
|
| 280 | 3 6,70 134 58 76 0
|
| 281 | 4 7,40 148 61 87 0
|
| 282 | 5 7,95 159 75 84 0
|
| 283 | 6 10,2 204 65 99 40
|
| 284 | 7 12,2 244 81 103 60 */
|
| 285 | #define CLASS_A_OCTETS_4_75 6
|
| 286 | #define CLASS_B_OCTETS_4_75 7
|
| 287 | #define CLASS_C_OCTETS_4_75 0
|
| 288 |
|
| 289 | #define CLASS_A_OCTETS_5_15 7
|
| 290 | #define CLASS_B_OCTETS_5_15 7
|
| 291 | #define CLASS_C_OCTETS_5_15 0
|
| 292 |
|
| 293 | #define CLASS_A_OCTETS_5_90 7
|
| 294 | #define CLASS_B_OCTETS_5_90 8
|
| 295 | #define CLASS_C_OCTETS_5_90 0
|
| 296 |
|
| 297 | #define CLASS_A_OCTETS_6_70 8
|
| 298 | #define CLASS_B_OCTETS_6_70 10
|
| 299 | #define CLASS_C_OCTETS_6_70 0
|
| 300 |
|
| 301 | #define CLASS_A_OCTETS_7_40 8
|
| 302 | #define CLASS_B_OCTETS_7_40 11
|
| 303 | #define CLASS_C_OCTETS_7_40 0
|
| 304 |
|
| 305 | #define CLASS_A_OCTETS_7_95 10
|
| 306 | #define CLASS_B_OCTETS_7_95 11
|
| 307 | #define CLASS_C_OCTETS_7_95 0
|
| 308 |
|
| 309 | #define CLASS_A_OCTETS_10_2 9
|
| 310 | #define CLASS_B_OCTETS_10_2 13
|
| 311 | #define CLASS_C_OCTETS_10_2 5
|
| 312 |
|
| 313 | #define CLASS_A_OCTETS_12_2 11
|
| 314 | #define CLASS_B_OCTETS_12_2 13
|
| 315 | #define CLASS_C_OCTETS_12_2 8
|
| 316 |
|
| 317 | #define MAX_CLASS_A_OCTETS 11
|
| 318 | #define MAX_CLASS_B_OCTETS 13
|
| 319 | #define MAX_CLASS_C_OCTETS 8
|
| 320 | #endif
|
| 321 |
|
| 322 | #endif // AUC_H
|