1
2
3
4
5
6
7
8
9
10 #ifndef _WM8955_H
11 #define _WM8955_H
12
13 #define WM8955_CLK_MCLK 1
14
15
16
17
18 #define WM8955_LOUT1_VOLUME 0x02
19 #define WM8955_ROUT1_VOLUME 0x03
20 #define WM8955_DAC_CONTROL 0x05
21 #define WM8955_AUDIO_INTERFACE 0x07
22 #define WM8955_SAMPLE_RATE 0x08
23 #define WM8955_LEFT_DAC_VOLUME 0x0A
24 #define WM8955_RIGHT_DAC_VOLUME 0x0B
25 #define WM8955_BASS_CONTROL 0x0C
26 #define WM8955_TREBLE_CONTROL 0x0D
27 #define WM8955_RESET 0x0F
28 #define WM8955_ADDITIONAL_CONTROL_1 0x17
29 #define WM8955_ADDITIONAL_CONTROL_2 0x18
30 #define WM8955_POWER_MANAGEMENT_1 0x19
31 #define WM8955_POWER_MANAGEMENT_2 0x1A
32 #define WM8955_ADDITIONAL_CONTROL_3 0x1B
33 #define WM8955_LEFT_OUT_MIX_1 0x22
34 #define WM8955_LEFT_OUT_MIX_2 0x23
35 #define WM8955_RIGHT_OUT_MIX_1 0x24
36 #define WM8955_RIGHT_OUT_MIX_2 0x25
37 #define WM8955_MONO_OUT_MIX_1 0x26
38 #define WM8955_MONO_OUT_MIX_2 0x27
39 #define WM8955_LOUT2_VOLUME 0x28
40 #define WM8955_ROUT2_VOLUME 0x29
41 #define WM8955_MONOOUT_VOLUME 0x2A
42 #define WM8955_CLOCKING_PLL 0x2B
43 #define WM8955_PLL_CONTROL_1 0x2C
44 #define WM8955_PLL_CONTROL_2 0x2D
45 #define WM8955_PLL_CONTROL_3 0x2E
46 #define WM8955_PLL_CONTROL_4 0x3B
47
48 #define WM8955_REGISTER_COUNT 29
49 #define WM8955_MAX_REGISTER 0x3B
50
51
52
53
54
55
56
57
58 #define WM8955_LO1VU 0x0100
59 #define WM8955_LO1VU_MASK 0x0100
60 #define WM8955_LO1VU_SHIFT 8
61 #define WM8955_LO1VU_WIDTH 1
62 #define WM8955_LO1ZC 0x0080
63 #define WM8955_LO1ZC_MASK 0x0080
64 #define WM8955_LO1ZC_SHIFT 7
65 #define WM8955_LO1ZC_WIDTH 1
66 #define WM8955_LOUTVOL_MASK 0x007F
67 #define WM8955_LOUTVOL_SHIFT 0
68 #define WM8955_LOUTVOL_WIDTH 7
69
70
71
72
73 #define WM8955_RO1VU 0x0100
74 #define WM8955_RO1VU_MASK 0x0100
75 #define WM8955_RO1VU_SHIFT 8
76 #define WM8955_RO1VU_WIDTH 1
77 #define WM8955_RO1ZC 0x0080
78 #define WM8955_RO1ZC_MASK 0x0080
79 #define WM8955_RO1ZC_SHIFT 7
80 #define WM8955_RO1ZC_WIDTH 1
81 #define WM8955_ROUTVOL_MASK 0x007F
82 #define WM8955_ROUTVOL_SHIFT 0
83 #define WM8955_ROUTVOL_WIDTH 7
84
85
86
87
88 #define WM8955_DAT 0x0080
89 #define WM8955_DAT_MASK 0x0080
90 #define WM8955_DAT_SHIFT 7
91 #define WM8955_DAT_WIDTH 1
92 #define WM8955_DACMU 0x0008
93 #define WM8955_DACMU_MASK 0x0008
94 #define WM8955_DACMU_SHIFT 3
95 #define WM8955_DACMU_WIDTH 1
96 #define WM8955_DEEMPH_MASK 0x0006
97 #define WM8955_DEEMPH_SHIFT 1
98 #define WM8955_DEEMPH_WIDTH 2
99
100
101
102
103 #define WM8955_BCLKINV 0x0080
104 #define WM8955_BCLKINV_MASK 0x0080
105 #define WM8955_BCLKINV_SHIFT 7
106 #define WM8955_BCLKINV_WIDTH 1
107 #define WM8955_MS 0x0040
108 #define WM8955_MS_MASK 0x0040
109 #define WM8955_MS_SHIFT 6
110 #define WM8955_MS_WIDTH 1
111 #define WM8955_LRSWAP 0x0020
112 #define WM8955_LRSWAP_MASK 0x0020
113 #define WM8955_LRSWAP_SHIFT 5
114 #define WM8955_LRSWAP_WIDTH 1
115 #define WM8955_LRP 0x0010
116 #define WM8955_LRP_MASK 0x0010
117 #define WM8955_LRP_SHIFT 4
118 #define WM8955_LRP_WIDTH 1
119 #define WM8955_WL_MASK 0x000C
120 #define WM8955_WL_SHIFT 2
121 #define WM8955_WL_WIDTH 2
122 #define WM8955_FORMAT_MASK 0x0003
123 #define WM8955_FORMAT_SHIFT 0
124 #define WM8955_FORMAT_WIDTH 2
125
126
127
128
129 #define WM8955_BCLKDIV2 0x0080
130 #define WM8955_BCLKDIV2_MASK 0x0080
131 #define WM8955_BCLKDIV2_SHIFT 7
132 #define WM8955_BCLKDIV2_WIDTH 1
133 #define WM8955_MCLKDIV2 0x0040
134 #define WM8955_MCLKDIV2_MASK 0x0040
135 #define WM8955_MCLKDIV2_SHIFT 6
136 #define WM8955_MCLKDIV2_WIDTH 1
137 #define WM8955_SR_MASK 0x003E
138 #define WM8955_SR_SHIFT 1
139 #define WM8955_SR_WIDTH 5
140 #define WM8955_USB 0x0001
141 #define WM8955_USB_MASK 0x0001
142 #define WM8955_USB_SHIFT 0
143 #define WM8955_USB_WIDTH 1
144
145
146
147
148 #define WM8955_LDVU 0x0100
149 #define WM8955_LDVU_MASK 0x0100
150 #define WM8955_LDVU_SHIFT 8
151 #define WM8955_LDVU_WIDTH 1
152 #define WM8955_LDACVOL_MASK 0x00FF
153 #define WM8955_LDACVOL_SHIFT 0
154 #define WM8955_LDACVOL_WIDTH 8
155
156
157
158
159 #define WM8955_RDVU 0x0100
160 #define WM8955_RDVU_MASK 0x0100
161 #define WM8955_RDVU_SHIFT 8
162 #define WM8955_RDVU_WIDTH 1
163 #define WM8955_RDACVOL_MASK 0x00FF
164 #define WM8955_RDACVOL_SHIFT 0
165 #define WM8955_RDACVOL_WIDTH 8
166
167
168
169
170 #define WM8955_BB 0x0080
171 #define WM8955_BB_MASK 0x0080
172 #define WM8955_BB_SHIFT 7
173 #define WM8955_BB_WIDTH 1
174 #define WM8955_BC 0x0040
175 #define WM8955_BC_MASK 0x0040
176 #define WM8955_BC_SHIFT 6
177 #define WM8955_BC_WIDTH 1
178 #define WM8955_BASS_MASK 0x000F
179 #define WM8955_BASS_SHIFT 0
180 #define WM8955_BASS_WIDTH 4
181
182
183
184
185 #define WM8955_TC 0x0040
186 #define WM8955_TC_MASK 0x0040
187 #define WM8955_TC_SHIFT 6
188 #define WM8955_TC_WIDTH 1
189 #define WM8955_TRBL_MASK 0x000F
190 #define WM8955_TRBL_SHIFT 0
191 #define WM8955_TRBL_WIDTH 4
192
193
194
195
196 #define WM8955_RESET_MASK 0x01FF
197 #define WM8955_RESET_SHIFT 0
198 #define WM8955_RESET_WIDTH 9
199
200
201
202
203 #define WM8955_TSDEN 0x0100
204 #define WM8955_TSDEN_MASK 0x0100
205 #define WM8955_TSDEN_SHIFT 8
206 #define WM8955_TSDEN_WIDTH 1
207 #define WM8955_VSEL_MASK 0x00C0
208 #define WM8955_VSEL_SHIFT 6
209 #define WM8955_VSEL_WIDTH 2
210 #define WM8955_DMONOMIX_MASK 0x0030
211 #define WM8955_DMONOMIX_SHIFT 4
212 #define WM8955_DMONOMIX_WIDTH 2
213 #define WM8955_DACINV 0x0002
214 #define WM8955_DACINV_MASK 0x0002
215 #define WM8955_DACINV_SHIFT 1
216 #define WM8955_DACINV_WIDTH 1
217 #define WM8955_TOEN 0x0001
218 #define WM8955_TOEN_MASK 0x0001
219 #define WM8955_TOEN_SHIFT 0
220 #define WM8955_TOEN_WIDTH 1
221
222
223
224
225 #define WM8955_OUT3SW_MASK 0x0180
226 #define WM8955_OUT3SW_SHIFT 7
227 #define WM8955_OUT3SW_WIDTH 2
228 #define WM8955_ROUT2INV 0x0010
229 #define WM8955_ROUT2INV_MASK 0x0010
230 #define WM8955_ROUT2INV_SHIFT 4
231 #define WM8955_ROUT2INV_WIDTH 1
232 #define WM8955_DACOSR 0x0001
233 #define WM8955_DACOSR_MASK 0x0001
234 #define WM8955_DACOSR_SHIFT 0
235 #define WM8955_DACOSR_WIDTH 1
236
237
238
239
240 #define WM8955_VMIDSEL_MASK 0x0180
241 #define WM8955_VMIDSEL_SHIFT 7
242 #define WM8955_VMIDSEL_WIDTH 2
243 #define WM8955_VREF 0x0040
244 #define WM8955_VREF_MASK 0x0040
245 #define WM8955_VREF_SHIFT 6
246 #define WM8955_VREF_WIDTH 1
247 #define WM8955_DIGENB 0x0001
248 #define WM8955_DIGENB_MASK 0x0001
249 #define WM8955_DIGENB_SHIFT 0
250 #define WM8955_DIGENB_WIDTH 1
251
252
253
254
255 #define WM8955_DACL 0x0100
256 #define WM8955_DACL_MASK 0x0100
257 #define WM8955_DACL_SHIFT 8
258 #define WM8955_DACL_WIDTH 1
259 #define WM8955_DACR 0x0080
260 #define WM8955_DACR_MASK 0x0080
261 #define WM8955_DACR_SHIFT 7
262 #define WM8955_DACR_WIDTH 1
263 #define WM8955_LOUT1 0x0040
264 #define WM8955_LOUT1_MASK 0x0040
265 #define WM8955_LOUT1_SHIFT 6
266 #define WM8955_LOUT1_WIDTH 1
267 #define WM8955_ROUT1 0x0020
268 #define WM8955_ROUT1_MASK 0x0020
269 #define WM8955_ROUT1_SHIFT 5
270 #define WM8955_ROUT1_WIDTH 1
271 #define WM8955_LOUT2 0x0010
272 #define WM8955_LOUT2_MASK 0x0010
273 #define WM8955_LOUT2_SHIFT 4
274 #define WM8955_LOUT2_WIDTH 1
275 #define WM8955_ROUT2 0x0008
276 #define WM8955_ROUT2_MASK 0x0008
277 #define WM8955_ROUT2_SHIFT 3
278 #define WM8955_ROUT2_WIDTH 1
279 #define WM8955_MONO 0x0004
280 #define WM8955_MONO_MASK 0x0004
281 #define WM8955_MONO_SHIFT 2
282 #define WM8955_MONO_WIDTH 1
283 #define WM8955_OUT3 0x0002
284 #define WM8955_OUT3_MASK 0x0002
285 #define WM8955_OUT3_SHIFT 1
286 #define WM8955_OUT3_WIDTH 1
287
288
289
290
291 #define WM8955_VROI 0x0040
292 #define WM8955_VROI_MASK 0x0040
293 #define WM8955_VROI_SHIFT 6
294 #define WM8955_VROI_WIDTH 1
295
296
297
298
299 #define WM8955_LD2LO 0x0100
300 #define WM8955_LD2LO_MASK 0x0100
301 #define WM8955_LD2LO_SHIFT 8
302 #define WM8955_LD2LO_WIDTH 1
303 #define WM8955_LI2LO 0x0080
304 #define WM8955_LI2LO_MASK 0x0080
305 #define WM8955_LI2LO_SHIFT 7
306 #define WM8955_LI2LO_WIDTH 1
307 #define WM8955_LI2LOVOL_MASK 0x0070
308 #define WM8955_LI2LOVOL_SHIFT 4
309 #define WM8955_LI2LOVOL_WIDTH 3
310
311
312
313
314 #define WM8955_RD2LO 0x0100
315 #define WM8955_RD2LO_MASK 0x0100
316 #define WM8955_RD2LO_SHIFT 8
317 #define WM8955_RD2LO_WIDTH 1
318 #define WM8955_RI2LO 0x0080
319 #define WM8955_RI2LO_MASK 0x0080
320 #define WM8955_RI2LO_SHIFT 7
321 #define WM8955_RI2LO_WIDTH 1
322 #define WM8955_RI2LOVOL_MASK 0x0070
323 #define WM8955_RI2LOVOL_SHIFT 4
324 #define WM8955_RI2LOVOL_WIDTH 3
325
326
327
328
329 #define WM8955_LD2RO 0x0100
330 #define WM8955_LD2RO_MASK 0x0100
331 #define WM8955_LD2RO_SHIFT 8
332 #define WM8955_LD2RO_WIDTH 1
333 #define WM8955_LI2RO 0x0080
334 #define WM8955_LI2RO_MASK 0x0080
335 #define WM8955_LI2RO_SHIFT 7
336 #define WM8955_LI2RO_WIDTH 1
337 #define WM8955_LI2ROVOL_MASK 0x0070
338 #define WM8955_LI2ROVOL_SHIFT 4
339 #define WM8955_LI2ROVOL_WIDTH 3
340
341
342
343
344 #define WM8955_RD2RO 0x0100
345 #define WM8955_RD2RO_MASK 0x0100
346 #define WM8955_RD2RO_SHIFT 8
347 #define WM8955_RD2RO_WIDTH 1
348 #define WM8955_RI2RO 0x0080
349 #define WM8955_RI2RO_MASK 0x0080
350 #define WM8955_RI2RO_SHIFT 7
351 #define WM8955_RI2RO_WIDTH 1
352 #define WM8955_RI2ROVOL_MASK 0x0070
353 #define WM8955_RI2ROVOL_SHIFT 4
354 #define WM8955_RI2ROVOL_WIDTH 3
355
356
357
358
359 #define WM8955_LD2MO 0x0100
360 #define WM8955_LD2MO_MASK 0x0100
361 #define WM8955_LD2MO_SHIFT 8
362 #define WM8955_LD2MO_WIDTH 1
363 #define WM8955_LI2MO 0x0080
364 #define WM8955_LI2MO_MASK 0x0080
365 #define WM8955_LI2MO_SHIFT 7
366 #define WM8955_LI2MO_WIDTH 1
367 #define WM8955_LI2MOVOL_MASK 0x0070
368 #define WM8955_LI2MOVOL_SHIFT 4
369 #define WM8955_LI2MOVOL_WIDTH 3
370 #define WM8955_DMEN 0x0001
371 #define WM8955_DMEN_MASK 0x0001
372 #define WM8955_DMEN_SHIFT 0
373 #define WM8955_DMEN_WIDTH 1
374
375
376
377
378 #define WM8955_RD2MO 0x0100
379 #define WM8955_RD2MO_MASK 0x0100
380 #define WM8955_RD2MO_SHIFT 8
381 #define WM8955_RD2MO_WIDTH 1
382 #define WM8955_RI2MO 0x0080
383 #define WM8955_RI2MO_MASK 0x0080
384 #define WM8955_RI2MO_SHIFT 7
385 #define WM8955_RI2MO_WIDTH 1
386 #define WM8955_RI2MOVOL_MASK 0x0070
387 #define WM8955_RI2MOVOL_SHIFT 4
388 #define WM8955_RI2MOVOL_WIDTH 3
389
390
391
392
393 #define WM8955_LO2VU 0x0100
394 #define WM8955_LO2VU_MASK 0x0100
395 #define WM8955_LO2VU_SHIFT 8
396 #define WM8955_LO2VU_WIDTH 1
397 #define WM8955_LO2ZC 0x0080
398 #define WM8955_LO2ZC_MASK 0x0080
399 #define WM8955_LO2ZC_SHIFT 7
400 #define WM8955_LO2ZC_WIDTH 1
401 #define WM8955_LOUT2VOL_MASK 0x007F
402 #define WM8955_LOUT2VOL_SHIFT 0
403 #define WM8955_LOUT2VOL_WIDTH 7
404
405
406
407
408 #define WM8955_RO2VU 0x0100
409 #define WM8955_RO2VU_MASK 0x0100
410 #define WM8955_RO2VU_SHIFT 8
411 #define WM8955_RO2VU_WIDTH 1
412 #define WM8955_RO2ZC 0x0080
413 #define WM8955_RO2ZC_MASK 0x0080
414 #define WM8955_RO2ZC_SHIFT 7
415 #define WM8955_RO2ZC_WIDTH 1
416 #define WM8955_ROUT2VOL_MASK 0x007F
417 #define WM8955_ROUT2VOL_SHIFT 0
418 #define WM8955_ROUT2VOL_WIDTH 7
419
420
421
422
423 #define WM8955_MOZC 0x0080
424 #define WM8955_MOZC_MASK 0x0080
425 #define WM8955_MOZC_SHIFT 7
426 #define WM8955_MOZC_WIDTH 1
427 #define WM8955_MOUTVOL_MASK 0x007F
428 #define WM8955_MOUTVOL_SHIFT 0
429 #define WM8955_MOUTVOL_WIDTH 7
430
431
432
433
434 #define WM8955_MCLKSEL 0x0100
435 #define WM8955_MCLKSEL_MASK 0x0100
436 #define WM8955_MCLKSEL_SHIFT 8
437 #define WM8955_MCLKSEL_WIDTH 1
438 #define WM8955_PLLOUTDIV2 0x0020
439 #define WM8955_PLLOUTDIV2_MASK 0x0020
440 #define WM8955_PLLOUTDIV2_SHIFT 5
441 #define WM8955_PLLOUTDIV2_WIDTH 1
442 #define WM8955_PLL_RB 0x0010
443 #define WM8955_PLL_RB_MASK 0x0010
444 #define WM8955_PLL_RB_SHIFT 4
445 #define WM8955_PLL_RB_WIDTH 1
446 #define WM8955_PLLEN 0x0008
447 #define WM8955_PLLEN_MASK 0x0008
448 #define WM8955_PLLEN_SHIFT 3
449 #define WM8955_PLLEN_WIDTH 1
450
451
452
453
454 #define WM8955_N_MASK 0x01E0
455 #define WM8955_N_SHIFT 5
456 #define WM8955_N_WIDTH 4
457 #define WM8955_K_21_18_MASK 0x000F
458 #define WM8955_K_21_18_SHIFT 0
459 #define WM8955_K_21_18_WIDTH 4
460
461
462
463
464 #define WM8955_K_17_9_MASK 0x01FF
465 #define WM8955_K_17_9_SHIFT 0
466 #define WM8955_K_17_9_WIDTH 9
467
468
469
470
471 #define WM8955_K_8_0_MASK 0x01FF
472 #define WM8955_K_8_0_SHIFT 0
473 #define WM8955_K_8_0_WIDTH 9
474
475
476
477
478 #define WM8955_KEN 0x0080
479 #define WM8955_KEN_MASK 0x0080
480 #define WM8955_KEN_SHIFT 7
481 #define WM8955_KEN_WIDTH 1
482
483 #endif