huangcm
2025-04-26 bff3d3009b0d3a2be3ed92e4817fcabee9e76955
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/*
 * sound\soc\sunxi\sun8iw11codec.h
 * (C) Copyright 2014-2016
 * allwinner Technology Co., Ltd. <www.allwinnertech.com>
 * huangxin <huangxin@allwinnertech.com>
 *
 * some simple description for this code
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 */
#ifndef _SUN8IW17_CODEC_H
#define _SUN8IW17_CODEC_H
 
#define SUNXI_DAC_DPC        0x00
#define SUNXI_DAC_FIFO_CTR    0x10
#define SUNXI_DAC_FIFO_STA    0x14
/* left blank */
#define SUNXI_DAC_TXDATA    0X20
#define SUNXI_DAC_CNT        0x24
#define SUNXI_DAC_DG        0x28
#define    SUNXI_ADC_FIFO_CTR    0x30
#define SUNXI_ADC_FIFO_STA    0x38
#define SUNXI_ADC_RXDATA    0x40
/* left blank */
#define SUNXI_ADC_CNT        0x44
#define SUNXI_ADC_DG        0x4C
 
/*left blank */
#define SUNXI_DAC_DAP_CTR 0xf0
#define SUNXI_ADC_DAP_CTR 0xf8
#define SUNXI_ADC_DRC_HHPFC 0x200
#define SUNXI_ADC_DRC_LHPFC 0x204
 
/* Analog register base - Digital register base */
/*SUNXI_PR_CFG is to tear the acreg and dcreg, it is of no real meaning*/
#define SUNXI_PR_CFG        0x300
#define SUNXI_LOMIX_SRC        (SUNXI_PR_CFG + 0x01)
#define SUNXI_ROMIX_SRC        (SUNXI_PR_CFG + 0x02)
#define SUNXI_DAC_PA_SRC    (SUNXI_PR_CFG + 0x03)
#define SUNXI_LINEIN_GCTR    (SUNXI_PR_CFG + 0x04)
#define SUNXI_LINEINLR_MIC1_GCTR        (SUNXI_PR_CFG + 0x05)
#define SUNXI_MIC2_MIC3_GCTR    (SUNXI_PR_CFG + 0x06)
#define SUNXI_PHONEOUT_CTR    (SUNXI_PR_CFG + 0x07)
#define SUNXI_PHOMIX_MICBIAS_CTR    (SUNXI_PR_CFG + 0x08)
#define SUNXI_LINEOUT_VOL    (SUNXI_PR_CFG + 0x09)
#define SUNXI_MIC1B_LINEOUT_CTR  (SUNXI_PR_CFG + 0x0A)
#define SUNXI_MIC2B_MIC3B         (SUNXI_PR_CFG + 0x0B)
/* left blank */
#define SUNXI_LADCMIX_SRC    (SUNXI_PR_CFG + 0x0C)
#define SUNXI_RADCMIX_SRC    (SUNXI_PR_CFG + 0x0D)
#define SUNXI_XADCMIX_SRC        (SUNXI_PR_CFG + 0x0E)
#define SUNXI_ADC_AP_EN        (SUNXI_PR_CFG + 0x0F)
#define SUNXI_OP_CTR0        (SUNXI_PR_CFG + 0x10)
#define SUNXI_OP_CTR1        (SUNXI_PR_CFG + 0x11)
#define SUNXI_USB_BIAS_CTR        (SUNXI_PR_CFG + 0x12)
#define SUNXI_ADC_FUN_CTR    (SUNXI_PR_CFG + 0x13)
#define SUNXI_BIAS_DA16_CAL_CTR    (SUNXI_PR_CFG + 0x14)
#define SUNXI_DA16_CALI_DATA    (SUNXI_PR_CFG + 0x15)
/* left blank */
#define SUNXI_BIAS_CALI_DATA    (SUNXI_PR_CFG + 0x17)
#define SUNXI_BIAS_CALI_SET    (SUNXI_PR_CFG + 0x18)
 
