xref: /utopia/UTPA2-700.0.x/modules/audio/hal/mustang/audio/halAUR2.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 #ifndef _AUR2_H_
79 #define _AUR2_H_
80 
81 //  enum for r2 decoder command
82 typedef enum
83 {
84     AU_DEC_R2_CMD_STOP                  = 0x0,
85     AU_DEC_R2_CMD_PLAY                  = 0x1,
86     AU_DEC_R2_CMD_PLAYFILETSP           = 0x2,
87     AU_DEC_R2_CMD_PLAYUNI               = 0x3,
88     AU_DEC_R2_CMD_PLAYFILE              = 0x4,
89     AU_DEC_R2_CMD_SKIP                  = 0x6,
90     AU_DEC_R2_CMD_PLAY_AD               = 0x10,
91     AU_DEC_R2_CMD_STARTBROWSE           = 0x20,
92     AU_DEC_R2_CMD_PAUSE                 = 0x40,
93     AU_DEC_R2_CMD_FREERUN               = 0x80,   //if not free_run, just AV_sync
94 } AU_DEC_R2_CMD;
95 
96 typedef enum
97 {
98     R2_DECCMD_STOP,
99     R2_DECCMD_PAUSE,
100     R2_DECCMD_PLAY,
101 } R2_DEC_PLAYCMD;
102 
103 typedef enum
104 {
105     adec_type_dummy,
106     adec_type_ac3,
107     adec_type_ac3p,
108     adec_type_mpeg,
109     adec_type_dts,
110     adec_type_aac,
111     adec_type_aacp,
112     adec_type_xpcm,
113     adec_type_vorbis,
114     adec_type_flac,
115     adec_type_wma,
116     adec_type_wmap,
117     adec_type_ra8,
118     adec_type_gaac,
119     adec_type_dolby_truhd_bypass,
120     adec_type_dolby_dtshd_ado,
121     adec_type_dra,
122     adec_type_amrnb,
123     adec_type_amrwb,
124 
125     adec_type_reserved = 0x1F,          //Maxium Number of codec type
126     adec_type_regmask = 0x1F,           //Maxium Bit use for register
127 } adec_type;
128 
129 typedef enum
130 {
131     adec_capa_mpeg = 1 << adec_type_mpeg,
132     adec_capa_ac3  = 1 << adec_type_ac3,
133     adec_capa_ac3p = 1 << adec_type_ac3p,
134     adec_capa_dts  = 1 << adec_type_dts,
135     adec_capa_aac  = 1 << adec_type_aac,
136     adec_capa_aacp = 1 << adec_type_aacp,
137     adec_capa_xpcm = 1 << adec_type_xpcm,
138     adec_capa_vorbis = 1 << adec_type_vorbis,
139     adec_capa_flac = 1 << adec_type_flac,
140     adec_capa_wma = 1 << adec_type_wma,
141     adec_capa_wmap = 1 << adec_type_wmap,
142     adec_capa_ra8 = 1 << adec_type_ra8,
143     adec_capa_gaac = 1 << adec_type_gaac,
144     adec_capa_dra = 1<< adec_type_dra,
145     adec_capa_reserved = 1 << adec_type_reserved,
146 } adec_capability;
147 
148 typedef enum
149 {
150     aenc_type_dummy,
151     aenc_type_mpeg,
152     aenc_type_ac3,
153     aenc_type_dts,
154 
155     aenc_type_reserved = 0x1F,
156 } aenc_type;
157 
158 typedef enum
159 {
160     aenc_capa_mpeg = 1 << aenc_type_mpeg,
161     aenc_capa_ac3  = 1 << aenc_type_ac3,
162     aenc_capa_dts  = 1 << aenc_type_dts,
163 
164     aenc_capa_reserved = 1 << aenc_type_reserved,
165 } aenc_capability;
166 
167 typedef enum
168 {
169     aase_type_dummy,
170     aase_type_srs,
171     aase_type_srsTshd,
172     aase_type_srsApollo,
173     aase_type_srsTheater,
174 
175     aase_type_customer  = 0x1E,
176     aase_type_reserverd = 0x1F,
177 } aase_type;
178 
179 typedef enum
180 {
181     aase_capa_srs     = 1 << aase_type_srs,
182     aase_capa_srsTshd = 1 << aase_type_srsTshd,
183     aase_capa_srsApollo = 1 << aase_type_srsApollo,
184     aase_capa_srsTheater = 1 << aase_type_srsTheater,
185 
186     aase_capa_customer= 1 << aase_type_customer,
187     aase_capa_reserved= 1 << aase_type_reserverd,
188 } aase_capability;
189 
190 typedef enum
191 {
192     adec_ctrl_stop,
193     adec_ctrl_play,
194     adec_ctrl_pause,
195     adec_ctrl_ff2x,
196     adec_ctrl_ff4x,
197 } adec_ctrl;
198 
199 typedef enum
200 {
201     aenc_ctrl_stop,
202     aenc_ctrl_play,
203 } aenc_ctrl;
204 
205 typedef enum
206 {
207     adec_mode_stereo,
208     adec_mode_LL,
209     adec_mode_RR,
210     adec_mode_mixed,
211 
212 } adec_sound_mode;
213 
214 typedef enum
215 {
216     adec_drc_lineMode,
217     adec_drc_RfMode,
218 } adec_drcMode;
219 
220 typedef enum
221 {
222     adec_dmx_LoRo,
223     adec_dmx_LtRt,
224 
225 } adec_dmxMode;
226 
227 typedef enum
228 {
229     adec_unlocked,
230     adec_locked,
231     adec_ip_check_fail,
232 
233 } adec_status;
234 
235 typedef enum
236 {
237     adec_ch_mono,
238     adec_ch_dual_mono,
239     adec_ch_joint_stereo,
240     adec_ch_stereo,
241     adec_ch_multi,
242     adec_ch_unknown,
243 } adec_acmod;
244 
245 typedef enum
246 {
247     DRA_ACMOD_MONO, //for DRA mono (DRA 1.0)
248     DRA_ACMOD_STEREO, //for DRA stereo (DRA 2.0)
249     DRA_ACMOD_2_1, //for DRA 2.1
250     DRA_ACMOD_3_0, //for DRA 3.0
251     DRA_ACMOD_3_1, //for DRA 3.1
252     DRA_ACMOD_4_0, //for DRA 4.0
253     DRA_ACMOD_4_1, //for DRA 4.1
254     DRA_ACMOD_5_0, //for DRA 5.0
255     DRA_ACMOD_5_1, //for DRA 5.1
256 } dra_acmod;
257 
258 typedef enum
259 {
260     adec_smpRate_48K,
261     adec_smpRate_44K,
262     adec_smpRate_32K,
263 } adec_smpRate;
264 
265 typedef enum
266 {
267     ADEC1   = 0x00,     //audio decoder 1
268     ADEC2   = 0x01,     //audio decoder 2
269     ADEC3   = 0x02,     //audio decoder 3
270 
271     ABSE    = 0x00,     //audio basic sound effect
272 
273     AASE1   = 0x00,     //audio advanced sound effect 1
274     AASE2   = 0x01,     //audio advanced sound effect 2
275     AASE3   = 0x02,     //audio advanced sound effect 3
276 
277     AIO     = 0x00,     //audio IO
278 } Audio_id;
279 
280 typedef enum
281 {
282     R2_DMAreader1   = 0x00,     //audio decoder dma reader 1
283     R2_DMAreader2   = 0x01,     //audio decoder dma reader 2
284     R2_DMAreaderMAX   = 0xff,     //audio decoder_max
285 } R2_DMA_reader_id;
286 
287 typedef enum
288 {
289         //***********************************************
290         //  Audio decoder param
291         //***********************************************
292         AUR2_CommParam_ADEC_PTS_input = 0x0000,
293         AUR2_CommParam_ADEC_updateEsWritePtr,
294         AUR2_CommParam_ADEC_UNI_setOutput,
295 
296         AUR2_CommParam_ADEC_UNI_set_SPDIF_RdPtr,
297         AUR2_CommParam_ADEC_UNI_set_DMAReader_PCM_Level,
298         AUR2_CommParam_ADEC_UNI_set_HDMI_RdPtr,
299 
300         AUR2_CommParam_ADEC_mpeg_xxxx = 0x0100,
301         AUR2_CommParam_ADEC_mpeg_xxxx2,
302 
303         AUR2_CommParam_ADEC_ac3_xxxx = 0x0200,
304         AUR2_CommParam_ADEC_ac3_xxxx2,
305 
306         AUR2_CommParam_ADEC_aac_xxxx = 0x0300,
307         AUR2_CommParam_ADEC_aac_xxxx2,
308 
309         AUR2_CommParam_ADEC_aacp_xxxx = 0x0400,
310         AUR2_CommParam_ADEC_aacp_xxxx2,
311 
312         AUR2_CommParam_ADEC_wma_xxxx = 0x0500,
313         AUR2_CommParam_ADEC_wma_xxxx2,
314 
315     AUR2_CommParam_ADEC_lastcmd = 0x3FFF,
316 
317     //***********************************************
318     //  Advanced sound effect
319     //***********************************************
320     AUR2_CommParam_AASE_setAaseType = 0x4000,
321     AUR2_CommParam_AASE_enableAase,
322 
323         AUR2_CommParam_AASE_SRSHD_HdEn  = 0x4100,
324         AUR2_CommParam_AASE_SRSHD_truBassEn,
325         AUR2_CommParam_AASE_SRSHD_definitionEn,
326         AUR2_CommParam_AASE_SRSHD_dialogClarityEn,
327         AUR2_CommParam_AASE_SRSHD_inputMode,
328         AUR2_CommParam_AASE_SRSHD_outputMode,
329         AUR2_CommParam_AASE_SRSHD_spkrSize,
330         AUR2_CommParam_AASE_SRSHD_truBassCtrl,
331         AUR2_CommParam_AASE_SRSHD_definitionCtrl,
332         AUR2_CommParam_AASE_SRSHD_focusCtrl,
333         AUR2_CommParam_AASE_SRSHD_surrLevel,
334         AUR2_CommParam_AASE_SRSHD_inputGain,
335         AUR2_CommParam_AASE_SRSHD_outputGain,
336 
337         AUR2_CommParam_AASE_SRS_Apollo_processEn    = 0x4200,
338         AUR2_CommParam_AASE_SRS_Apollo_InputGain,
339         AUR2_CommParam_AASE_SRS_Apollo_OutputGain,
340         AUR2_CommParam_AASE_SRS_Apollo_BypassGain,
341         AUR2_CommParam_AASE_SRS_Apollo_HeadroomGain,
342         AUR2_CommParam_AASE_SRS_Apollo_HdEn = 0x4210,
343         AUR2_CommParam_AASE_SRS_Apollo_HdOutputMode,
344         AUR2_CommParam_AASE_SRS_Apollo_HdSndLevelCtrl,
345         AUR2_CommParam_AASE_SRS_Apollo_HdInputGain,
346         AUR2_CommParam_AASE_SRS_Apollo_HdOutputGain,
347         AUR2_CommParam_AASE_SRS_Apollo_HdBypassGain,
348         AUR2_CommParam_AASE_SRS_Apollo_HddialogClarityEn = 0x4220,
349         AUR2_CommParam_AASE_SRS_Apollo_HddialogClarityCtrl,
350         AUR2_CommParam_AASE_SRS_Apollo_HddefintionEn = 0x4230,
351         AUR2_CommParam_AASE_SRS_Apollo_HddefintionCtrl,
352         AUR2_CommParam_AASE_SRS_Apollo_HdtruBassEn = 0x4240,
353         AUR2_CommParam_AASE_SRS_Apollo_HdtruBassProcessMode,
354         AUR2_CommParam_AASE_SRS_Apollo_HdtruBassFrontCtrl,
355         AUR2_CommParam_AASE_SRS_Apollo_HdtruBassSpkSize,
356         AUR2_CommParam_AASE_SRS_Apollo_hardlimiterEn = 0x4250,
357         AUR2_CommParam_AASE_SRS_Apollo_hardlimiterCtrl,
358         AUR2_CommParam_AASE_SRS_Apollo_hardlimiterdelaylength,
359         AUR2_CommParam_AASE_SRS_Apollo_hardlimiterBoost,
360         AUR2_CommParam_AASE_SRS_Apollo_truvolumeEn = 0x4260,
361         AUR2_CommParam_AASE_SRS_Apollo_truvolRefLevel,
362         AUR2_CommParam_AASE_SRS_Apollo_truvolspkSize,
363         AUR2_CommParam_AASE_SRS_Apollo_truvolInputGain,
364         AUR2_CommParam_AASE_SRS_Apollo_truvolOutGain,
365         AUR2_CommParam_AASE_SRS_Apollo_truvolMaxGain,
366         AUR2_CommParam_AASE_SRS_Apollo_truvolBlockSize,
367         AUR2_CommParam_AASE_SRS_Apollo_truvolnoiseManagerEn = 0x4270,
368         AUR2_CommParam_AASE_SRS_Apollo_truvolnoiseManagerThd,
369         AUR2_CommParam_AASE_SRS_Apollo_truvolCalibrate,
370         AUR2_CommParam_AASE_SRS_Apollo_PEQleftEn = 0x4280,
371         AUR2_CommParam_AASE_SRS_Apollo_PEQleftnumBands,
372         AUR2_CommParam_AASE_SRS_Apollo_PEQleftBandEn = 0x4290,
373         AUR2_CommParam_AASE_SRS_Apollo_PEQrightEn = 0x42A0,
374         AUR2_CommParam_AASE_SRS_Apollo_PEQrightnumBands,
375         AUR2_CommParam_AASE_SRS_Apollo_PEQrightBandEn = 0x42B0,
376         AUR2_CommParam_AASE_SRS_Apollo_HPFEn = 0x42C0,
377         AUR2_CommParam_AASE_SRS_Apollo_GEQEn = 0x42D0,
378         AUR2_CommParam_AASE_SRS_Apollo_GEQBandGain1,
379         AUR2_CommParam_AASE_SRS_Apollo_GEQBandGain2,
380         AUR2_CommParam_AASE_SRS_Apollo_GEQBandGain3,
381         AUR2_CommParam_AASE_SRS_Apollo_GEQBandGain4,
382         AUR2_CommParam_AASE_SRS_Apollo_GEQBandGain5,
383         AUR2_CommParam_AASE_SRS_Apollo_trudialogEn = 0x42E0,
384         AUR2_CommParam_AASE_SRS_Apollo_trudialogInputGain,
385         AUR2_CommParam_AASE_SRS_Apollo_trudialogOutputGain,
386         AUR2_CommParam_AASE_SRS_Apollo_trudialogProcessGain,
387         AUR2_CommParam_AASE_SRS_Apollo_trudialogClarityEn = 0x42F0,
388         AUR2_CommParam_AASE_SRS_Apollo_trudialogClarityGain,
389         AUR2_CommParam_AASE_SRS_Apollo_trudialogClarityThreshold,
390 
391         AUR2_CommParam_AASE_SRS_Theater_processEn    = 0x4300,
392         AUR2_CommParam_AASE_SRS_Theater_InputGain,
393         AUR2_CommParam_AASE_SRS_Theater_OutputGain,
394         AUR2_CommParam_AASE_SRS_Theater_BypassGain,
395         AUR2_CommParam_AASE_SRS_Theater_HeadroomGain,
396         AUR2_CommParam_AASE_SRS_Theater_InputMode,
397         AUR2_CommParam_AASE_SRS_Theater_CC3D_Process_Path,
398         AUR2_CommParam_AASE_SRS_Theater_HPFEn = 0x4310,
399         AUR2_CommParam_AASE_SRS_Theater_truvolHDEn = 0x4320,
400         AUR2_CommParam_AASE_SRS_Theater_truvolHDInputGain,
401         AUR2_CommParam_AASE_SRS_Theater_truvolHDOutGain,
402         AUR2_CommParam_AASE_SRS_Theater_truvolHDBypassGain,
403         AUR2_CommParam_AASE_SRS_Theater_truvolHDMode,
404         AUR2_CommParam_AASE_SRS_Theater_truvolHDMaxGainControl,
405         AUR2_CommParam_AASE_SRS_Theater_truvolHDNormalizerEnable,
406         AUR2_CommParam_AASE_SRS_Theater_truvolHDNormThresh,
407         AUR2_CommParam_AASE_SRS_Theater_truvolHDSmoothEnable,
408         AUR2_CommParam_AASE_SRS_Theater_truvolHDLKFS,
409         AUR2_CommParam_AASE_SRS_Theater_CSEn = 0x4330,
410         AUR2_CommParam_AASE_SRS_Theater_CSInputGain,
411         AUR2_CommParam_AASE_SRS_Theater_CSProcessingMode,
412         AUR2_CommParam_AASE_SRS_Theater_CSLROutputGain,
413         AUR2_CommParam_AASE_SRS_Theater_CSLsRsOutputGain,
414         AUR2_CommParam_AASE_SRS_Theater_CSCenterOutputGain,
415         AUR2_CommParam_AASE_SRS_Theater_trudialogEn = 0x4340,
416         AUR2_CommParam_AASE_SRS_Theater_trudialogInputGain,
417         AUR2_CommParam_AASE_SRS_Theater_trudialogOutputGain,
418         AUR2_CommParam_AASE_SRS_Theater_trudialogBypassGain,
419         AUR2_CommParam_AASE_SRS_Theater_trudialogProcessGain,
420         AUR2_CommParam_AASE_SRS_Theater_trudialogClarityGain,
421 
422         AUR2_CommParam_AASE_SRS_Theater_TSHD_En = 0x4350,
423         AUR2_CommParam_AASE_SRS_Theater_tshd_input_gain,
424         AUR2_CommParam_AASE_SRS_Theater_tshd_output_gain,
425         AUR2_CommParam_AASE_SRS_Theater_TSHD_Sur_En = 0x4360,
426         AUR2_CommParam_AASE_SRS_Theater_tshd_surround_level_ctrl,
427         AUR2_CommParam_AASE_SRS_Theater_TSHD_Definition_En = 0x4370,
428         AUR2_CommParam_AASE_SRS_Theater_tshd_definition_ctrl,
429         AUR2_CommParam_AASE_SRS_Theater_TSHD_DialogClarity_En = 0x4380,
430         AUR2_CommParam_AASE_SRS_Theater_tshd_dialog_clarity_ctrl,
431         AUR2_CommParam_AASE_SRS_Theater_TSHD_TrubassFront_En = 0x4390,
432         AUR2_CommParam_AASE_SRS_Theater_tshd_trubass_front_ctrl,
433         AUR2_CommParam_AASE_SRS_Theater_TSHD_Trubass_level_indep_En = 0x43A0,
434         AUR2_CommParam_AASE_SRS_Theater_tshd_trubass_speaker_size,
435         AUR2_CommParam_AASE_SRS_Theater_tshd_trubass_compressor_ctrl,
436         AUR2_CommParam_AASE_SRS_Theater_tshd_trubass_process_mode,
437         AUR2_CommParam_AASE_SRS_Theater_tshd_trubass_speaker_audio,
438         AUR2_CommParam_AASE_SRS_Theater_tshd_trubass_speaker_analysis,
439         AUR2_CommParam_AASE_SRS_Theater_HPF_End_En = 0x43B0,
440         AUR2_CommParam_AASE_SRS_Theater_HL_En = 0x43C0,
441         AUR2_CommParam_AASE_SRS_Theater_HL_limit_ctrl,
442         AUR2_CommParam_AASE_SRS_Theater_HL_boost_gain,
443 
444         AUR2_CommParam_AASE_SRS_Theater_CC3D_En = 0x43D0,
445         AUR2_CommParam_AASE_SRS_Theater_CC3D_DepthProcessing_En,
446         AUR2_CommParam_AASE_SRS_Theater_CC3D_3DSurroundBoost_En,
447         AUR2_CommParam_AASE_SRS_Theater_CC3D_TSHD_Mix_En,
448         AUR2_CommParam_AASE_SRS_Theater_CC3D_Fade_En,
449         AUR2_CommParam_AASE_SRS_Theater_CC3D_InputGain,
450         AUR2_CommParam_AASE_SRS_Theater_CC3D_OutputGain,
451         AUR2_CommParam_AASE_SRS_Theater_CC3D_BypassGain,
452         AUR2_CommParam_AASE_SRS_Theater_CC3D_TSHD_SurMode,
453         AUR2_CommParam_AASE_SRS_Theater_CC3D_TSHD_MixFadeCtrl,
454         AUR2_CommParam_AASE_SRS_Theater_CC3D_Aperture,
455         AUR2_CommParam_AASE_SRS_Theater_CC3D_GainLimit,
456         AUR2_CommParam_AASE_SRS_Theater_CC3D_FFDepth,
457         AUR2_CommParam_AASE_SRS_Theater_CC3D_NFDepth,
458         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDx_En = 0x43E0,
459         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxInputGain,
460         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxBassLevel,
461         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxSpeakerSize,
462         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxMode,
463         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxDynamics,
464         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxHPOrder,
465         AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxCustomFilter,
466         //AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxHighPassRatio,
467         //AUR2_CommParam_AASE_SRS_Theater_CC3D_TBHDxExtendedBass,
468 
469         AUR2_CommParam_AASE_SRS_Theater_GEQ_5B_En = 0x43F0,
470         AUR2_CommParam_AASE_Wall_Filter_En,
471         AUR2_CommParam_AASE_SRS_Theater_CC3D_GEQ_input_gain,
472         AUR2_CommParam_AASE_SRS_Theater_CC3D_GEQ_gain_band0,
473         AUR2_CommParam_AASE_SRS_Theater_CC3D_GEQ_gain_band1,
474         AUR2_CommParam_AASE_SRS_Theater_CC3D_GEQ_gain_band2,
475         AUR2_CommParam_AASE_SRS_Theater_CC3D_GEQ_gain_band3,
476         AUR2_CommParam_AASE_SRS_Theater_CC3D_GEQ_gain_band4,
477 
478         AUR2_CommParam_AASE_VDS_xxxx    = 0x4400,
479         AUR2_CommParam_AASE_VDS_xxxx2,
480         AUR2_CommParam_AASE_VDS_xxxx3,
481 
482         AUR2_CommParam_AASE_VSPK_xxxx    = 0x4500,
483         AUR2_CommParam_AASE_VSPK_xxxx2,
484         AUR2_CommParam_AASE_VSPK_xxxx3,
485 
486         AUR2_CommParam_AASE_PL2_xxxx    = 0x4600,
487         AUR2_CommParam_AASE_PL2_xxxx2,
488         AUR2_CommParam_AASE_PL2_xxxx3,
489 
490         AUR2_CommParam_AASE_DtsSymmetry_xxxx = 0x4700,
491         AUR2_CommParam_AASE_DtsSymmetry_xxxx2,
492 
493         AUR2_CommParam_AASE_CV3_xxxx = 0x4800,
494         AUR2_CommParam_AASE_CV3_xxxx2,
495 
496         AUR2_CommParam_AASE_CV4_xxxx = 0x4900,
497         AUR2_CommParam_AASE_CV4_xxxx2,
498 
499         AUR2_CommParam_AASE_SONICEMOTION_ABS3D_SET_PARAMS = 0x4B00,
500         AUR2_CommParam_AASE_SONICEMOTION_ABS3D_GET_PARAMS_R2_ADDR = 0x4B00,
501         AUR2_CommParam_AASE_SONICEMOTION_ABS3D_GET_PARAMS_SIZE = 0x4B01,
502 
503         AUR2_CommParam_AASE_CUSFUNC_xxxx  = 0x7E00,
504         AUR2_CommParam_AASE_CUSFUNC_xxxx2,
505         AUR2_CommParam_AASE_CUSFUNC_xxxx3,
506 
507     AUR2_CommParam_AASE_lastcmd = 0x7FFF,
508 
509     //***********************************************
510     //  Basic sound effect
511     //***********************************************
512     AUR2_CommParam_ABSE_Volume  =         0x8000,
513     AUR2_CommParam_ABSE_Prescale,
514     AUR2_CommParam_ABSE_Treble,
515     AUR2_CommParam_ABSE_Bass,
516     AUR2_CommParam_ABSE_EQ,
517 
518     AUR2_CommParam_ABSE_lastcmd = 0x8FFF,
519 
520     //***********************************************
521     //  Encoder
522     //***********************************************
523     AUR2_CommParam_AENC_setEncoder  =  0x9000,
524     AUR2_CommParam_AENC_audioCtrl,
525 
526     AUR2_CommParam_AENC_lastcmd = 0x9FFF,
527 
528     //***********************************************
529     //  IO
530     //***********************************************
531     AUR2_CommParam_AIO_spdifMode =        0xA000,
532 
533     AUR2_CommParam_AIO_lastcmd = 0xAFFF,
534 
535     //***********************************************
536     //  Others
537     //***********************************************
538     AUR2_CommParam_Misc_country   = 0xB000,
539 
540 } R2_AudioParamType;
541 
542 typedef enum
543 {
544     //***********************************************
545     //  Audio decoder param
546     //***********************************************
547     AUR2_CommInfo_ADEC_capability,
548     AUR2_CommInfo_ADEC_audioType,
549     AUR2_CommInfo_ADEC_audioCtrl,
550     AUR2_CommInfo_ADEC_decStatus,
551     AUR2_CommInfo_ADEC_esLevel,
552     AUR2_CommInfo_ADEC_pcmLevel,
553     AUR2_CommInfo_ADEC_33bitPts,
554     AUR2_CommInfo_ADEC_33Bit_stcPts_DIFF,
555     AUR2_CommInfo_ADEC_acmode,
556     AUR2_CommInfo_ADEC_DualCtrl,
557     AUR2_CommInfo_ADEC_SoundMode,
558     AUR2_CommInfo_ADEC_dmxMode,
559     AUR2_CommInfo_ADEC_drcMode,
560     AUR2_CommInfo_ADEC_drcHighCut,
561     AUR2_CommInfo_ADEC_drcLowBosst,
562     AUR2_CommInfo_ADEC_ok_frmCnt,
563     AUR2_CommInfo_ADEC_err_frmCnt,
564     AUR2_CommInfo_ADEC_sampleRate,
565     AUR2_CommInfo_ADEC_bitRate,
566 
567         AUR2_CommInfo_ADEC_mpeg_xxxx = 0x0100,
568         AUR2_CommInfo_ADEC_mpeg_xxxx2,
569 
570         AUR2_CommInfo_ADEC_ac3_xxxx = 0x0200,
571         AUR2_CommInfo_ADEC_ac3_xxxx2,
572 
573         AUR2_CommInfo_ADEC_aac_xxxx = 0x0300,
574         AUR2_CommInfo_ADEC_aac_xxxx2,
575 
576         AUR2_CommInfo_ADEC_aacp_xxxx = 0x0400,
577         AUR2_CommInfo_ADEC_aacp_xxxx2,
578 
579     AUR2_CommInfo_ADEC_lastcmd = 0x3FFF,
580 
581     //***********************************************
582     //  Advanced sound effect
583     //***********************************************
584     AUR2_CommInfo_AASE_AaseType = 0x4000,
585 
586         AUR2_CommInfo_AASE_SRS_xxxx      = 0x4100,
587         AUR2_CommInfo_AASE_SRS_xxxx2,
588         AUR2_CommInfo_AASE_SRS_xxxx3,
589 
590         AUR2_CommInfo_AASE_SRSHD_xxxx    = 0x4200,
591         AUR2_CommInfo_AASE_SRSHD_xxxx2,
592         AUR2_CommInfo_AASE_SRSHD_xxxx3,
593 
594         AUR2_CommInfo_AASE_SRS_Apollo_xxxx    = 0x4300,
595         AUR2_CommInfo_AASE_SRS_Apollo_xxxx2,
596         AUR2_CommInfo_AASE_SRS_Apollo_xxxx3,
597 
598         AUR2_CommInfo_AASE_VDS_xxxx    = 0x4400,
599         AUR2_CommInfo_AASE_VDS_xxxx2,
600         AUR2_CommInfo_AASE_VDS_xxxx3,
601 
602         AUR2_CommInfo_AASE_VSPK_xxxx    = 0x4500,
603         AUR2_CommInfo_AASE_VSPK_xxxx2,
604         AUR2_CommInfo_AASE_VSPK_xxxx3,
605 
606         AUR2_CommInfo_AASE_PL2_xxxx    = 0x4600,
607         AUR2_CommInfo_AASE_PL2_xxxx2,
608         AUR2_CommInfo_AASE_PL2_xxxx3,
609 
610         AUR2_CommInfo_AASE_DtsSymmetry_xxxx = 0x4700,
611         AUR2_CommInfo_AASE_DtsSymmetry_xxxx2,
612 
613         AUR2_CommInfo_AASE_CV3_xxxx = 0x4800,
614         AUR2_CommInfo_AASE_CV3_xxxx2,
615 
616         AUR2_CommInfo_AASE_CV4_xxxx = 0x4900,
617         AUR2_CommInfo_AASE_CV4_xxxx2,
618 
619         AUR2_CommInfo_AASE_CUSFUNC_xxxx  = 0x7E00,
620         AUR2_CommInfo_AASE_CUSFUNC_xxxx2,
621         AUR2_CommInfo_AASE_CUSFUNC_xxxx3,
622 
623     AUR2_CommInfo_AASE_lastcmd = 0x7FFF,
624 
625     //***********************************************
626     //  Basic sound effect
627     //***********************************************
628     AUR2_CommInfo_ABSE_Volume  =         0x8000,
629     AUR2_CommInfo_ABSE_Prescale,
630     AUR2_CommInfo_ABSE_Treble,
631     AUR2_CommInfo_ABSE_Bass,
632     AUR2_CommInfo_ABSE_EQ,
633 
634     AUR2_CommInfo_ABSE_lastcmd = 0x8FFF,
635 
636     //***********************************************
637     //  Encoder
638     //***********************************************
639     AUR2_CommInfo_AENC_xxxx  =  0x9000,
640     AUR2_CommInfo_AENC_xxxx2,
641 
642     AUR2_CommInfo_AENC_lastcmd = 0x9FFF,
643 
644     //***********************************************
645     //  IO
646     //***********************************************
647     AUR2_CommInfo_AIO_xxxx =        0xA000,
648 
649     AUR2_CommInfo_AIO_lastcmd = 0xAFFF,
650 
651     //***********************************************
652     //  Others
653     //***********************************************
654     AUR2_CommInfo_Misc_country   = 0xB000,
655 
656 } R2_AudioInfoType;
657 
658 typedef enum
659 {
660     R2_SHM_INFO_CAPABILITY,
661     R2_SHM_INFO_DEC_STAUS,
662     R2_SHM_INFO_DEC_ERROR_ID,
663     R2_SHM_INFO_SMP_RATE,
664     R2_SHM_INFO_SPDIFTx_SMP_RATE,
665     R2_SHM_INFO_HDMITx_SMP_RATE,
666     R2_SHM_INFO_BIT_RATE,
667     R2_SHM_INFO_SYNTH_RATE,
668     R2_SHM_INFO_DEC_CHANNEL_MODE,
669     R2_SHM_INFO_DEC_CHANNEL_MAPPING,
670 
671     R2_SHM_INFO_ES_LEVEL,
672     R2_SHM_INFO_PCM_LEVEL,
673     R2_SHM_INFO_ES_RD_PTR,
674     R2_SHM_INFO_PCM_WR_PTR,
675     R2_SHM_INFO_MM_FILE_REQ_SIZE,
676 
677     R2_SHM_INFO_ACCUM_ES_BYTECNT,
678     R2_SHM_INFO_WAIT_1STPTS_CNT,
679     R2_SHM_INFO_WAIT_STC_CNT,
680     R2_SHM_INFO_SMP_FLUSH_CNT,
681 
682     R2_SHM_INFO_AVSYNC_STATE,
683     R2_SHM_INFO_AVSYNC_FREERUN_TYPE,
684     R2_SHM_INFO_AVSYNC_OFFSET,
685     R2_SHM_INFO_AVSYNC_MMTsSyncFlag,
686 
687     R2_SHM_INFO_PTS_TAG_WR_IDX,
688     R2_SHM_INFO_PTS_TAG_RD_IDX,
689 
690     R2_SHM_INFO_PLAY_STATE,
691     R2_SHM_INFO_DEC_TYPE,
692     R2_SHM_INFO_PLAYSMPFLAG,
693     R2_SHM_INFO_DEC_CALLING_CNT,
694     R2_SHM_INFO_RECEIVE_STOP_CNT,
695 
696     R2_SHM_INFO_OK_FRMCNT,
697     R2_SHM_INFO_ERR_FRMCNT,
698     R2_SHM_INFO_SKIP_FRMCNT,
699     R2_SHM_INFO_REPT_FRMCNT,
700     R2_SHM_INFO_SYNC_MISS_CNT,
701     R2_SHM_INFO_PCM_EMPTY_CNT,
702 
703     R2_SHM_INFO_STC,
704     R2_SHM_INFO_PTS,
705     R2_SHM_INFO_CURR_PTS,
706     R2_SHM_INFO_TD,
707     R2_SHM_INFO_PTS_LATENCY,
708 
709     R2_SHM_INFO_UNI_DECODE_DONE_CNT,
710     R2_SHM_INFO_UNI_DECODE_DONE_PCM_ADDR,
711     R2_SHM_INFO_UNI_DECODE_DONE_PCM_SIZE,
712 
713     R2_SHM_INFO_PCM_ADDR,
714     R2_SHM_INFO_PCM_SIZE,
715 
716     R2_SHM_INFO_spdifbuf_LEVEL,
717     R2_SHM_INFO_spdifbuf_WR_PTR,
718 
719     R2_SHM_INFO_HDMIbuf_LEVEL,
720     R2_SHM_INFO_HDMIbuf_WR_PTR,
721     R2_SHM_INFO_HDMIbuf_HBR,
722 
723     R2_SHM_INFO_DOLBY_DEC_TYPE,
724     R2_SHM_INFO_DOLBY_FRAME_SIZE,
725     R2_SHM_INFO_DOLBY_BS_MODE,
726     R2_SHM_INFO_DOLBY_AAC_TYPE,
727 
728     R2_SHM_INFO_DTS_CD_MODE,
729     R2_SHM_INFO_DTS_PCM_FRAME_SIZE,
730     R2_SHM_INFO_DTS_ES_TYPE,
731 
732     R2_SHM_INFO_MPEG_LAYER,
733     R2_SHM_INFO_MPEG_STEREOMODE,
734     R2_SHM_INFO_MPEG_HEADER,
735 
736     R2_SHM_INFO_UNSUPPORT_TYPE,
737 
738     R2_SHM_INFO_TRANSCODE_FLAG,
739 
740     R2_SHM_INFO_PCM_OUTPUT_CHANNEL,
741 
742     R2_SHM_INFO_OMX_NO_MIXING,
743     R2_SHM_INFO_OMX_ES_BYPASS,
744     R2_SHM_INFO_SECURITY_INFO,
745 } R2_SHM_INFO_TYPE;
746 
747 typedef enum
748 {
749     R2_SHM_PARAM_ES_WR_PTR,
750     R2_SHM_PARAM_MPG_AVOFFSET,
751     R2_SHM_PARAM_AC3_AVOFFSET,
752     R2_SHM_PARAM_AAC_AVOFFSET,
753 
754     R2_SHM_PARAM_DOLBY_DRC_MODE,
755     R2_SHM_PARAM_DOLBY_RF_MODE,
756     R2_SHM_PARAM_DOLBY_DMX_MODE,
757     R2_SHM_PARAM_DOLBY_HIGH_CUT,
758     R2_SHM_PARAM_DOLBY_LOW_BOOST,
759     R2_SHM_PARAM_DOLBY_GAIN,
760     R2_SHM_PARAM_DOLBY_MUL_FRAME_HEADER,
761     R2_SHM_PARAM_DOLBY_DDP_HDMI_BYPASS,
762     R2_SHM_PARAM_DOLBY_AAC_BYPASS,
763     R2_SHM_PARAM_DOLBY_TB11_ENABLE,
764     R2_SHM_PARAM_DOLBY_MIXER_BALANCE,
765 
766     R2_SHM_PARAM_PARSER_SPEC,
767     R2_SHM_PARAM_PARSER_PES_BYPASS,
768     R2_SHM_PARAM_PARSER_PUSI_DISABLE,
769     R2_SHM_PARAM_REPORT_MM_TS_PTS_WITH_MSB,
770     R2_SHM_PARAM_MM_TS_SYNC_STC,
771     R2_SHM_PARAM_MM_FF2X,
772     R2_SHM_PARAM_MM_TRICK,
773     R2_SHM_PARAM_DECODE_MUTE,
774     R2_SHM_PARAM_SOUND_MODE,
775     R2_SHM_PARAM_EXT_SMPRATE_CTRL,
776 
777     R2_SHM_PARAM_MM_FILE_REQ_SIZE,
778     R2_SHM_PARAM_MM_INPUT_PTS,
779 
780     R2_SHM_PARAM_UNI_PCM_SET_OUTPUT_CNT,
781     R2_SHM_PARAM_UNI_SETUP_DECODE_FRMCNT,
782     R2_SHM_PARAM_ES2_WR_PTR,
783 
784     R2_SHM_PARAM_OMX_SPDIF_CTRL,
785     R2_SHM_PARAM_OMX_SPDIF_PCM_LEVEL,
786 
787     R2_SHM_PARAM_MAIN_VOLUME,
788     R2_SHM_PARAM_MAIN_VOLUME_MUTE,
789     R2_SHM_PARAM_AD_VOLUME,
790     R2_SHM_PARAM_AD_VOLUME_MUTE,
791 
792     R2_SHM_PARAM_MPEG_SOUNDMODE,
793     R2_SHM_PARAM_MPEG_GAIN,
794 
795     R2_SHM_PARAM_COOK_NUMCODECS,
796     R2_SHM_PARAM_COOK_SAMPLES,
797     R2_SHM_PARAM_COOK_SAMPLERATES,
798     R2_SHM_PARAM_COOK_CHANNELS,
799     R2_SHM_PARAM_COOK_REGIONS,
800     R2_SHM_PARAM_COOK_CPLSTART,
801     R2_SHM_PARAM_COOK_CPLQBITS,
802     R2_SHM_PARAM_COOK_FRAMESIZE,
803 
804     R2_SHM_PARAM_DTS_DMX_LFE_ENABLE,
805     R2_SHM_PARAM_DTS_DMX_MODE,
806     R2_SHM_PARAM_DTS_HD_HDMI_BYPASS,
807 
808     R2_SHM_PARAM_ASF_VERSION,
809     R2_SHM_PARAM_ASF_CHANNELS,
810     R2_SHM_PARAM_ASF_SAMPLERATE,
811     R2_SHM_PARAM_ASF_BYTERATE,
812     R2_SHM_PARAM_ASF_BLOCKALIGN,
813     R2_SHM_PARAM_ASF_ENCOPT,
814     R2_SHM_PARAM_ASF_PARSINGBYAPP,
815     R2_SHM_PARAM_ASF_BITS_PER_SAMPLE,
816     R2_SHM_PARAM_ASF_CHANNELMASK,
817     R2_SHM_PARAM_ASF_DRC_PARAM_EXIST,
818     R2_SHM_PARAM_ASF_DRC_RMS_AMP_REF,
819     R2_SHM_PARAM_ASF_DRC_RMS_AMP_TARGET,
820     R2_SHM_PARAM_ASF_DRC_PEAK_AMP_REF,
821     R2_SHM_PARAM_ASF_DRC_PEAK_AMP_TARGET,
822     R2_SHM_PARAM_ASF_MAX_PACKET_SIZE,
823 
824     R2_SHM_PARAM_XPCM_TYPE,
825     R2_SHM_PARAM_XPCM_CHANNELS,
826     R2_SHM_PARAM_XPCM_SAMPLERATES,
827     R2_SHM_PARAM_XPCM_BITS_PER_SAMPLE,
828     R2_SHM_PARAM_XPCM_BLOCK_SIZE,
829     R2_SHM_PARAM_XPCM_SAMPLE_PER_BLOCK,
830 
831     R2_SHM_PARAM_HASH_KEY,
832     R2_SHM_PARAM_SPDIF_TYPE,
833     R2_SHM_PARAM_VORBIS_HEADER_SIZE,
834 
835     R2_SHM_PARAM_TTS_EN,
836 
837     R2_SHM_PARAM_MULTI_CHANNEL,
838 
839     R2_SHM_PARAM_RFSIGNAL_TYPE,
840 
841     R2_SHM_PARAM_ES_Limiter_EN,
842     R2_SHM_PARAM_ES_Limiter_Threshold,
843     R2_SHM_PARAM_PCM_Limiter_EN,
844     R2_SHM_PARAM_PCM_Limiter_Threshold,
845     R2_SHM_PARAM_STC_SELECT,
846 
847     R2_SHM_PARAM_DAP_EN,
848     R2_SHM_PARAM_SPEAKER_EN,
849 	R2_SHM_PARAM_DDP_ENCODE_EN,
850 } R2_SHM_PARAM_TYPE;
851 
852 MS_U8   HAL_AUR2_ReadByte(MS_U32 u32RegAddr);
853 MS_U16  HAL_AUR2_ReadReg(MS_U32 u32RegAddr);
854 void    HAL_AUR2_WriteByte(MS_U32 u32RegAddr, MS_U8 u8Val);
855 void    HAL_AUR2_WriteReg(MS_U32 u32RegAddr, MS_U16 u16Val);
856 void    HAL_AUR2_WriteMaskByte(MS_U32 u32RegAddr, MS_U8 u8Mask, MS_U8 u8Val);
857 void    HAL_AUR2_WriteMaskReg(MS_U32 u32RegAddr, MS_U16 u16Mask, MS_U16 u16Val);
858 
859 void HAL_DEC_R2_EnableR2( MS_BOOL en );
860 void HAL_DEC_R2_init_SHM_param( void );
861 void HAL_DEC_R2_SetCommInfo(R2_AudioParamType infoType, Audio_id id, MS_U16 param1, MS_U16 param2);
862 MS_U32 HAL_DEC_R2_GetCommInfo(R2_AudioInfoType infoType, Audio_id id, MS_U16 param1, MS_U16 param2);
863 MS_U32 HAL_DEC_R2_Get_SHM_INFO(R2_SHM_INFO_TYPE decInfoType, MS_U8 dec_id );
864 MS_BOOL HAL_DEC_R2_Set_SHM_PARAM(R2_SHM_PARAM_TYPE decParamType, MS_U8 dec_id, MS_U32 param, MS_U32 param2 );
865 MS_U32 HAL_DEC_R2_Get_SHM_PARAM(R2_SHM_PARAM_TYPE decParamType, MS_U8 dec_id, MS_U32 param );
866 
867 void HAL_SND_R2_EnableR2( MS_BOOL en );
868 void HAL_SND_R2_SetCommInfo(R2_AudioParamType infoType, Audio_id id, MS_U16 param1, MS_U16 param2);
869 MS_U32 HAL_SND_R2_GetCommInfo(R2_AudioInfoType infoType, Audio_id id, MS_U16 param1, MS_U16 param2);
870 MS_U32 HAL_SND_R2_Get_SHM_INFO(R2_SHM_INFO_TYPE decInfoType, MS_U8 dec_id );
871 MS_BOOL HAL_SND_R2_Set_SHM_PARAM(R2_SHM_PARAM_TYPE decParamType, MS_U8 dec_id, MS_U32 param, MS_U32 param2 );
872 MS_U32 HAL_SND_R2_Get_SHM_PARAM(R2_SHM_PARAM_TYPE decParamType, MS_U8 dec_id, MS_U32 param );
873 
874 
875 #endif
876