1
2 #ifndef _WM8737_H
3 #define _WM8737_H
4
5
6
7
8
9
10
11
12
13
14
15
16 #define WM8737_LEFT_PGA_VOLUME 0x00
17 #define WM8737_RIGHT_PGA_VOLUME 0x01
18 #define WM8737_AUDIO_PATH_L 0x02
19 #define WM8737_AUDIO_PATH_R 0x03
20 #define WM8737_3D_ENHANCE 0x04
21 #define WM8737_ADC_CONTROL 0x05
22 #define WM8737_POWER_MANAGEMENT 0x06
23 #define WM8737_AUDIO_FORMAT 0x07
24 #define WM8737_CLOCKING 0x08
25 #define WM8737_MIC_PREAMP_CONTROL 0x09
26 #define WM8737_MISC_BIAS_CONTROL 0x0A
27 #define WM8737_NOISE_GATE 0x0B
28 #define WM8737_ALC1 0x0C
29 #define WM8737_ALC2 0x0D
30 #define WM8737_ALC3 0x0E
31 #define WM8737_RESET 0x0F
32
33 #define WM8737_REGISTER_COUNT 16
34 #define WM8737_MAX_REGISTER 0x0F
35
36
37
38
39
40
41
42
43 #define WM8737_LVU 0x0100
44 #define WM8737_LVU_MASK 0x0100
45 #define WM8737_LVU_SHIFT 8
46 #define WM8737_LVU_WIDTH 1
47 #define WM8737_LINVOL_MASK 0x00FF
48 #define WM8737_LINVOL_SHIFT 0
49 #define WM8737_LINVOL_WIDTH 8
50
51
52
53
54 #define WM8737_RVU 0x0100
55 #define WM8737_RVU_MASK 0x0100
56 #define WM8737_RVU_SHIFT 8
57 #define WM8737_RVU_WIDTH 1
58 #define WM8737_RINVOL_MASK 0x00FF
59 #define WM8737_RINVOL_SHIFT 0
60 #define WM8737_RINVOL_WIDTH 8
61
62
63
64
65 #define WM8737_LINSEL_MASK 0x0180
66 #define WM8737_LINSEL_SHIFT 7
67 #define WM8737_LINSEL_WIDTH 2
68 #define WM8737_LMICBOOST_MASK 0x0060
69 #define WM8737_LMICBOOST_SHIFT 5
70 #define WM8737_LMICBOOST_WIDTH 2
71 #define WM8737_LMBE 0x0010
72 #define WM8737_LMBE_MASK 0x0010
73 #define WM8737_LMBE_SHIFT 4
74 #define WM8737_LMBE_WIDTH 1
75 #define WM8737_LMZC 0x0008
76 #define WM8737_LMZC_MASK 0x0008
77 #define WM8737_LMZC_SHIFT 3
78 #define WM8737_LMZC_WIDTH 1
79 #define WM8737_LPZC 0x0004
80 #define WM8737_LPZC_MASK 0x0004
81 #define WM8737_LPZC_SHIFT 2
82 #define WM8737_LPZC_WIDTH 1
83 #define WM8737_LZCTO_MASK 0x0003
84 #define WM8737_LZCTO_SHIFT 0
85 #define WM8737_LZCTO_WIDTH 2
86
87
88
89
90 #define WM8737_RINSEL_MASK 0x0180
91 #define WM8737_RINSEL_SHIFT 7
92 #define WM8737_RINSEL_WIDTH 2
93 #define WM8737_RMICBOOST_MASK 0x0060
94 #define WM8737_RMICBOOST_SHIFT 5
95 #define WM8737_RMICBOOST_WIDTH 2
96 #define WM8737_RMBE 0x0010
97 #define WM8737_RMBE_MASK 0x0010
98 #define WM8737_RMBE_SHIFT 4
99 #define WM8737_RMBE_WIDTH 1
100 #define WM8737_RMZC 0x0008
101 #define WM8737_RMZC_MASK 0x0008
102 #define WM8737_RMZC_SHIFT 3
103 #define WM8737_RMZC_WIDTH 1
104 #define WM8737_RPZC 0x0004
105 #define WM8737_RPZC_MASK 0x0004
106 #define WM8737_RPZC_SHIFT 2
107 #define WM8737_RPZC_WIDTH 1
108 #define WM8737_RZCTO_MASK 0x0003
109 #define WM8737_RZCTO_SHIFT 0
110 #define WM8737_RZCTO_WIDTH 2
111
112
113
114
115 #define WM8737_DIV2 0x0080
116 #define WM8737_DIV2_MASK 0x0080
117 #define WM8737_DIV2_SHIFT 7
118 #define WM8737_DIV2_WIDTH 1
119 #define WM8737_3DLC 0x0040
120 #define WM8737_3DLC_MASK 0x0040
121 #define WM8737_3DLC_SHIFT 6
122 #define WM8737_3DLC_WIDTH 1
123 #define WM8737_3DUC 0x0020
124 #define WM8737_3DUC_MASK 0x0020
125 #define WM8737_3DUC_SHIFT 5
126 #define WM8737_3DUC_WIDTH 1
127 #define WM8737_3DDEPTH_MASK 0x001E
128 #define WM8737_3DDEPTH_SHIFT 1
129 #define WM8737_3DDEPTH_WIDTH 4
130 #define WM8737_3DE 0x0001
131 #define WM8737_3DE_MASK 0x0001
132 #define WM8737_3DE_SHIFT 0
133 #define WM8737_3DE_WIDTH 1
134
135
136
137
138 #define WM8737_MONOMIX_MASK 0x0180
139 #define WM8737_MONOMIX_SHIFT 7
140 #define WM8737_MONOMIX_WIDTH 2
141 #define WM8737_POLARITY_MASK 0x0060
142 #define WM8737_POLARITY_SHIFT 5
143 #define WM8737_POLARITY_WIDTH 2
144 #define WM8737_HPOR 0x0010
145 #define WM8737_HPOR_MASK 0x0010
146 #define WM8737_HPOR_SHIFT 4
147 #define WM8737_HPOR_WIDTH 1
148 #define WM8737_LP 0x0004
149 #define WM8737_LP_MASK 0x0004
150 #define WM8737_LP_SHIFT 2
151 #define WM8737_LP_WIDTH 1
152 #define WM8737_MONOUT 0x0002
153 #define WM8737_MONOUT_MASK 0x0002
154 #define WM8737_MONOUT_SHIFT 1
155 #define WM8737_MONOUT_WIDTH 1
156 #define WM8737_ADCHPD 0x0001
157 #define WM8737_ADCHPD_MASK 0x0001
158 #define WM8737_ADCHPD_SHIFT 0
159 #define WM8737_ADCHPD_WIDTH 1
160
161
162
163
164 #define WM8737_VMID 0x0100
165 #define WM8737_VMID_MASK 0x0100
166 #define WM8737_VMID_SHIFT 8
167 #define WM8737_VMID_WIDTH 1
168 #define WM8737_VREF 0x0080
169 #define WM8737_VREF_MASK 0x0080
170 #define WM8737_VREF_SHIFT 7
171 #define WM8737_VREF_WIDTH 1
172 #define WM8737_AI 0x0040
173 #define WM8737_AI_MASK 0x0040
174 #define WM8737_AI_SHIFT 6
175 #define WM8737_AI_WIDTH 1
176 #define WM8737_PGL 0x0020
177 #define WM8737_PGL_MASK 0x0020
178 #define WM8737_PGL_SHIFT 5
179 #define WM8737_PGL_WIDTH 1
180 #define WM8737_PGR 0x0010
181 #define WM8737_PGR_MASK 0x0010
182 #define WM8737_PGR_SHIFT 4
183 #define WM8737_PGR_WIDTH 1
184 #define WM8737_ADL 0x0008
185 #define WM8737_ADL_MASK 0x0008
186 #define WM8737_ADL_SHIFT 3
187 #define WM8737_ADL_WIDTH 1
188 #define WM8737_ADR 0x0004
189 #define WM8737_ADR_MASK 0x0004
190 #define WM8737_ADR_SHIFT 2
191 #define WM8737_ADR_WIDTH 1
192 #define WM8737_MICBIAS_MASK 0x0003
193 #define WM8737_MICBIAS_SHIFT 0
194 #define WM8737_MICBIAS_WIDTH 2
195
196
197
198
199 #define WM8737_SDODIS 0x0080
200 #define WM8737_SDODIS_MASK 0x0080
201 #define WM8737_SDODIS_SHIFT 7
202 #define WM8737_SDODIS_WIDTH 1
203 #define WM8737_MS 0x0040
204 #define WM8737_MS_MASK 0x0040
205 #define WM8737_MS_SHIFT 6
206 #define WM8737_MS_WIDTH 1
207 #define WM8737_LRP 0x0010
208 #define WM8737_LRP_MASK 0x0010
209 #define WM8737_LRP_SHIFT 4
210 #define WM8737_LRP_WIDTH 1
211 #define WM8737_WL_MASK 0x000C
212 #define WM8737_WL_SHIFT 2
213 #define WM8737_WL_WIDTH 2
214 #define WM8737_FORMAT_MASK 0x0003
215 #define WM8737_FORMAT_SHIFT 0
216 #define WM8737_FORMAT_WIDTH 2
217
218
219
220
221 #define WM8737_AUTODETECT 0x0080
222 #define WM8737_AUTODETECT_MASK 0x0080
223 #define WM8737_AUTODETECT_SHIFT 7
224 #define WM8737_AUTODETECT_WIDTH 1
225 #define WM8737_CLKDIV2 0x0040
226 #define WM8737_CLKDIV2_MASK 0x0040
227 #define WM8737_CLKDIV2_SHIFT 6
228 #define WM8737_CLKDIV2_WIDTH 1
229 #define WM8737_SR_MASK 0x003E
230 #define WM8737_SR_SHIFT 1
231 #define WM8737_SR_WIDTH 5
232 #define WM8737_USB_MODE 0x0001
233 #define WM8737_USB_MODE_MASK 0x0001
234 #define WM8737_USB_MODE_SHIFT 0
235 #define WM8737_USB_MODE_WIDTH 1
236
237
238
239
240 #define WM8737_RBYPEN 0x0008
241 #define WM8737_RBYPEN_MASK 0x0008
242 #define WM8737_RBYPEN_SHIFT 3
243 #define WM8737_RBYPEN_WIDTH 1
244 #define WM8737_LBYPEN 0x0004
245 #define WM8737_LBYPEN_MASK 0x0004
246 #define WM8737_LBYPEN_SHIFT 2
247 #define WM8737_LBYPEN_WIDTH 1
248 #define WM8737_MBCTRL_MASK 0x0003
249 #define WM8737_MBCTRL_SHIFT 0
250 #define WM8737_MBCTRL_WIDTH 2
251
252
253
254
255 #define WM8737_VMIDSEL_MASK 0x000C
256 #define WM8737_VMIDSEL_SHIFT 2
257 #define WM8737_VMIDSEL_WIDTH 2
258 #define WM8737_LINPUT1_DC_BIAS_ENABLE 0x0002
259 #define WM8737_LINPUT1_DC_BIAS_ENABLE_MASK 0x0002
260 #define WM8737_LINPUT1_DC_BIAS_ENABLE_SHIFT 1
261 #define WM8737_LINPUT1_DC_BIAS_ENABLE_WIDTH 1
262 #define WM8737_RINPUT1_DC_BIAS_ENABLE 0x0001
263 #define WM8737_RINPUT1_DC_BIAS_ENABLE_MASK 0x0001
264 #define WM8737_RINPUT1_DC_BIAS_ENABLE_SHIFT 0
265 #define WM8737_RINPUT1_DC_BIAS_ENABLE_WIDTH 1
266
267
268
269
270 #define WM8737_NGTH_MASK 0x001C
271 #define WM8737_NGTH_SHIFT 2
272 #define WM8737_NGTH_WIDTH 3
273 #define WM8737_NGAT 0x0001
274 #define WM8737_NGAT_MASK 0x0001
275 #define WM8737_NGAT_SHIFT 0
276 #define WM8737_NGAT_WIDTH 1
277
278
279
280
281 #define WM8737_ALCSEL_MASK 0x0180
282 #define WM8737_ALCSEL_SHIFT 7
283 #define WM8737_ALCSEL_WIDTH 2
284 #define WM8737_MAX_GAIN_MASK 0x0070
285 #define WM8737_MAX_GAIN_SHIFT 4
286 #define WM8737_MAX_GAIN_WIDTH 3
287 #define WM8737_ALCL_MASK 0x000F
288 #define WM8737_ALCL_SHIFT 0
289 #define WM8737_ALCL_WIDTH 4
290
291
292
293
294 #define WM8737_ALCZCE 0x0010
295 #define WM8737_ALCZCE_MASK 0x0010
296 #define WM8737_ALCZCE_SHIFT 4
297 #define WM8737_ALCZCE_WIDTH 1
298 #define WM8737_HLD_MASK 0x000F
299 #define WM8737_HLD_SHIFT 0
300 #define WM8737_HLD_WIDTH 4
301
302
303
304
305 #define WM8737_DCY_MASK 0x00F0
306 #define WM8737_DCY_SHIFT 4
307 #define WM8737_DCY_WIDTH 4
308 #define WM8737_ATK_MASK 0x000F
309 #define WM8737_ATK_SHIFT 0
310 #define WM8737_ATK_WIDTH 4
311
312
313
314
315 #define WM8737_RESET_MASK 0x01FF
316 #define WM8737_RESET_SHIFT 0
317 #define WM8737_RESET_WIDTH 9
318
319 #endif