/* SUNXI_DAC_DPC:0x00 */
#define EN_DAC            31
#define MODQU            25
#define DWA_EN            24
#define HPF_EN            18
#define DVOL            12
#define HUB_EN            0
 
/* SUNXI_DAC_FIFO_CTR:0x10 */
#define DAC_FS            29
#define FIR_VER            28
#define SEND_LASAT        26
#define FIFO_MODE        24
#define DAC_DRQ_CLR_CNT        21
#define TX_TRIG_LEVEL        8
#define DAC_MONO_EN        6
#define TX_SAMPLE_BITS        5
#define DAC_DRQ_EN        4
#define DAC_IRQ_EN        3
#define FIFO_UNDERRUN_IRQ_EN    2
#define FIFO_OVERRUN_IRQ_EN    1
#define FIFO_FLUSH    0
/* SUNXI_DAC_FIFO_STA:0x14 */
#define    TX_EMPTY        23
#define    TXE_CNT            8
#define    TXE_INT            3
#define    TXU_INT            2
#define    TXO_INT            1
/* SUNXI_ADC_FIFO_CTR:0x30 */
#define ADC_FS            29
#define EN_AD            28
#define ADCFDT            26
#define ADCDFEN            25
#define RX_FIFO_MODE        24
#define RX_SAMPLE_BITS        16
#define ADC_CHAN_SEL        12
#define RX_FIFO_TRG_LEVEL    4
#define ADC_DRQ_EN        3
#define ADC_IRQ_EN        2
#define ADC_OVERRUN_IRQ_EN    1
#define ADC_FIFO_FLUSH        0
/* SUNXI_ADC_FIFO_STA:0x38 */
#define    RXA            23
#define    RXA_CNT            8
#define    RXA_INT            3
#define    RXO_INT            1
/* SUNXI_DAC_DAP_CTR:0xf0 */
#define    DDAP_EN            31
#define    DDAP_DRC_EN        29
#define    DDAP_HPF_EN        28
/* SUNXI_ADC_DAP_CTR:0xf8 */
#define    ADC_DAP0_EN        31
#define    ADC_DRC0_EN        29
#define    ADC_HPF0_EN        28
#define    ADC_DAP1_EN        27
#define    ADC_DRC1_EN        25
#define    ADC_HPF1_EN        24
/*SUNXI_ADC_DRC_HHPFC : 0x200*/
#define ADC_HHPF_CONF    0
/*SUNXI_ADC_DRC_LHPFC : 0x204*/
#define ADC_LHPF_CONF    0
 
/* SUNXI_PR_CFG:0x07010280 */
#define AC_PR_RST        28
#define AC_PR_RW        24
#define AC_PR_ADDR        16
#define ADDA_PR_WDAT        8
#define ADDA_PR_RDAT        0
 
 
/* SUNXI_LOMIX_SRC:0x01 */
#define LMIXMUTE        0
#define    LMIX_MIC1_BST        6
#define    LMIX_MIC2_BST        5
#define LMIX_MIC3_BST        4
#define LMIX_LINEINLR        3
#define LMIX_LINEINL        2
#define LMIX_LDAC        1
#define LMIX_RDAC        0
 
/* SUNXI_ROMIX_SRC:0x02 */
#define RMIXMUTE        0
#define    RMIX_MIC1_BST        6
#define    RMIX_MIC2_BST        5
#define RMIX_MIC3_BST        4
#define RMIX_LINEINLR        3
#define RMIX_LINEINR        2
#define RMIX_RDAC        1
#define RMIX_LDAC        0
 
 
/* SUNXI_DAC_PA_SRC:0x03 */
#define DACAREN            7
#define DACALEN            6
#define RMIXEN            5
#define LMIXEN            4
 
 
/* SUNXI_LINEIN_GCTR:0x04 */
#define LINEINLG        4
#define LINEINRG        0
 
/* SUNXI_LINEINLR_MIC1_GCTR:0x05 */
#define LINEING            4
#define MIC1_GAIN        0
 
 
/* SUNXI_MIC2_MIC3_GCTR:0x06 */
#define MIC2_GAIN        4
#define MIC3_GAIN        0
 
