blob: 4aad0eb2f63365d7b8ff474794f193b57f3b3c20 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001
2
3
4#if !defined(__SMART_PHONE_MODEM__)
5
6#include "kal_public_api.h"
7#include "kal_general_types.h"
8#include "reg_base.h"
9
10#include "dcl.h"
11
12#include "afe.h"
13
14#if defined(__ENABLE_SPEECH_DVT__)
15extern kal_bool Is_Sph_DVT_BT_Mode_NB(void);
16#endif // defined(__ENABLE_SPEECH_DVT__)
17
18#define WriteREG(_addr, _value) (*(volatile kal_uint32 *)(_addr) = (_value))
19
20
21// ----------------------------------------------------------------------------
22// Register Definition
23// ----------------------------------------------------------------------------
24
25
26// #define AP_AUDSYS_BASE 0xA1220000
27
28#define AUDIO_TOP_CON0 (BASE_MADDR_AUDIO + 0x0000)
29#define AUDIO_TOP_CON1 (BASE_MADDR_AUDIO + 0x0004)
30//#define AUDIO_TOP_CON2 (BASE_MADDR_AUDIO + 0x0008)
31#define AUDIO_TOP_CON3 (BASE_MADDR_AUDIO + 0x000C)
32#define AFE_DAC_CON0 (BASE_MADDR_AUDIO + 0x0010)
33#define AFE_DAC_CON1 (BASE_MADDR_AUDIO + 0x0014)
34#define AFE_I2S_CON (BASE_MADDR_AUDIO + 0x0018)
35#define AFE_DAIBT_CON0 (BASE_MADDR_AUDIO + 0x001C)
36
37#define AP_AFE_CONN0 (BASE_MADDR_AUDIO + 0x0020)
38#define AP_AFE_CONN1 (BASE_MADDR_AUDIO + 0x0024)
39#define AP_AFE_CONN2 (BASE_MADDR_AUDIO + 0x0028)
40#define AP_AFE_CONN3 (BASE_MADDR_AUDIO + 0x002C)
41#define AP_AFE_CONN4 (BASE_MADDR_AUDIO + 0x0030)
42#define AP_AFE_CONN5 (BASE_MADDR_AUDIO + 0x005C)
43#define AP_AFE_CONN6 (BASE_MADDR_AUDIO + 0x00BC)
44#define AP_AFE_CONN9 (BASE_MADDR_AUDIO + 0x0468)
45#define AP_AFE_CONN10 (BASE_MADDR_AUDIO + 0x046C)
46
47#define AFE_I2S_CON1 (BASE_MADDR_AUDIO + 0x0034)
48#define AFE_I2S_CON2 (BASE_MADDR_AUDIO + 0x0038)
49#define AFE_MRGIF_CON (BASE_MADDR_AUDIO + 0x003C)
50#define AFE_I2S_CON3 (BASE_MADDR_AUDIO + 0x004C)
51
52#define AFE_ADDA_DL_SRC2_CON0 (BASE_MADDR_AUDIO + 0x0108)
53#define AFE_ADDA_DL_SRC2_CON1 (BASE_MADDR_AUDIO + 0x010C)
54#define AFE_ADDA_UL_SRC_CON0 (BASE_MADDR_AUDIO + 0x0114)
55#define AFE_ADDA_UL_SRC_CON1 (BASE_MADDR_AUDIO + 0x0118)
56
57#define AFE_ADDA_UL_DL_CON0 (BASE_MADDR_AUDIO + 0x0124)
58#define AFE_ADDA_NEWIF_CFG0 (BASE_MADDR_AUDIO + 0x0138)
59#define AFE_ADDA_NEWIF_CFG1 (BASE_MADDR_AUDIO + 0x013C)
60
61
62//#define AFE_SIDDETONE_MON (BASE_MADDR_AUDIO + 0x01D4)
63//#define AFE_SIDDETONE_CON0 (BASE_MADDR_AUDIO + 0x01E0)
64//#define AFE_SIDDETONE_COEFF (BASE_MADDR_AUDIO + 0x01E4)
65#define AFE_SIDDETONE_CON1 (BASE_MADDR_AUDIO + 0x01E8)
66//#define AFE_SIDDETONE_GAIN (BASE_MADDR_AUDIO + 0x01EC)
67
68#define AFE_SGEN_CON0 (BASE_MADDR_AUDIO + 0x01F0)
69#define AFE_TOP_CON0 (BASE_MADDR_AUDIO + 0x0200)
70#define AFE_GAIN1_CON0 (BASE_MADDR_AUDIO + 0x0410)
71
72#define AFE_GAIN1_CONN (BASE_MADDR_AUDIO + 0x0420)
73
74#define AFE_GAIN2_CON0 (BASE_MADDR_AUDIO + 0x0428)
75#define AFE_GAIN2_CONN (BASE_MADDR_AUDIO + 0x0438)
76#define AFE_GAIN2_CONN2 (BASE_MADDR_AUDIO + 0x0440)
77#define AFE_GAIN2_CONN3 (BASE_MADDR_AUDIO + 0x0444)
78
79#define PCM_INTF_CON1 (BASE_MADDR_AUDIO + 0x0530)
80#define PCM_INTF_CON2 (BASE_MADDR_AUDIO + 0x0538)
81#define PCM_INTF_CON (BASE_MADDR_AUDIO + 0x053C)
82//#define FOC_ROM_SIG (BASE_MADDR_AUDIO + 0x0630)
83
84
85
86// ----------------------------------------------------------------------------
87// Register Setting for different scenario
88// ----------------------------------------------------------------------------
89
90
91void PMIC_AudioConfig(void)
92{
93//For ELBRUS bring-up, loopback DL to UL by MD-AFE, and we can't control AP-AFE and PMIC.
94#if 0
95/* under construction !*/
96/* under construction !*/
97/* under construction !*/
98/* under construction !*/
99#endif //#if 0
100}
101
102
103void ApAudSys_config(void)
104{
105//For ELBRUS bring-up, loopback DL to UL by MD-AFE, and we can't control AP-AFE and PMIC.
106#if 0
107/* under construction !*/
108/* under construction !*/
109/* under construction !*/
110#endif //#if 0
111}
112
113
114#else // !defined(__SMART_PHONE_MODEM__)
115
116void ApAudSys_config(void)
117{
118 ;
119}
120
121#endif // !defined(__SMART_PHONE_MODEM__)
122