1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#include <linux/mfd/wm8994/core.h>
16#include <linux/mfd/wm8994/registers.h>
17#include <linux/regmap.h>
18#include <linux/device.h>
19
20#include "wm8994.h"
21
22static struct reg_default wm1811_defaults[] = {
23 { 0x0001, 0x0000 },
24 { 0x0002, 0x6000 },
25 { 0x0003, 0x0000 },
26 { 0x0004, 0x0000 },
27 { 0x0005, 0x0000 },
28 { 0x0006, 0x0000 },
29 { 0x0015, 0x0000 },
30 { 0x0018, 0x008B },
31 { 0x0019, 0x008B },
32 { 0x001A, 0x008B },
33 { 0x001B, 0x008B },
34 { 0x001C, 0x006D },
35 { 0x001D, 0x006D },
36 { 0x001E, 0x0066 },
37 { 0x001F, 0x0020 },
38 { 0x0020, 0x0079 },
39 { 0x0021, 0x0079 },
40 { 0x0022, 0x0003 },
41 { 0x0023, 0x0003 },
42 { 0x0024, 0x0011 },
43 { 0x0025, 0x0140 },
44 { 0x0026, 0x0079 },
45 { 0x0027, 0x0079 },
46 { 0x0028, 0x0000 },
47 { 0x0029, 0x0000 },
48 { 0x002A, 0x0000 },
49 { 0x002B, 0x0000 },
50 { 0x002C, 0x0000 },
51 { 0x002D, 0x0000 },
52 { 0x002E, 0x0000 },
53 { 0x002F, 0x0000 },
54 { 0x0030, 0x0000 },
55 { 0x0031, 0x0000 },
56 { 0x0032, 0x0000 },
57 { 0x0033, 0x0000 },
58 { 0x0034, 0x0000 },
59 { 0x0035, 0x0000 },
60 { 0x0036, 0x0000 },
61 { 0x0037, 0x0000 },
62 { 0x0038, 0x0000 },
63 { 0x0039, 0x0000 },
64 { 0x003B, 0x000D },
65 { 0x003C, 0x0003 },
66 { 0x003D, 0x0039 },
67 { 0x003E, 0x0039 },
68 { 0x004C, 0x1F25 },
69 { 0x004D, 0xAB19 },
70 { 0x0051, 0x0004 },
71 { 0x0055, 0x054A },
72 { 0x0059, 0x0000 },
73 { 0x0060, 0x0000 },
74 { 0x00C5, 0x0000 },
75 { 0x00D0, 0x7600 },
76 { 0x00D1, 0x007F },
77 { 0x0101, 0x8004 },
78 { 0x0200, 0x0000 },
79 { 0x0201, 0x0000 },
80 { 0x0204, 0x0000 },
81 { 0x0205, 0x0000 },
82 { 0x0208, 0x0000 },
83 { 0x0209, 0x0000 },
84 { 0x0210, 0x0083 },
85 { 0x0211, 0x0083 },
86 { 0x0220, 0x0000 },
87 { 0x0221, 0x0000 },
88 { 0x0222, 0x0000 },
89 { 0x0223, 0x0000 },
90 { 0x0224, 0x0C80 },
91 { 0x0226, 0x0000 },
92 { 0x0227, 0x0006 },
93 { 0x0240, 0x0000 },
94 { 0x0241, 0x0000 },
95 { 0x0242, 0x0000 },
96 { 0x0243, 0x0000 },
97 { 0x0244, 0x0C80 },
98 { 0x0246, 0x0000 },
99 { 0x0247, 0x0006 },
100 { 0x0300, 0x4050 },
101 { 0x0301, 0x4000 },
102 { 0x0302, 0x0000 },
103 { 0x0303, 0x0040 },
104 { 0x0304, 0x0040 },
105 { 0x0305, 0x0040 },
106 { 0x0306, 0x0004 },
107 { 0x0307, 0x0100 },
108 { 0x0310, 0x4050 },
109 { 0x0311, 0x4000 },
110 { 0x0312, 0x0000 },
111 { 0x0313, 0x0040 },
112 { 0x0314, 0x0040 },
113 { 0x0315, 0x0040 },
114 { 0x0316, 0x0000 },
115 { 0x0317, 0x0000 },
116 { 0x0318, 0x0003 },
117 { 0x0320, 0x0040 },
118 { 0x0321, 0x0000 },
119 { 0x0322, 0x0000 },
120 { 0x0323, 0x0000 },
121 { 0x0400, 0x00C0 },
122 { 0x0401, 0x00C0 },
123 { 0x0402, 0x00C0 },
124 { 0x0403, 0x00C0 },
125 { 0x0410, 0x0000 },
126 { 0x0420, 0x0200 },
127 { 0x0421, 0x0010 },
128 { 0x0430, 0x0068 },
129 { 0x0440, 0x0098 },
130 { 0x0441, 0x0845 },
131 { 0x0442, 0x0000 },
132 { 0x0443, 0x0000 },
133 { 0x0444, 0x0000 },
134 { 0x0480, 0x6318 },
135 { 0x0481, 0x6300 },
136 { 0x0482, 0x0FCA },
137 { 0x0483, 0x0400 },
138 { 0x0484, 0x00D8 },
139 { 0x0485, 0x1EB5 },
140 { 0x0486, 0xF145 },
141 { 0x0487, 0x0B75 },
142 { 0x0488, 0x01C5 },
143 { 0x0489, 0x1C58 },
144 { 0x048A, 0xF373 },
145 { 0x048B, 0x0A54 },
146 { 0x048C, 0x0558 },
147 { 0x048D, 0x168E },
148 { 0x048E, 0xF829 },
149 { 0x048F, 0x07AD },
150 { 0x0490, 0x1103 },
151 { 0x0491, 0x0564 },
152 { 0x0492, 0x0559 },
153 { 0x0493, 0x4000 },
154 { 0x0494, 0x0000 },
155 { 0x0500, 0x00C0 },
156 { 0x0501, 0x00C0 },
157 { 0x0502, 0x00C0 },
158 { 0x0503, 0x00C0 },
159 { 0x0510, 0x0000 },
160 { 0x0520, 0x0200 },
161 { 0x0521, 0x0010 },
162 { 0x0530, 0x0068 },
163 { 0x0540, 0x0098 },
164 { 0x0541, 0x0845 },
165 { 0x0542, 0x0000 },
166 { 0x0543, 0x0000 },
167 { 0x0544, 0x0000 },
168 { 0x0580, 0x6318 },
169 { 0x0581, 0x6300 },
170 { 0x0582, 0x0FCA },
171 { 0x0583, 0x0400 },
172 { 0x0584, 0x00D8 },
173 { 0x0585, 0x1EB5 },
174 { 0x0586, 0xF145 },
175 { 0x0587, 0x0B75 },
176 { 0x0588, 0x01C5 },
177 { 0x0589, 0x1C58 },
178 { 0x058A, 0xF373 },
179 { 0x058B, 0x0A54 },
180 { 0x058C, 0x0558 },
181 { 0x058D, 0x168E },
182 { 0x058E, 0xF829 },
183 { 0x058F, 0x07AD },
184 { 0x0590, 0x1103 },
185 { 0x0591, 0x0564 },
186 { 0x0592, 0x0559 },
187 { 0x0593, 0x4000 },
188 { 0x0594, 0x0000 },
189 { 0x0600, 0x0000 },
190 { 0x0601, 0x0000 },
191 { 0x0602, 0x0000 },
192 { 0x0603, 0x0000 },
193 { 0x0604, 0x0000 },
194 { 0x0605, 0x0000 },
195 { 0x0606, 0x0000 },
196 { 0x0607, 0x0000 },
197 { 0x0610, 0x02C0 },
198 { 0x0611, 0x02C0 },
199 { 0x0612, 0x02C0 },
200 { 0x0613, 0x02C0 },
201 { 0x0614, 0x0000 },
202 { 0x0620, 0x0002 },
203 { 0x0621, 0x0000 },
204 { 0x0700, 0x8100 },
205 { 0x0701, 0xA101 },
206 { 0x0702, 0xA101 },
207 { 0x0703, 0xA101 },
208 { 0x0704, 0xA101 },
209 { 0x0707, 0xA101 },
210 { 0x0708, 0xA101 },
211 { 0x0709, 0xA101 },
212 { 0x070A, 0xA101 },
213 { 0x0720, 0x0000 },
214 { 0x0721, 0x0156 },
215 { 0x0732, 0x0000 },
216 { 0x0738, 0x07FF },
217 { 0x0739, 0xDFEF },
218 { 0x0740, 0x0000 },
219 { 0x0748, 0x003F },
220};
221
222static struct reg_default wm8994_defaults[] = {
223 { 0x0001, 0x0000 },
224 { 0x0002, 0x6000 },
225 { 0x0003, 0x0000 },
226 { 0x0004, 0x0000 },
227 { 0x0005, 0x0000 },
228 { 0x0006, 0x0000 },
229 { 0x0015, 0x0000 },
230 { 0x0018, 0x008B },
231 { 0x0019, 0x008B },
232 { 0x001A, 0x008B },
233 { 0x001B, 0x008B },
234 { 0x001C, 0x006D },
235 { 0x001D, 0x006D },
236 { 0x001E, 0x0066 },
237 { 0x001F, 0x0020 },
238 { 0x0020, 0x0079 },
239 { 0x0021, 0x0079 },
240 { 0x0022, 0x0003 },
241 { 0x0023, 0x0003 },
242 { 0x0024, 0x0011 },
243 { 0x0025, 0x0140 },
244 { 0x0026, 0x0079 },
245 { 0x0027, 0x0079 },
246 { 0x0028, 0x0000 },
247 { 0x0029, 0x0000 },
248 { 0x002A, 0x0000 },
249 { 0x002B, 0x0000 },
250 { 0x002C, 0x0000 },
251 { 0x002D, 0x0000 },
252 { 0x002E, 0x0000 },
253 { 0x002F, 0x0000 },
254 { 0x0030, 0x0000 },
255 { 0x0031, 0x0000 },
256 { 0x0032, 0x0000 },
257 { 0x0033, 0x0000 },
258 { 0x0034, 0x0000 },
259 { 0x0035, 0x0000 },
260 { 0x0036, 0x0000 },
261 { 0x0037, 0x0000 },
262 { 0x0038, 0x0000 },
263 { 0x0039, 0x0000 },
264 { 0x003A, 0x0000 },
265 { 0x003B, 0x000D },
266 { 0x003C, 0x0003 },
267 { 0x004C, 0x1F25 },
268 { 0x0051, 0x0004 },
269 { 0x0055, 0x054A },
270 { 0x0057, 0x0000 },
271 { 0x0060, 0x0000 },
272 { 0x0101, 0x8004 },
273 { 0x0110, 0x0000 },
274 { 0x0111, 0x0000 },
275 { 0x0200, 0x0000 },
276 { 0x0201, 0x0000 },
277 { 0x0204, 0x0000 },
278 { 0x0205, 0x0000 },
279 { 0x0208, 0x0000 },
280 { 0x0209, 0x0000 },
281 { 0x0210, 0x0083 },
282 { 0x0211, 0x0083 },
283 { 0x0220, 0x0000 },
284 { 0x0221, 0x0000 },
285 { 0x0222, 0x0000 },
286 { 0x0223, 0x0000 },
287 { 0x0224, 0x0C80 },
288 { 0x0240, 0x0000 },
289 { 0x0241, 0x0000 },
290 { 0x0242, 0x0000 },
291 { 0x0243, 0x0000 },
292 { 0x0244, 0x0C80 },
293 { 0x0300, 0x4050 },
294 { 0x0301, 0x4000 },
295 { 0x0302, 0x0000 },
296 { 0x0303, 0x0040 },
297 { 0x0304, 0x0040 },
298 { 0x0305, 0x0040 },
299 { 0x0306, 0x0004 },
300 { 0x0307, 0x0100 },
301 { 0x0310, 0x4050 },
302 { 0x0311, 0x4000 },
303 { 0x0312, 0x0000 },
304 { 0x0313, 0x0040 },
305 { 0x0314, 0x0040 },
306 { 0x0315, 0x0040 },
307 { 0x0316, 0x0000 },
308 { 0x0317, 0x0000 },
309 { 0x0400, 0x00C0 },
310 { 0x0401, 0x00C0 },
311 { 0x0402, 0x00C0 },
312 { 0x0403, 0x00C0 },
313 { 0x0404, 0x00C0 },
314 { 0x0405, 0x00C0 },
315 { 0x0406, 0x00C0 },
316 { 0x0407, 0x00C0 },
317 { 0x0410, 0x0000 },
318 { 0x0411, 0x0000 },
319 { 0x0420, 0x0200 },
320 { 0x0421, 0x0010 },
321 { 0x0422, 0x0200 },
322 { 0x0423, 0x0010 },
323 { 0x0440, 0x0098 },
324 { 0x0441, 0x0845 },
325 { 0x0442, 0x0000 },
326 { 0x0443, 0x0000 },
327 { 0x0444, 0x0000 },
328 { 0x0450, 0x0098 },
329 { 0x0451, 0x0845 },
330 { 0x0452, 0x0000 },
331 { 0x0453, 0x0000 },
332 { 0x0454, 0x0000 },
333 { 0x0480, 0x6318 },
334 { 0x0481, 0x6300 },
335 { 0x0482, 0x0FCA },
336 { 0x0483, 0x0400 },
337 { 0x0484, 0x00D8 },
338 { 0x0485, 0x1EB5 },
339 { 0x0486, 0xF145 },
340 { 0x0487, 0x0B75 },
341 { 0x0488, 0x01C5 },
342 { 0x0489, 0x1C58 },
343 { 0x048A, 0xF373 },
344 { 0x048B, 0x0A54 },
345 { 0x048C, 0x0558 },
346 { 0x048D, 0x168E },
347 { 0x048E, 0xF829 },
348 { 0x048F, 0x07AD },
349 { 0x0490, 0x1103 },
350 { 0x0491, 0x0564 },
351 { 0x0492, 0x0559 },
352 { 0x0493, 0x4000 },
353 { 0x04A0, 0x6318 },
354 { 0x04A1, 0x6300 },
355 { 0x04A2, 0x0FCA },
356 { 0x04A3, 0x0400 },
357 { 0x04A4, 0x00D8 },
358 { 0x04A5, 0x1EB5 },
359 { 0x04A6, 0xF145 },
360 { 0x04A7, 0x0B75 },
361 { 0x04A8, 0x01C5 },
362 { 0x04A9, 0x1C58 },
363 { 0x04AA, 0xF373 },
364 { 0x04AB, 0x0A54 },
365 { 0x04AC, 0x0558 },
366 { 0x04AD, 0x168E },
367 { 0x04AE, 0xF829 },
368 { 0x04AF, 0x07AD },
369 { 0x04B0, 0x1103 },
370 { 0x04B1, 0x0564 },
371 { 0x04B2, 0x0559 },
372 { 0x04B3, 0x4000 },
373 { 0x0500, 0x00C0 },
374 { 0x0501, 0x00C0 },
375 { 0x0502, 0x00C0 },
376 { 0x0503, 0x00C0 },
377 { 0x0510, 0x0000 },
378 { 0x0520, 0x0200 },
379 { 0x0521, 0x0010 },
380 { 0x0540, 0x0098 },
381 { 0x0541, 0x0845 },
382 { 0x0542, 0x0000 },
383 { 0x0543, 0x0000 },
384 { 0x0544, 0x0000 },
385 { 0x0580, 0x6318 },
386 { 0x0581, 0x6300 },
387 { 0x0582, 0x0FCA },
388 { 0x0583, 0x0400 },
389 { 0x0584, 0x00D8 },
390 { 0x0585, 0x1EB5 },
391 { 0x0586, 0xF145 },
392 { 0x0587, 0x0B75 },
393 { 0x0588, 0x01C5 },
394 { 0x0589, 0x1C58 },
395 { 0x058A, 0xF373 },
396 { 0x058B, 0x0A54 },
397 { 0x058C, 0x0558 },
398 { 0x058D, 0x168E },
399 { 0x058E, 0xF829 },
400 { 0x058F, 0x07AD },
401 { 0x0590, 0x1103 },
402 { 0x0591, 0x0564 },
403 { 0x0592, 0x0559 },
404 { 0x0593, 0x4000 },
405 { 0x0600, 0x0000 },
406 { 0x0601, 0x0000 },
407 { 0x0602, 0x0000 },
408 { 0x0603, 0x0000 },
409 { 0x0604, 0x0000 },
410 { 0x0605, 0x0000 },
411 { 0x0606, 0x0000 },
412 { 0x0607, 0x0000 },
413 { 0x0608, 0x0000 },
414 { 0x0609, 0x0000 },
415 { 0x0610, 0x02C0 },
416 { 0x0611, 0x02C0 },
417 { 0x0612, 0x02C0 },
418 { 0x0613, 0x02C0 },
419 { 0x0614, 0x0000 },
420 { 0x0620, 0x0002 },
421 { 0x0621, 0x0000 },
422 { 0x0700, 0x8100 },
423 { 0x0701, 0xA101 },
424 { 0x0702, 0xA101 },
425 { 0x0703, 0xA101 },
426 { 0x0704, 0xA101 },
427 { 0x0705, 0xA101 },
428 { 0x0706, 0xA101 },
429 { 0x0707, 0xA101 },
430 { 0x0708, 0xA101 },
431 { 0x0709, 0xA101 },
432 { 0x070A, 0xA101 },
433 { 0x0720, 0x0000 },
434 { 0x0721, 0x0156 },
435 { 0x0738, 0x07FF },
436 { 0x0739, 0xFFFF },
437 { 0x0740, 0x0000 },
438 { 0x0748, 0x003F },
439};
440
441static struct reg_default wm8958_defaults[] = {
442 { 0x0001, 0x0000 },
443 { 0x0002, 0x6000 },
444 { 0x0003, 0x0000 },
445 { 0x0004, 0x0000 },
446 { 0x0005, 0x0000 },
447 { 0x0006, 0x0000 },
448 { 0x0015, 0x0000 },
449 { 0x0018, 0x008B },
450 { 0x0019, 0x008B },
451 { 0x001A, 0x008B },
452 { 0x001B, 0x008B },
453 { 0x001C, 0x006D },
454 { 0x001D, 0x006D },
455 { 0x001E, 0x0066 },
456 { 0x001F, 0x0020 },
457 { 0x0020, 0x0079 },
458 { 0x0021, 0x0079 },
459 { 0x0022, 0x0003 },
460 { 0x0023, 0x0003 },
461 { 0x0024, 0x0011 },
462 { 0x0025, 0x0140 },
463 { 0x0026, 0x0079 },
464 { 0x0027, 0x0079 },
465 { 0x0028, 0x0000 },
466 { 0x0029, 0x0000 },
467 { 0x002A, 0x0000 },
468 { 0x002B, 0x0000 },
469 { 0x002C, 0x0000 },
470 { 0x002D, 0x0000 },
471 { 0x002E, 0x0000 },
472 { 0x002F, 0x0000 },
473 { 0x0030, 0x0000 },
474 { 0x0031, 0x0000 },
475 { 0x0032, 0x0000 },
476 { 0x0033, 0x0000 },
477 { 0x0034, 0x0000 },
478 { 0x0035, 0x0000 },
479 { 0x0036, 0x0000 },
480 { 0x0037, 0x0000 },
481 { 0x0038, 0x0000 },
482 { 0x0039, 0x0180 },
483 { 0x003B, 0x000D },
484 { 0x003C, 0x0005 },
485 { 0x003D, 0x0039 },
486 { 0x003E, 0x0039 },
487 { 0x004C, 0x1F25 },
488 { 0x004D, 0xAB19 },
489 { 0x0051, 0x0004 },
490 { 0x0055, 0x054A },
491 { 0x0057, 0x0000 },
492 { 0x0060, 0x0000 },
493 { 0x00C5, 0x0000 },
494 { 0x00D0, 0x5600 },
495 { 0x00D1, 0x007F },
496 { 0x0101, 0x8004 },
497 { 0x0110, 0x0000 },
498 { 0x0111, 0x0000 },
499 { 0x0200, 0x0000 },
500 { 0x0201, 0x0000 },
501 { 0x0204, 0x0000 },
502 { 0x0205, 0x0000 },
503 { 0x0208, 0x0000 },
504 { 0x0209, 0x0000 },
505 { 0x0210, 0x0083 },
506 { 0x0211, 0x0083 },
507 { 0x0220, 0x0000 },
508 { 0x0221, 0x0000 },
509 { 0x0222, 0x0000 },
510 { 0x0223, 0x0000 },
511 { 0x0224, 0x0C80 },
512 { 0x0226, 0x0000 },
513 { 0x0227, 0x0006 },
514 { 0x0240, 0x0000 },
515 { 0x0241, 0x0000 },
516 { 0x0242, 0x0000 },
517 { 0x0243, 0x0000 },
518 { 0x0244, 0x0C80 },
519 { 0x0246, 0x0000 },
520 { 0x0247, 0x0006 },
521 { 0x0300, 0x4050 },
522 { 0x0301, 0x4000 },
523 { 0x0302, 0x0000 },
524 { 0x0303, 0x0040 },
525 { 0x0304, 0x0040 },
526 { 0x0305, 0x0040 },
527 { 0x0306, 0x0004 },
528 { 0x0307, 0x0100 },
529 { 0x0310, 0x4053 },
530 { 0x0311, 0x4000 },
531 { 0x0312, 0x0000 },
532 { 0x0313, 0x0040 },
533 { 0x0314, 0x0040 },
534 { 0x0315, 0x0040 },
535 { 0x0316, 0x0000 },
536 { 0x0317, 0x0000 },
537 { 0x0320, 0x0040 },
538 { 0x0321, 0x0000 },
539 { 0x0322, 0x0000 },
540 { 0x0323, 0x0000 },
541 { 0x0400, 0x00C0 },
542 { 0x0401, 0x00C0 },
543 { 0x0402, 0x00C0 },
544 { 0x0403, 0x00C0 },
545 { 0x0404, 0x00C0 },
546 { 0x0405, 0x00C0 },
547 { 0x0406, 0x00C0 },
548 { 0x0407, 0x00C0 },
549 { 0x0410, 0x0000 },
550 { 0x0411, 0x0000 },
551 { 0x0420, 0x0200 },
552 { 0x0421, 0x0010 },
553 { 0x0422, 0x0200 },
554 { 0x0423, 0x0010 },
555 { 0x0430, 0x0068 },
556 { 0x0431, 0x0068 },
557 { 0x0440, 0x0098 },
558 { 0x0441, 0x0845 },
559 { 0x0442, 0x0000 },
560 { 0x0443, 0x0000 },
561 { 0x0444, 0x0000 },
562 { 0x0450, 0x0098 },
563 { 0x0451, 0x0845 },
564 { 0x0452, 0x0000 },
565 { 0x0453, 0x0000 },
566 { 0x0454, 0x0000 },
567 { 0x0480, 0x6318 },
568 { 0x0481, 0x6300 },
569 { 0x0482, 0x0FCA },
570 { 0x0483, 0x0400 },
571 { 0x0484, 0x00D8 },
572 { 0x0485, 0x1EB5 },
573 { 0x0486, 0xF145 },
574 { 0x0487, 0x0B75 },
575 { 0x0488, 0x01C5 },
576 { 0x0489, 0x1C58 },
577 { 0x048A, 0xF373 },
578 { 0x048B, 0x0A54 },
579 { 0x048C, 0x0558 },
580 { 0x048D, 0x168E },
581 { 0x048E, 0xF829 },
582 { 0x048F, 0x07AD },
583 { 0x0490, 0x1103 },
584 { 0x0491, 0x0564 },
585 { 0x0492, 0x0559 },
586 { 0x0493, 0x4000 },
587 { 0x0494, 0x0000 },
588 { 0x04A0, 0x6318 },
589 { 0x04A1, 0x6300 },
590 { 0x04A2, 0x0FCA },
591 { 0x04A3, 0x0400 },
592 { 0x04A4, 0x00D8 },
593 { 0x04A5, 0x1EB5 },
594 { 0x04A6, 0xF145 },
595 { 0x04A7, 0x0B75 },
596 { 0x04A8, 0x01C5 },
597 { 0x04A9, 0x1C58 },
598 { 0x04AA, 0xF373 },
599 { 0x04AB, 0x0A54 },
600 { 0x04AC, 0x0558 },
601 { 0x04AD, 0x168E },
602 { 0x04AE, 0xF829 },
603 { 0x04AF, 0x07AD },
604 { 0x04B0, 0x1103 },
605 { 0x04B1, 0x0564 },
606 { 0x04B2, 0x0559 },
607 { 0x04B3, 0x4000 },
608 { 0x04B4, 0x0000 },
609 { 0x0500, 0x00C0 },
610 { 0x0501, 0x00C0 },
611 { 0x0502, 0x00C0 },
612 { 0x0503, 0x00C0 },
613 { 0x0510, 0x0000 },
614 { 0x0520, 0x0200 },
615 { 0x0521, 0x0010 },
616 { 0x0530, 0x0068 },
617 { 0x0540, 0x0098 },
618 { 0x0541, 0x0845 },
619 { 0x0542, 0x0000 },
620 { 0x0543, 0x0000 },
621 { 0x0544, 0x0000 },
622 { 0x0580, 0x6318 },
623 { 0x0581, 0x6300 },
624 { 0x0582, 0x0FCA },
625 { 0x0583, 0x0400 },
626 { 0x0584, 0x00D8 },
627 { 0x0585, 0x1EB5 },
628 { 0x0586, 0xF145 },
629 { 0x0587, 0x0B75 },
630 { 0x0588, 0x01C5 },
631 { 0x0589, 0x1C58 },
632 { 0x058A, 0xF373 },
633 { 0x058B, 0x0A54 },
634 { 0x058C, 0x0558 },
635 { 0x058D, 0x168E },
636 { 0x058E, 0xF829 },
637 { 0x058F, 0x07AD },
638 { 0x0590, 0x1103 },
639 { 0x0591, 0x0564 },
640 { 0x0592, 0x0559 },
641 { 0x0593, 0x4000 },
642 { 0x0594, 0x0000 },
643 { 0x0600, 0x0000 },
644 { 0x0601, 0x0000 },
645 { 0x0602, 0x0000 },
646 { 0x0603, 0x0000 },
647 { 0x0604, 0x0000 },
648 { 0x0605, 0x0000 },
649 { 0x0606, 0x0000 },
650 { 0x0607, 0x0000 },
651 { 0x0608, 0x0000 },
652 { 0x0609, 0x0000 },
653 { 0x0610, 0x02C0 },
654 { 0x0611, 0x02C0 },
655 { 0x0612, 0x02C0 },
656 { 0x0613, 0x02C0 },
657 { 0x0614, 0x0000 },
658 { 0x0620, 0x0002 },
659 { 0x0621, 0x0000 },
660 { 0x0700, 0x8100 },
661 { 0x0701, 0xA101 },
662 { 0x0702, 0xA101 },
663 { 0x0703, 0xA101 },
664 { 0x0704, 0xA101 },
665 { 0x0705, 0xA101 },
666 { 0x0707, 0xA101 },
667 { 0x0708, 0xA101 },
668 { 0x0709, 0xA101 },
669 { 0x070A, 0xA101 },
670 { 0x0720, 0x0000 },
671 { 0x0721, 0x0156 },
672 { 0x0738, 0x07FF },
673 { 0x0739, 0xFFEF },
674 { 0x0740, 0x0000 },
675 { 0x0748, 0x003F },
676 { 0x0900, 0x1C00 },
677 { 0x0901, 0x0000 },
678 { 0x0A0D, 0x0000 },
679 { 0x2400, 0x003F },
680 { 0x2401, 0x8BD8 },
681 { 0x2402, 0x0032 },
682 { 0x2403, 0xF52D },
683 { 0x2404, 0x0065 },
684 { 0x2405, 0xAC8C },
685 { 0x2406, 0x006B },
686 { 0x2407, 0xE087 },
687 { 0x2408, 0x0072 },
688 { 0x2409, 0x1483 },
689 { 0x240A, 0x0072 },
690 { 0x240B, 0x1483 },
691 { 0x240C, 0x0043 },
692 { 0x240D, 0x3525 },
693 { 0x240E, 0x0006 },
694 { 0x240F, 0x6A4A },
695 { 0x2410, 0x0043 },
696 { 0x2411, 0x6079 },
697 { 0x2412, 0x000C },
698 { 0x2413, 0xCCCD },
699 { 0x2414, 0x0000 },
700 { 0x2415, 0x0800 },
701 { 0x2416, 0x003F },
702 { 0x2417, 0x8BD8 },
703 { 0x2418, 0x0032 },
704 { 0x2419, 0xF52D },
705 { 0x241A, 0x0065 },
706 { 0x241B, 0xAC8C },
707 { 0x241C, 0x006B },
708 { 0x241D, 0xE087 },
709 { 0x241E, 0x0072 },
710 { 0x241F, 0x1483 },
711 { 0x2420, 0x0072 },
712 { 0x2421, 0x1483 },
713 { 0x2422, 0x0043 },
714 { 0x2423, 0x3525 },
715 { 0x2424, 0x0006 },
716 { 0x2425, 0x6A4A },
717 { 0x2426, 0x0043 },
718 { 0x2427, 0x6079 },
719 { 0x2428, 0x000C },
720 { 0x2429, 0xCCCD },
721 { 0x242A, 0x0000 },
722 { 0x242B, 0x0800 },
723 { 0x242C, 0x005A },
724 { 0x242D, 0x7EFA },
725 { 0x242E, 0x005A },
726 { 0x242F, 0x7EFA },
727 { 0x2600, 0x00A7 },
728 { 0x2601, 0x0D1C },
729 { 0x2602, 0x0083 },
730 { 0x2603, 0x98AD },
731 { 0x2606, 0x0008 },
732 { 0x2607, 0xE7A2 },
733 { 0x260A, 0x0055 },
734 { 0x260B, 0x8C4B },
735};
736
737static bool wm1811_readable_register(struct device *dev, unsigned int reg)
738{
739 switch (reg) {
740 case WM8994_SOFTWARE_RESET:
741 case WM8994_POWER_MANAGEMENT_1:
742 case WM8994_POWER_MANAGEMENT_2:
743 case WM8994_POWER_MANAGEMENT_3:
744 case WM8994_POWER_MANAGEMENT_4:
745 case WM8994_POWER_MANAGEMENT_5:
746 case WM8994_POWER_MANAGEMENT_6:
747 case WM8994_INPUT_MIXER_1:
748 case WM8994_LEFT_LINE_INPUT_1_2_VOLUME:
749 case WM8994_LEFT_LINE_INPUT_3_4_VOLUME:
750 case WM8994_RIGHT_LINE_INPUT_1_2_VOLUME:
751 case WM8994_RIGHT_LINE_INPUT_3_4_VOLUME:
752 case WM8994_LEFT_OUTPUT_VOLUME:
753 case WM8994_RIGHT_OUTPUT_VOLUME:
754 case WM8994_LINE_OUTPUTS_VOLUME:
755 case WM8994_HPOUT2_VOLUME:
756 case WM8994_LEFT_OPGA_VOLUME:
757 case WM8994_RIGHT_OPGA_VOLUME:
758 case WM8994_SPKMIXL_ATTENUATION:
759 case WM8994_SPKMIXR_ATTENUATION:
760 case WM8994_SPKOUT_MIXERS:
761 case WM8994_CLASSD:
762 case WM8994_SPEAKER_VOLUME_LEFT:
763 case WM8994_SPEAKER_VOLUME_RIGHT:
764 case WM8994_INPUT_MIXER_2:
765 case WM8994_INPUT_MIXER_3:
766 case WM8994_INPUT_MIXER_4:
767 case WM8994_INPUT_MIXER_5:
768 case WM8994_INPUT_MIXER_6:
769 case WM8994_OUTPUT_MIXER_1:
770 case WM8994_OUTPUT_MIXER_2:
771 case WM8994_OUTPUT_MIXER_3:
772 case WM8994_OUTPUT_MIXER_4:
773 case WM8994_OUTPUT_MIXER_5:
774 case WM8994_OUTPUT_MIXER_6:
775 case WM8994_HPOUT2_MIXER:
776 case WM8994_LINE_MIXER_1:
777 case WM8994_LINE_MIXER_2:
778 case WM8994_SPEAKER_MIXER:
779 case WM8994_ADDITIONAL_CONTROL:
780 case WM8994_ANTIPOP_1:
781 case WM8994_ANTIPOP_2:
782 case WM8994_LDO_1:
783 case WM8994_LDO_2:
784 case WM8958_MICBIAS1:
785 case WM8958_MICBIAS2:
786 case WM8994_CHARGE_PUMP_1:
787 case WM8958_CHARGE_PUMP_2:
788 case WM8994_CLASS_W_1:
789 case WM8994_DC_SERVO_1:
790 case WM8994_DC_SERVO_2:
791 case WM8994_DC_SERVO_READBACK:
792 case WM8994_DC_SERVO_4:
793 case WM8994_DC_SERVO_4E:
794 case WM8994_ANALOGUE_HP_1:
795 case WM8958_MIC_DETECT_1:
796 case WM8958_MIC_DETECT_2:
797 case WM8958_MIC_DETECT_3:
798 case WM8994_CHIP_REVISION:
799 case WM8994_CONTROL_INTERFACE:
800 case WM8994_AIF1_CLOCKING_1:
801 case WM8994_AIF1_CLOCKING_2:
802 case WM8994_AIF2_CLOCKING_1:
803 case WM8994_AIF2_CLOCKING_2:
804 case WM8994_CLOCKING_1:
805 case WM8994_CLOCKING_2:
806 case WM8994_AIF1_RATE:
807 case WM8994_AIF2_RATE:
808 case WM8994_RATE_STATUS:
809 case WM8994_FLL1_CONTROL_1:
810 case WM8994_FLL1_CONTROL_2:
811 case WM8994_FLL1_CONTROL_3:
812 case WM8994_FLL1_CONTROL_4:
813 case WM8994_FLL1_CONTROL_5:
814 case WM8958_FLL1_EFS_1:
815 case WM8958_FLL1_EFS_2:
816 case WM8994_FLL2_CONTROL_1:
817 case WM8994_FLL2_CONTROL_2:
818 case WM8994_FLL2_CONTROL_3:
819 case WM8994_FLL2_CONTROL_4:
820 case WM8994_FLL2_CONTROL_5:
821 case WM8958_FLL2_EFS_1:
822 case WM8958_FLL2_EFS_2:
823 case WM8994_AIF1_CONTROL_1:
824 case WM8994_AIF1_CONTROL_2:
825 case WM8994_AIF1_MASTER_SLAVE:
826 case WM8994_AIF1_BCLK:
827 case WM8994_AIF1ADC_LRCLK:
828 case WM8994_AIF1DAC_LRCLK:
829 case WM8994_AIF1DAC_DATA:
830 case WM8994_AIF1ADC_DATA:
831 case WM8994_AIF2_CONTROL_1:
832 case WM8994_AIF2_CONTROL_2:
833 case WM8994_AIF2_MASTER_SLAVE:
834 case WM8994_AIF2_BCLK:
835 case WM8994_AIF2ADC_LRCLK:
836 case WM8994_AIF2DAC_LRCLK:
837 case WM8994_AIF2DAC_DATA:
838 case WM8994_AIF2ADC_DATA:
839 case WM1811_AIF2TX_CONTROL:
840 case WM8958_AIF3_CONTROL_1:
841 case WM8958_AIF3_CONTROL_2:
842 case WM8958_AIF3DAC_DATA:
843 case WM8958_AIF3ADC_DATA:
844 case WM8994_AIF1_ADC1_LEFT_VOLUME:
845 case WM8994_AIF1_ADC1_RIGHT_VOLUME:
846 case WM8994_AIF1_DAC1_LEFT_VOLUME:
847 case WM8994_AIF1_DAC1_RIGHT_VOLUME:
848 case WM8994_AIF1_ADC1_FILTERS:
849 case WM8994_AIF1_DAC1_FILTERS_1:
850 case WM8994_AIF1_DAC1_FILTERS_2:
851 case WM8958_AIF1_DAC1_NOISE_GATE:
852 case WM8994_AIF1_DRC1_1:
853 case WM8994_AIF1_DRC1_2:
854 case WM8994_AIF1_DRC1_3:
855 case WM8994_AIF1_DRC1_4:
856 case WM8994_AIF1_DRC1_5:
857 case WM8994_AIF1_DAC1_EQ_GAINS_1:
858 case WM8994_AIF1_DAC1_EQ_GAINS_2:
859 case WM8994_AIF1_DAC1_EQ_BAND_1_A:
860 case WM8994_AIF1_DAC1_EQ_BAND_1_B:
861 case WM8994_AIF1_DAC1_EQ_BAND_1_PG:
862 case WM8994_AIF1_DAC1_EQ_BAND_2_A:
863 case WM8994_AIF1_DAC1_EQ_BAND_2_B:
864 case WM8994_AIF1_DAC1_EQ_BAND_2_C:
865 case WM8994_AIF1_DAC1_EQ_BAND_2_PG:
866 case WM8994_AIF1_DAC1_EQ_BAND_3_A:
867 case WM8994_AIF1_DAC1_EQ_BAND_3_B:
868 case WM8994_AIF1_DAC1_EQ_BAND_3_C:
869 case WM8994_AIF1_DAC1_EQ_BAND_3_PG:
870 case WM8994_AIF1_DAC1_EQ_BAND_4_A:
871 case WM8994_AIF1_DAC1_EQ_BAND_4_B:
872 case WM8994_AIF1_DAC1_EQ_BAND_4_C:
873 case WM8994_AIF1_DAC1_EQ_BAND_4_PG:
874 case WM8994_AIF1_DAC1_EQ_BAND_5_A:
875 case WM8994_AIF1_DAC1_EQ_BAND_5_B:
876 case WM8994_AIF1_DAC1_EQ_BAND_5_PG:
877 case WM8994_AIF1_DAC1_EQ_BAND_1_C:
878 case WM8994_AIF2_ADC_LEFT_VOLUME:
879 case WM8994_AIF2_ADC_RIGHT_VOLUME:
880 case WM8994_AIF2_DAC_LEFT_VOLUME:
881 case WM8994_AIF2_DAC_RIGHT_VOLUME:
882 case WM8994_AIF2_ADC_FILTERS:
883 case WM8994_AIF2_DAC_FILTERS_1:
884 case WM8994_AIF2_DAC_FILTERS_2:
885 case WM8958_AIF2_DAC_NOISE_GATE:
886 case WM8994_AIF2_DRC_1:
887 case WM8994_AIF2_DRC_2:
888 case WM8994_AIF2_DRC_3:
889 case WM8994_AIF2_DRC_4:
890 case WM8994_AIF2_DRC_5:
891 case WM8994_AIF2_EQ_GAINS_1:
892 case WM8994_AIF2_EQ_GAINS_2:
893 case WM8994_AIF2_EQ_BAND_1_A:
894 case WM8994_AIF2_EQ_BAND_1_B:
895 case WM8994_AIF2_EQ_BAND_1_PG:
896 case WM8994_AIF2_EQ_BAND_2_A:
897 case WM8994_AIF2_EQ_BAND_2_B:
898 case WM8994_AIF2_EQ_BAND_2_C:
899 case WM8994_AIF2_EQ_BAND_2_PG:
900 case WM8994_AIF2_EQ_BAND_3_A:
901 case WM8994_AIF2_EQ_BAND_3_B:
902 case WM8994_AIF2_EQ_BAND_3_C:
903 case WM8994_AIF2_EQ_BAND_3_PG:
904 case WM8994_AIF2_EQ_BAND_4_A:
905 case WM8994_AIF2_EQ_BAND_4_B:
906 case WM8994_AIF2_EQ_BAND_4_C:
907 case WM8994_AIF2_EQ_BAND_4_PG:
908 case WM8994_AIF2_EQ_BAND_5_A:
909 case WM8994_AIF2_EQ_BAND_5_B:
910 case WM8994_AIF2_EQ_BAND_5_PG:
911 case WM8994_AIF2_EQ_BAND_1_C:
912 case WM8994_DAC1_MIXER_VOLUMES:
913 case WM8994_DAC1_LEFT_MIXER_ROUTING:
914 case WM8994_DAC1_RIGHT_MIXER_ROUTING:
915 case WM8994_DAC2_MIXER_VOLUMES:
916 case WM8994_DAC2_LEFT_MIXER_ROUTING:
917 case WM8994_DAC2_RIGHT_MIXER_ROUTING:
918 case WM8994_AIF1_ADC1_LEFT_MIXER_ROUTING:
919 case WM8994_AIF1_ADC1_RIGHT_MIXER_ROUTING:
920 case WM8994_DAC1_LEFT_VOLUME:
921 case WM8994_DAC1_RIGHT_VOLUME:
922 case WM8994_DAC2_LEFT_VOLUME:
923 case WM8994_DAC2_RIGHT_VOLUME:
924 case WM8994_DAC_SOFTMUTE:
925 case WM8994_OVERSAMPLING:
926 case WM8994_SIDETONE:
927 case WM8994_GPIO_1:
928 case WM8994_GPIO_2:
929 case WM8994_GPIO_3:
930 case WM8994_GPIO_4:
931 case WM8994_GPIO_5:
932 case WM8994_GPIO_6:
933 case WM8994_GPIO_8:
934 case WM8994_GPIO_9:
935 case WM8994_GPIO_10:
936 case WM8994_GPIO_11:
937 case WM8994_PULL_CONTROL_1:
938 case WM8994_PULL_CONTROL_2:
939 case WM8994_INTERRUPT_STATUS_1:
940 case WM8994_INTERRUPT_STATUS_2:
941 case WM8994_INTERRUPT_RAW_STATUS_2:
942 case WM8994_INTERRUPT_STATUS_1_MASK:
943 case WM8994_INTERRUPT_STATUS_2_MASK:
944 case WM8994_INTERRUPT_CONTROL:
945 case WM8994_IRQ_DEBOUNCE:
946 return true;
947 default:
948 return false;
949 }
950}
951
952static bool wm8994_readable_register(struct device *dev, unsigned int reg)
953{
954 switch (reg) {
955 case WM8994_DC_SERVO_READBACK:
956 case WM8994_MICBIAS:
957 case WM8994_WRITE_SEQUENCER_CTRL_1:
958 case WM8994_WRITE_SEQUENCER_CTRL_2:
959 case WM8994_AIF1_ADC2_LEFT_VOLUME:
960 case WM8994_AIF1_ADC2_RIGHT_VOLUME:
961 case WM8994_AIF1_DAC2_LEFT_VOLUME:
962 case WM8994_AIF1_DAC2_RIGHT_VOLUME:
963 case WM8994_AIF1_ADC2_FILTERS:
964 case WM8994_AIF1_DAC2_FILTERS_1:
965 case WM8994_AIF1_DAC2_FILTERS_2:
966 case WM8958_AIF1_DAC2_NOISE_GATE:
967 case WM8994_AIF1_DRC2_1:
968 case WM8994_AIF1_DRC2_2:
969 case WM8994_AIF1_DRC2_3:
970 case WM8994_AIF1_DRC2_4:
971 case WM8994_AIF1_DRC2_5:
972 case WM8994_AIF1_DAC2_EQ_GAINS_1:
973 case WM8994_AIF1_DAC2_EQ_GAINS_2:
974 case WM8994_AIF1_DAC2_EQ_BAND_1_A:
975 case WM8994_AIF1_DAC2_EQ_BAND_1_B:
976 case WM8994_AIF1_DAC2_EQ_BAND_1_PG:
977 case WM8994_AIF1_DAC2_EQ_BAND_2_A:
978 case WM8994_AIF1_DAC2_EQ_BAND_2_B:
979 case WM8994_AIF1_DAC2_EQ_BAND_2_C:
980 case WM8994_AIF1_DAC2_EQ_BAND_2_PG:
981 case WM8994_AIF1_DAC2_EQ_BAND_3_A:
982 case WM8994_AIF1_DAC2_EQ_BAND_3_B:
983 case WM8994_AIF1_DAC2_EQ_BAND_3_C:
984 case WM8994_AIF1_DAC2_EQ_BAND_3_PG:
985 case WM8994_AIF1_DAC2_EQ_BAND_4_A:
986 case WM8994_AIF1_DAC2_EQ_BAND_4_B:
987 case WM8994_AIF1_DAC2_EQ_BAND_4_C:
988 case WM8994_AIF1_DAC2_EQ_BAND_4_PG:
989 case WM8994_AIF1_DAC2_EQ_BAND_5_A:
990 case WM8994_AIF1_DAC2_EQ_BAND_5_B:
991 case WM8994_AIF1_DAC2_EQ_BAND_5_PG:
992 case WM8994_AIF1_DAC2_EQ_BAND_1_C:
993 case WM8994_DAC2_MIXER_VOLUMES:
994 case WM8994_DAC2_LEFT_MIXER_ROUTING:
995 case WM8994_DAC2_RIGHT_MIXER_ROUTING:
996 case WM8994_AIF1_ADC2_LEFT_MIXER_ROUTING:
997 case WM8994_AIF1_ADC2_RIGHT_MIXER_ROUTING:
998 case WM8994_DAC2_LEFT_VOLUME:
999 case WM8994_DAC2_RIGHT_VOLUME:
1000 return true;
1001 default:
1002 return wm1811_readable_register(dev, reg);
1003 }
1004}
1005
1006static bool wm8958_readable_register(struct device *dev, unsigned int reg)
1007{
1008 switch (reg) {
1009 case WM8958_DSP2_PROGRAM:
1010 case WM8958_DSP2_CONFIG:
1011 case WM8958_DSP2_MAGICNUM:
1012 case WM8958_DSP2_RELEASEYEAR:
1013 case WM8958_DSP2_RELEASEMONTHDAY:
1014 case WM8958_DSP2_RELEASETIME:
1015 case WM8958_DSP2_VERMAJMIN:
1016 case WM8958_DSP2_VERBUILD:
1017 case WM8958_DSP2_TESTREG:
1018 case WM8958_DSP2_XORREG:
1019 case WM8958_DSP2_SHIFTMAXX:
1020 case WM8958_DSP2_SHIFTMAXY:
1021 case WM8958_DSP2_SHIFTMAXZ:
1022 case WM8958_DSP2_SHIFTMAXEXTLO:
1023 case WM8958_DSP2_AESSELECT:
1024 case WM8958_DSP2_EXECCONTROL:
1025 case WM8958_DSP2_SAMPLEBREAK:
1026 case WM8958_DSP2_COUNTBREAK:
1027 case WM8958_DSP2_INTSTATUS:
1028 case WM8958_DSP2_EVENTSTATUS:
1029 case WM8958_DSP2_INTMASK:
1030 case WM8958_DSP2_CONFIGDWIDTH:
1031 case WM8958_DSP2_CONFIGINSTR:
1032 case WM8958_DSP2_CONFIGDMEM:
1033 case WM8958_DSP2_CONFIGDELAYS:
1034 case WM8958_DSP2_CONFIGNUMIO:
1035 case WM8958_DSP2_CONFIGEXTDEPTH:
1036 case WM8958_DSP2_CONFIGMULTIPLIER:
1037 case WM8958_DSP2_CONFIGCTRLDWIDTH:
1038 case WM8958_DSP2_CONFIGPIPELINE:
1039 case WM8958_DSP2_SHIFTMAXEXTHI:
1040 case WM8958_DSP2_SWVERSIONREG:
1041 case WM8958_DSP2_CONFIGXMEM:
1042 case WM8958_DSP2_CONFIGYMEM:
1043 case WM8958_DSP2_CONFIGZMEM:
1044 case WM8958_FW_BUILD_1:
1045 case WM8958_FW_BUILD_0:
1046 case WM8958_FW_ID_1:
1047 case WM8958_FW_ID_0:
1048 case WM8958_FW_MAJOR_1:
1049 case WM8958_FW_MAJOR_0:
1050 case WM8958_FW_MINOR_1:
1051 case WM8958_FW_MINOR_0:
1052 case WM8958_FW_PATCH_1:
1053 case WM8958_FW_PATCH_0:
1054 case WM8958_MBC_BAND_1_K_1:
1055 case WM8958_MBC_BAND_1_K_2:
1056 case WM8958_MBC_BAND_1_N1_1:
1057 case WM8958_MBC_BAND_1_N1_2:
1058 case WM8958_MBC_BAND_1_N2_1:
1059 case WM8958_MBC_BAND_1_N2_2:
1060 case WM8958_MBC_BAND_1_N3_1:
1061 case WM8958_MBC_BAND_1_N3_2:
1062 case WM8958_MBC_BAND_1_N4_1:
1063 case WM8958_MBC_BAND_1_N4_2:
1064 case WM8958_MBC_BAND_1_N5_1:
1065 case WM8958_MBC_BAND_1_N5_2:
1066 case WM8958_MBC_BAND_1_X1_1:
1067 case WM8958_MBC_BAND_1_X1_2:
1068 case WM8958_MBC_BAND_1_X2_1:
1069 case WM8958_MBC_BAND_1_X2_2:
1070 case WM8958_MBC_BAND_1_X3_1:
1071 case WM8958_MBC_BAND_1_X3_2:
1072 case WM8958_MBC_BAND_1_ATTACK_1:
1073 case WM8958_MBC_BAND_1_ATTACK_2:
1074 case WM8958_MBC_BAND_1_DECAY_1:
1075 case WM8958_MBC_BAND_1_DECAY_2:
1076 case WM8958_MBC_BAND_2_K_1:
1077 case WM8958_MBC_BAND_2_K_2:
1078 case WM8958_MBC_BAND_2_N1_1:
1079 case WM8958_MBC_BAND_2_N1_2:
1080 case WM8958_MBC_BAND_2_N2_1:
1081 case WM8958_MBC_BAND_2_N2_2:
1082 case WM8958_MBC_BAND_2_N3_1:
1083 case WM8958_MBC_BAND_2_N3_2:
1084 case WM8958_MBC_BAND_2_N4_1:
1085 case WM8958_MBC_BAND_2_N4_2:
1086 case WM8958_MBC_BAND_2_N5_1:
1087 case WM8958_MBC_BAND_2_N5_2:
1088 case WM8958_MBC_BAND_2_X1_1:
1089 case WM8958_MBC_BAND_2_X1_2:
1090 case WM8958_MBC_BAND_2_X2_1:
1091 case WM8958_MBC_BAND_2_X2_2:
1092 case WM8958_MBC_BAND_2_X3_1:
1093 case WM8958_MBC_BAND_2_X3_2:
1094 case WM8958_MBC_BAND_2_ATTACK_1:
1095 case WM8958_MBC_BAND_2_ATTACK_2:
1096 case WM8958_MBC_BAND_2_DECAY_1:
1097 case WM8958_MBC_BAND_2_DECAY_2:
1098 case WM8958_MBC_B2_PG2_1:
1099 case WM8958_MBC_B2_PG2_2:
1100 case WM8958_MBC_B1_PG2_1:
1101 case WM8958_MBC_B1_PG2_2:
1102 case WM8958_MBC_CROSSOVER_1:
1103 case WM8958_MBC_CROSSOVER_2:
1104 case WM8958_MBC_HPF_1:
1105 case WM8958_MBC_HPF_2:
1106 case WM8958_MBC_LPF_1:
1107 case WM8958_MBC_LPF_2:
1108 case WM8958_MBC_RMS_LIMIT_1:
1109 case WM8958_MBC_RMS_LIMIT_2:
1110 return true;
1111 default:
1112 return wm8994_readable_register(dev, reg);
1113 }
1114}
1115
1116static bool wm8994_volatile_register(struct device *dev, unsigned int reg)
1117{
1118 switch (reg) {
1119 case WM8994_SOFTWARE_RESET:
1120 case WM8994_DC_SERVO_1:
1121 case WM8994_DC_SERVO_READBACK:
1122 case WM8994_RATE_STATUS:
1123 case WM8958_MIC_DETECT_3:
1124 case WM8994_DC_SERVO_4E:
1125 case WM8994_INTERRUPT_STATUS_1:
1126 case WM8994_INTERRUPT_STATUS_2:
1127 return true;
1128 default:
1129 return false;
1130 }
1131}
1132
1133static bool wm1811_volatile_register(struct device *dev, unsigned int reg)
1134{
1135 struct wm8994 *wm8994 = dev_get_drvdata(dev);
1136
1137 switch (reg) {
1138 case WM8994_GPIO_6:
1139 if (wm8994->cust_id > 1 || wm8994->revision > 1)
1140 return true;
1141 else
1142 return false;
1143 default:
1144 return wm8994_volatile_register(dev, reg);
1145 }
1146}
1147
1148static bool wm8958_volatile_register(struct device *dev, unsigned int reg)
1149{
1150 switch (reg) {
1151 case WM8958_DSP2_MAGICNUM:
1152 case WM8958_DSP2_RELEASEYEAR:
1153 case WM8958_DSP2_RELEASEMONTHDAY:
1154 case WM8958_DSP2_RELEASETIME:
1155 case WM8958_DSP2_VERMAJMIN:
1156 case WM8958_DSP2_VERBUILD:
1157 case WM8958_DSP2_EXECCONTROL:
1158 case WM8958_DSP2_SWVERSIONREG:
1159 case WM8958_DSP2_CONFIGXMEM:
1160 case WM8958_DSP2_CONFIGYMEM:
1161 case WM8958_DSP2_CONFIGZMEM:
1162 case WM8958_FW_BUILD_1:
1163 case WM8958_FW_BUILD_0:
1164 case WM8958_FW_ID_1:
1165 case WM8958_FW_ID_0:
1166 case WM8958_FW_MAJOR_1:
1167 case WM8958_FW_MAJOR_0:
1168 case WM8958_FW_MINOR_1:
1169 case WM8958_FW_MINOR_0:
1170 case WM8958_FW_PATCH_1:
1171 case WM8958_FW_PATCH_0:
1172 return true;
1173 default:
1174 return wm8994_volatile_register(dev, reg);
1175 }
1176}
1177
1178struct regmap_config wm1811_regmap_config = {
1179 .reg_bits = 16,
1180 .val_bits = 16,
1181
1182 .cache_type = REGCACHE_RBTREE,
1183
1184 .reg_defaults = wm1811_defaults,
1185 .num_reg_defaults = ARRAY_SIZE(wm1811_defaults),
1186
1187 .max_register = WM8994_MAX_REGISTER,
1188 .volatile_reg = wm1811_volatile_register,
1189 .readable_reg = wm1811_readable_register,
1190};
1191
1192struct regmap_config wm8994_regmap_config = {
1193 .reg_bits = 16,
1194 .val_bits = 16,
1195
1196 .cache_type = REGCACHE_RBTREE,
1197
1198 .reg_defaults = wm8994_defaults,
1199 .num_reg_defaults = ARRAY_SIZE(wm8994_defaults),
1200
1201 .max_register = WM8994_MAX_REGISTER,
1202 .volatile_reg = wm8994_volatile_register,
1203 .readable_reg = wm8994_readable_register,
1204};
1205
1206struct regmap_config wm8958_regmap_config = {
1207 .reg_bits = 16,
1208 .val_bits = 16,
1209
1210 .cache_type = REGCACHE_RBTREE,
1211
1212 .reg_defaults = wm8958_defaults,
1213 .num_reg_defaults = ARRAY_SIZE(wm8958_defaults),
1214
1215 .max_register = WM8994_MAX_REGISTER,
1216 .volatile_reg = wm8958_volatile_register,
1217 .readable_reg = wm8958_readable_register,
1218};
1219
1220struct regmap_config wm8994_base_regmap_config = {
1221 .reg_bits = 16,
1222 .val_bits = 16,
1223};
1224