/* SUNXI_PHONEOUT_CTR:0x07 */
#define PHONEOUTEN        3
#define PHONEOUTG        0
 
/* SUNXI_PHOMIX_MICBIAS_CTR:0x08 */
#define MMICBIASEN        6
 
#define PHOMIXMUTE        0
#define PH0MIX_LINEINLR        5
#define PHOMIX_MIC3_BST        4
#define PHOMIX_MIC1_BST        3
#define PHOMIX_MIC2_BST        2
#define PHOMIX_ROUT_MIX        1
#define PHOMIX_LOUT_MIX        0
 
/* SUNXI_LINEOUT_VOL:0x09 */
#define LINEOUT_VOL        3
#define LINEIN_BOOST        0
 
/* SUNXI_MIC1B_LINEOUT_CTR:0x0A*/
#define LINEOUTL_EN        7
#define LINEOUTR_EN        6
#define LINEOUTL_SRC        5
#define LINEOUTR_SRC        4
#define MIC1AMPEN        3
#define MIC1BOOST        0
 
/* SUNXI_MIC2B_MIC3B:0x0B*/
#define MIC2AMPEN        7
#define MIC2BOOST        4
#define MIC3AMPEN        3
#define MIC3BOOST        0
 
/* SUNXI_LADCMIX_SRC:0x0C */
#define LADCMIXMUTE        0
#define LADC_MIC1_BST        6
#define LADC_MIC2_BST        5
#define LADC_MIC3_BST        4
#define LADC_LINEINLR        3
#define LADC_LINEINL        2
#define LADC_LOUT_MIX        1
#define LADC_ROUT_MIX        0
 
/* SUNXI_RADCMIX_SRC:0x0D */
#define RADCMIXMUTE        0
#define RADC_MIC1_BST        6
#define RADC_MIC2_BST        5
#define RADC_MIC3_BST        4
#define RADC_LINEINLR        3
#define RADC_LINEINR        2
#define RADC_ROUT_MIX        1
#define RADC_LOUT_MIX        0
 
/* SUNXI_XADCMIX_SRC:0x0E */
#define XADCMIXMUTE        0
#define    XADC_MIC1_BST        6
#define    XADC_MIC2_BST        5
#define XADC_MIC3_BST        4
#define XADC_LINEINLR        3
#define XADC_ROUT_MIX        1
#define XADC_LOUT_MIX        0
 
/* SUNXI_ADC_AP_EN:0x0F */
#define ADCREN            7
#define ADCLEN            6
#define ADCXEN            5
#define ADCG            0
 
/* SUNXI_OP_CTR0:0x10 */
#define    OPADC1_BIAS_CUR        4
#define    OPADC2_BIAS_CUR        2
#define    OPAAF_BIAS_CUR        0
 
/* SUNXI_OP_CTR1:0x11 */
#define    OPMIC_BIAS_CUR        6
#define    OPVR_BIAS_CUR        4
#define    OPDAC_BIAS_CUR        2
#define    OPMIX_BIAS_CUR        0
 
/* SUNXI_USB_BIAS_CTR:0x12 */
#define    USB_BIAS_CUR        0
 
/* SUNXI_ADC_FUN_CTR:0x13 */
#define MMIC_BIAS_CHOP_EN    7
#define    MMIC_BIAS_CHOP_SRC    5
#define DITHER            4
#define    DITHER_CLK_SEL        2
#define    BIHE_CTRL        0
 
/* SUNXI_BIAS_DA16_CAL_CTR:0x14*/
#define PA_SPEED_SELECT        7
#define    CUR_TEST_SEL        6
#define    BIAS_DA16_CLK_SEL    4
#define    BIAS_CAL_MODE_SEL    3
#define    BIAS_DA16_CAL_CTRL    2
#define    BIAS_CAL_VER        1
 
/* SUNXI_BIAS_CALI_DATA:0x17*/
#define BIAS_CALI        0
 
/* SUNXI_BIAS_CALI_SET:0x18*/
#define BIAS_VERIFY        0
#endif /* __SUN8IW17_CODEC_H */