blob: 61fa7cc91d15a5cda175ce90627a33c4c1af9b75 [file] [log] [blame]
Mark Brown5c6af632012-07-09 19:09:41 +01001/*
2 * wm5110.c -- WM5110 ALSA SoC Audio driver
3 *
4 * Copyright 2012 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/moduleparam.h>
15#include <linux/init.h>
16#include <linux/delay.h>
17#include <linux/pm.h>
18#include <linux/pm_runtime.h>
19#include <linux/regmap.h>
20#include <linux/slab.h>
21#include <sound/core.h>
22#include <sound/pcm.h>
23#include <sound/pcm_params.h>
24#include <sound/soc.h>
25#include <sound/jack.h>
26#include <sound/initval.h>
27#include <sound/tlv.h>
28
29#include <linux/mfd/arizona/core.h>
30#include <linux/mfd/arizona/registers.h>
31
32#include "arizona.h"
Mark Brown9a3e1b82013-11-19 16:04:01 +000033#include "wm_adsp.h"
Mark Brown5c6af632012-07-09 19:09:41 +010034#include "wm5110.h"
35
Mark Brown9a3e1b82013-11-19 16:04:01 +000036#define WM5110_NUM_ADSP 4
37
Mark Brown5c6af632012-07-09 19:09:41 +010038struct wm5110_priv {
39 struct arizona_priv core;
40 struct arizona_fll fll[2];
Charles Keepaxccaadda2015-09-17 10:45:24 +010041
42 unsigned int in_value;
43 int in_pre_pending;
44 int in_post_pending;
45
46 unsigned int in_pga_cache[6];
Mark Brown5c6af632012-07-09 19:09:41 +010047};
48
Mark Brown9a3e1b82013-11-19 16:04:01 +000049static const struct wm_adsp_region wm5110_dsp1_regions[] = {
50 { .type = WMFW_ADSP2_PM, .base = 0x100000 },
51 { .type = WMFW_ADSP2_ZM, .base = 0x180000 },
52 { .type = WMFW_ADSP2_XM, .base = 0x190000 },
53 { .type = WMFW_ADSP2_YM, .base = 0x1a8000 },
54};
55
56static const struct wm_adsp_region wm5110_dsp2_regions[] = {
57 { .type = WMFW_ADSP2_PM, .base = 0x200000 },
58 { .type = WMFW_ADSP2_ZM, .base = 0x280000 },
59 { .type = WMFW_ADSP2_XM, .base = 0x290000 },
60 { .type = WMFW_ADSP2_YM, .base = 0x2a8000 },
61};
62
63static const struct wm_adsp_region wm5110_dsp3_regions[] = {
64 { .type = WMFW_ADSP2_PM, .base = 0x300000 },
65 { .type = WMFW_ADSP2_ZM, .base = 0x380000 },
66 { .type = WMFW_ADSP2_XM, .base = 0x390000 },
67 { .type = WMFW_ADSP2_YM, .base = 0x3a8000 },
68};
69
70static const struct wm_adsp_region wm5110_dsp4_regions[] = {
71 { .type = WMFW_ADSP2_PM, .base = 0x400000 },
72 { .type = WMFW_ADSP2_ZM, .base = 0x480000 },
73 { .type = WMFW_ADSP2_XM, .base = 0x490000 },
74 { .type = WMFW_ADSP2_YM, .base = 0x4a8000 },
75};
76
77static const struct wm_adsp_region *wm5110_dsp_regions[] = {
78 wm5110_dsp1_regions,
79 wm5110_dsp2_regions,
80 wm5110_dsp3_regions,
81 wm5110_dsp4_regions,
82};
83
Charles Keepaxf69f86b2013-11-19 10:51:29 +000084static const struct reg_default wm5110_sysclk_revd_patch[] = {
85 { 0x3093, 0x1001 },
86 { 0x30E3, 0x1301 },
87 { 0x3133, 0x1201 },
88 { 0x3183, 0x1501 },
89 { 0x31D3, 0x1401 },
Charles Keepax34354792014-01-21 16:27:51 +000090 { 0x0049, 0x01ea },
91 { 0x004a, 0x01f2 },
92 { 0x0057, 0x01e7 },
93 { 0x0058, 0x01fb },
94 { 0x33ce, 0xc4f5 },
95 { 0x33cf, 0x1361 },
96 { 0x33d0, 0x0402 },
97 { 0x33d1, 0x4700 },
98 { 0x33d2, 0x026d },
99 { 0x33d3, 0xff00 },
100 { 0x33d4, 0x026d },
101 { 0x33d5, 0x0101 },
102 { 0x33d6, 0xc4f5 },
103 { 0x33d7, 0x0361 },
104 { 0x33d8, 0x0402 },
105 { 0x33d9, 0x6701 },
106 { 0x33da, 0xc4f5 },
107 { 0x33db, 0x136f },
108 { 0x33dc, 0xc4f5 },
109 { 0x33dd, 0x134f },
110 { 0x33de, 0xc4f5 },
111 { 0x33df, 0x131f },
112 { 0x33e0, 0x026d },
113 { 0x33e1, 0x4f01 },
114 { 0x33e2, 0x026d },
115 { 0x33e3, 0xf100 },
116 { 0x33e4, 0x026d },
117 { 0x33e5, 0x0001 },
118 { 0x33e6, 0xc4f5 },
119 { 0x33e7, 0x0361 },
120 { 0x33e8, 0x0402 },
121 { 0x33e9, 0x6601 },
122 { 0x33ea, 0xc4f5 },
123 { 0x33eb, 0x136f },
124 { 0x33ec, 0xc4f5 },
125 { 0x33ed, 0x134f },
126 { 0x33ee, 0xc4f5 },
127 { 0x33ef, 0x131f },
128 { 0x33f0, 0x026d },
129 { 0x33f1, 0x4e01 },
130 { 0x33f2, 0x026d },
131 { 0x33f3, 0xf000 },
132 { 0x33f6, 0xc4f5 },
133 { 0x33f7, 0x1361 },
134 { 0x33f8, 0x0402 },
135 { 0x33f9, 0x4600 },
136 { 0x33fa, 0x026d },
137 { 0x33fb, 0xfe00 },
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000138};
139
Charles Keepaxd1acd312015-07-07 15:28:14 +0100140static const struct reg_default wm5110_sysclk_reve_patch[] = {
141 { 0x3270, 0xE410 },
142 { 0x3271, 0x3078 },
143 { 0x3272, 0xE410 },
144 { 0x3273, 0x3070 },
145 { 0x3274, 0xE410 },
146 { 0x3275, 0x3066 },
147 { 0x3276, 0xE410 },
148 { 0x3277, 0x3056 },
149 { 0x327A, 0xE414 },
150 { 0x327B, 0x3078 },
151 { 0x327C, 0xE414 },
152 { 0x327D, 0x3070 },
153 { 0x327E, 0xE414 },
154 { 0x327F, 0x3066 },
155 { 0x3280, 0xE414 },
156 { 0x3281, 0x3056 },
157};
158
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000159static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w,
160 struct snd_kcontrol *kcontrol, int event)
161{
Lars-Peter Clausencf533802015-01-13 10:27:11 +0100162 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000163 struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
Lars-Peter Clausen055bbe22014-03-01 13:45:32 +0100164 struct regmap *regmap = arizona->regmap;
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000165 const struct reg_default *patch = NULL;
166 int i, patch_size;
167
168 switch (arizona->rev) {
169 case 3:
170 patch = wm5110_sysclk_revd_patch;
171 patch_size = ARRAY_SIZE(wm5110_sysclk_revd_patch);
172 break;
173 default:
Charles Keepaxd1acd312015-07-07 15:28:14 +0100174 patch = wm5110_sysclk_reve_patch;
175 patch_size = ARRAY_SIZE(wm5110_sysclk_reve_patch);
176 break;
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000177 }
178
179 switch (event) {
180 case SND_SOC_DAPM_POST_PMU:
181 if (patch)
182 for (i = 0; i < patch_size; i++)
Mark Brown959e4082013-12-12 00:49:56 +0000183 regmap_write_async(regmap, patch[i].reg,
184 patch[i].def);
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000185 break;
186
187 default:
188 break;
189 }
190
191 return 0;
192}
193
Nariman Poushindc606e052015-07-17 15:11:10 +0100194static const struct reg_sequence wm5110_no_dre_left_enable[] = {
Charles Keepaxd1acd312015-07-07 15:28:14 +0100195 { 0x3024, 0xE410 },
196 { 0x3025, 0x0056 },
197 { 0x301B, 0x0224 },
198 { 0x301F, 0x4263 },
199 { 0x3021, 0x5291 },
200 { 0x3030, 0xE410 },
201 { 0x3031, 0x3066 },
202 { 0x3032, 0xE410 },
203 { 0x3033, 0x3070 },
204 { 0x3034, 0xE410 },
205 { 0x3035, 0x3078 },
206 { 0x3036, 0xE410 },
207 { 0x3037, 0x3080 },
208 { 0x3038, 0xE410 },
209 { 0x3039, 0x3080 },
210};
211
Nariman Poushindc606e052015-07-17 15:11:10 +0100212static const struct reg_sequence wm5110_dre_left_enable[] = {
Charles Keepaxd1acd312015-07-07 15:28:14 +0100213 { 0x3024, 0x0231 },
214 { 0x3025, 0x0B00 },
215 { 0x301B, 0x0227 },
216 { 0x301F, 0x4266 },
217 { 0x3021, 0x5294 },
218 { 0x3030, 0xE231 },
219 { 0x3031, 0x0266 },
220 { 0x3032, 0x8231 },
221 { 0x3033, 0x4B15 },
222 { 0x3034, 0x8231 },
223 { 0x3035, 0x0B15 },
224 { 0x3036, 0xE231 },
225 { 0x3037, 0x5294 },
226 { 0x3038, 0x0231 },
227 { 0x3039, 0x0B00 },
228};
229
Nariman Poushindc606e052015-07-17 15:11:10 +0100230static const struct reg_sequence wm5110_no_dre_right_enable[] = {
Charles Keepaxd1acd312015-07-07 15:28:14 +0100231 { 0x3074, 0xE414 },
232 { 0x3075, 0x0056 },
233 { 0x306B, 0x0224 },
234 { 0x306F, 0x4263 },
235 { 0x3071, 0x5291 },
236 { 0x3080, 0xE414 },
237 { 0x3081, 0x3066 },
238 { 0x3082, 0xE414 },
239 { 0x3083, 0x3070 },
240 { 0x3084, 0xE414 },
241 { 0x3085, 0x3078 },
242 { 0x3086, 0xE414 },
243 { 0x3087, 0x3080 },
244 { 0x3088, 0xE414 },
245 { 0x3089, 0x3080 },
246};
247
Nariman Poushindc606e052015-07-17 15:11:10 +0100248static const struct reg_sequence wm5110_dre_right_enable[] = {
Charles Keepaxd1acd312015-07-07 15:28:14 +0100249 { 0x3074, 0x0231 },
250 { 0x3075, 0x0B00 },
251 { 0x306B, 0x0227 },
252 { 0x306F, 0x4266 },
253 { 0x3071, 0x5294 },
254 { 0x3080, 0xE231 },
255 { 0x3081, 0x0266 },
256 { 0x3082, 0x8231 },
257 { 0x3083, 0x4B17 },
258 { 0x3084, 0x8231 },
259 { 0x3085, 0x0B17 },
260 { 0x3086, 0xE231 },
261 { 0x3087, 0x5294 },
262 { 0x3088, 0x0231 },
263 { 0x3089, 0x0B00 },
264};
265
266static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w)
267{
268 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
269 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
270 struct arizona *arizona = priv->arizona;
271 unsigned int val = snd_soc_read(codec, ARIZONA_DRE_ENABLE);
Nariman Poushindc606e052015-07-17 15:11:10 +0100272 const struct reg_sequence *wseq;
Charles Keepaxd1acd312015-07-07 15:28:14 +0100273 int nregs;
274
275 switch (w->shift) {
276 case ARIZONA_OUT1L_ENA_SHIFT:
277 if (val & ARIZONA_DRE1L_ENA_MASK) {
278 wseq = wm5110_dre_left_enable;
279 nregs = ARRAY_SIZE(wm5110_dre_left_enable);
280 } else {
281 wseq = wm5110_no_dre_left_enable;
282 nregs = ARRAY_SIZE(wm5110_no_dre_left_enable);
283 priv->out_up_delay += 10;
284 }
285 break;
286 case ARIZONA_OUT1R_ENA_SHIFT:
287 if (val & ARIZONA_DRE1R_ENA_MASK) {
288 wseq = wm5110_dre_right_enable;
289 nregs = ARRAY_SIZE(wm5110_dre_right_enable);
290 } else {
291 wseq = wm5110_no_dre_right_enable;
292 nregs = ARRAY_SIZE(wm5110_no_dre_right_enable);
293 priv->out_up_delay += 10;
294 }
295 break;
296 default:
297 return 0;
298 }
299
300 return regmap_multi_reg_write(arizona->regmap, wseq, nregs);
301}
302
303static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w)
304{
305 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
306 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
307 unsigned int val = snd_soc_read(codec, ARIZONA_DRE_ENABLE);
308
309 switch (w->shift) {
310 case ARIZONA_OUT1L_ENA_SHIFT:
311 if (!(val & ARIZONA_DRE1L_ENA_MASK)) {
312 snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS,
313 ARIZONA_WS_TRG1, ARIZONA_WS_TRG1);
314 snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS,
315 ARIZONA_WS_TRG1, 0);
316 priv->out_down_delay += 27;
317 }
318 break;
319 case ARIZONA_OUT1R_ENA_SHIFT:
320 if (!(val & ARIZONA_DRE1R_ENA_MASK)) {
321 snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS,
322 ARIZONA_WS_TRG2, ARIZONA_WS_TRG2);
323 snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS,
324 ARIZONA_WS_TRG2, 0);
325 priv->out_down_delay += 27;
326 }
327 break;
328 default:
329 break;
330 }
331
332 return 0;
333}
334
335static int wm5110_hp_ev(struct snd_soc_dapm_widget *w,
336 struct snd_kcontrol *kcontrol, int event)
337{
338 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
339 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
340
341 switch (priv->arizona->rev) {
342 case 0 ... 3:
343 break;
344 default:
345 switch (event) {
346 case SND_SOC_DAPM_PRE_PMU:
347 wm5110_hp_pre_enable(w);
348 break;
349 case SND_SOC_DAPM_PRE_PMD:
350 wm5110_hp_pre_disable(w);
351 break;
352 default:
353 break;
354 }
355 break;
356 }
357
358 return arizona_hp_ev(w, kcontrol, event);
359}
360
361static int wm5110_clear_pga_volume(struct arizona *arizona, int output)
362{
Nariman Poushindc606e052015-07-17 15:11:10 +0100363 struct reg_sequence clear_pga = {
Charles Keepaxd1acd312015-07-07 15:28:14 +0100364 ARIZONA_OUTPUT_PATH_CONFIG_1L + output * 4, 0x80
365 };
366 int ret;
367
368 ret = regmap_multi_reg_write_bypassed(arizona->regmap, &clear_pga, 1);
369 if (ret)
370 dev_err(arizona->dev, "Failed to clear PGA (0x%x): %d\n",
371 clear_pga.reg, ret);
372
373 return ret;
374}
375
376static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
377 struct snd_ctl_elem_value *ucontrol)
378{
379 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
380 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
381 struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
382 struct soc_mixer_control *mc =
383 (struct soc_mixer_control *)kcontrol->private_value;
384 unsigned int ena, dre;
385 unsigned int mask = (0x1 << mc->shift) | (0x1 << mc->rshift);
386 unsigned int lnew = (!!ucontrol->value.integer.value[0]) << mc->shift;
387 unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift;
388 unsigned int lold, rold;
389 unsigned int lena, rena;
390 int ret;
391
392 snd_soc_dapm_mutex_lock(dapm);
393
394 ret = regmap_read(arizona->regmap, ARIZONA_OUTPUT_ENABLES_1, &ena);
395 if (ret) {
396 dev_err(arizona->dev, "Failed to read output state: %d\n", ret);
397 goto err;
398 }
399 ret = regmap_read(arizona->regmap, ARIZONA_DRE_ENABLE, &dre);
400 if (ret) {
401 dev_err(arizona->dev, "Failed to read DRE state: %d\n", ret);
402 goto err;
403 }
404
405 lold = dre & (1 << mc->shift);
406 rold = dre & (1 << mc->rshift);
407 /* Enables are channel wise swapped from the DRE enables */
408 lena = ena & (1 << mc->rshift);
409 rena = ena & (1 << mc->shift);
410
411 if ((lena && lnew != lold) || (rena && rnew != rold)) {
412 dev_err(arizona->dev, "Can't change DRE on active outputs\n");
413 ret = -EBUSY;
414 goto err;
415 }
416
417 ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE,
418 mask, lnew | rnew);
419 if (ret) {
420 dev_err(arizona->dev, "Failed to set DRE: %d\n", ret);
421 goto err;
422 }
423
424 /* Force reset of PGA volumes, if turning DRE off */
425 if (!lnew && lold)
426 wm5110_clear_pga_volume(arizona, mc->shift);
427
428 if (!rnew && rold)
429 wm5110_clear_pga_volume(arizona, mc->rshift);
430
431err:
432 snd_soc_dapm_mutex_unlock(dapm);
433
434 return ret;
435}
436
Charles Keepaxccaadda2015-09-17 10:45:24 +0100437static int wm5110_in_pga_get(struct snd_kcontrol *kcontrol,
438 struct snd_ctl_elem_value *ucontrol)
439{
440 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
441 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
442 struct snd_soc_card *card = dapm->card;
443 int ret;
444
445 /*
446 * PGA Volume is also used as part of the enable sequence, so
447 * usage of it should be avoided whilst that is running.
448 */
449 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
450
451 ret = snd_soc_get_volsw_range(kcontrol, ucontrol);
452
453 mutex_unlock(&card->dapm_mutex);
454
455 return ret;
456}
457
458static int wm5110_in_pga_put(struct snd_kcontrol *kcontrol,
459 struct snd_ctl_elem_value *ucontrol)
460{
461 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
462 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
463 struct snd_soc_card *card = dapm->card;
464 int ret;
465
466 /*
467 * PGA Volume is also used as part of the enable sequence, so
468 * usage of it should be avoided whilst that is running.
469 */
470 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
471
472 ret = snd_soc_put_volsw_range(kcontrol, ucontrol);
473
474 mutex_unlock(&card->dapm_mutex);
475
476 return ret;
477}
478
479static int wm5110_in_analog_ev(struct snd_soc_dapm_widget *w,
480 struct snd_kcontrol *kcontrol, int event)
481{
482 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
483 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
484 struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec);
485 struct arizona *arizona = priv->arizona;
486 unsigned int reg, mask;
487 struct reg_sequence analog_seq[] = {
488 { 0x80, 0x3 },
489 { 0x35d, 0 },
490 { 0x80, 0x0 },
491 };
492
493 reg = ARIZONA_IN1L_CONTROL + ((w->shift ^ 0x1) * 4);
494 mask = ARIZONA_IN1L_PGA_VOL_MASK;
495
496 switch (event) {
497 case SND_SOC_DAPM_WILL_PMU:
498 wm5110->in_value |= 0x3 << ((w->shift ^ 0x1) * 2);
499 wm5110->in_pre_pending++;
500 wm5110->in_post_pending++;
501 return 0;
502 case SND_SOC_DAPM_PRE_PMU:
503 wm5110->in_pga_cache[w->shift] = snd_soc_read(codec, reg);
504
505 snd_soc_update_bits(codec, reg, mask,
506 0x40 << ARIZONA_IN1L_PGA_VOL_SHIFT);
507
508 wm5110->in_pre_pending--;
509 if (wm5110->in_pre_pending == 0) {
510 analog_seq[1].def = wm5110->in_value;
511 regmap_multi_reg_write_bypassed(arizona->regmap,
512 analog_seq,
513 ARRAY_SIZE(analog_seq));
514
515 msleep(55);
516
517 wm5110->in_value = 0;
518 }
519
520 break;
521 case SND_SOC_DAPM_POST_PMU:
522 snd_soc_update_bits(codec, reg, mask,
523 wm5110->in_pga_cache[w->shift]);
524
525 wm5110->in_post_pending--;
526 if (wm5110->in_post_pending == 0)
527 regmap_multi_reg_write_bypassed(arizona->regmap,
528 analog_seq,
529 ARRAY_SIZE(analog_seq));
530 break;
531 default:
532 break;
533 }
534
535 return 0;
536}
537
538static int wm5110_in_ev(struct snd_soc_dapm_widget *w,
539 struct snd_kcontrol *kcontrol, int event)
540{
541 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
542 struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
543 struct arizona *arizona = priv->arizona;
544
545 switch (arizona->rev) {
546 case 0 ... 4:
547 if (arizona_input_analog(codec, w->shift))
548 wm5110_in_analog_ev(w, kcontrol, event);
549
550 break;
551 default:
552 break;
553 }
554
555 return arizona_in_ev(w, kcontrol, event);
556}
557
Mark Brown5c6af632012-07-09 19:09:41 +0100558static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
559static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
560static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
Richard Fitzgerald15575ed2015-05-28 14:28:12 +0100561static DECLARE_TLV_DB_SCALE(noise_tlv, -13200, 600, 0);
Mark Brownbd7fe242012-12-18 13:53:26 +0000562static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
563
564#define WM5110_NG_SRC(name, base) \
565 SOC_SINGLE(name " NG HPOUT1L Switch", base, 0, 1, 0), \
566 SOC_SINGLE(name " NG HPOUT1R Switch", base, 1, 1, 0), \
567 SOC_SINGLE(name " NG HPOUT2L Switch", base, 2, 1, 0), \
568 SOC_SINGLE(name " NG HPOUT2R Switch", base, 3, 1, 0), \
569 SOC_SINGLE(name " NG HPOUT3L Switch", base, 4, 1, 0), \
570 SOC_SINGLE(name " NG HPOUT3R Switch", base, 5, 1, 0), \
571 SOC_SINGLE(name " NG SPKOUTL Switch", base, 6, 1, 0), \
572 SOC_SINGLE(name " NG SPKOUTR Switch", base, 7, 1, 0), \
573 SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \
574 SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0), \
575 SOC_SINGLE(name " NG SPKDAT2L Switch", base, 10, 1, 0), \
576 SOC_SINGLE(name " NG SPKDAT2R Switch", base, 11, 1, 0)
Mark Brown5c6af632012-07-09 19:09:41 +0100577
Charles Keepaxd1901062015-11-19 16:11:10 +0000578#define WM5110_RXANC_INPUT_ROUTES(widget, name) \
579 { widget, NULL, name " NG Mux" }, \
580 { name " NG Internal", NULL, "RXANC NG Clock" }, \
581 { name " NG Internal", NULL, name " Channel" }, \
582 { name " NG External", NULL, "RXANC NG External Clock" }, \
583 { name " NG External", NULL, name " Channel" }, \
584 { name " NG Mux", "None", name " Channel" }, \
585 { name " NG Mux", "Internal", name " NG Internal" }, \
586 { name " NG Mux", "External", name " NG External" }, \
587 { name " Channel", "Left", name " Left Input" }, \
588 { name " Channel", "Combine", name " Left Input" }, \
589 { name " Channel", "Right", name " Right Input" }, \
590 { name " Channel", "Combine", name " Right Input" }, \
591 { name " Left Input", "IN1", "IN1L PGA" }, \
592 { name " Right Input", "IN1", "IN1R PGA" }, \
593 { name " Left Input", "IN2", "IN2L PGA" }, \
594 { name " Right Input", "IN2", "IN2R PGA" }, \
595 { name " Left Input", "IN3", "IN3L PGA" }, \
596 { name " Right Input", "IN3", "IN3R PGA" }, \
597 { name " Left Input", "IN4", "IN4L PGA" }, \
598 { name " Right Input", "IN4", "IN4R PGA" }
599
600#define WM5110_RXANC_OUTPUT_ROUTES(widget, name) \
601 { widget, NULL, name " ANC Source" }, \
602 { name " ANC Source", "RXANCL", "RXANCL" }, \
603 { name " ANC Source", "RXANCR", "RXANCR" }
604
Mark Brown5c6af632012-07-09 19:09:41 +0100605static const struct snd_kcontrol_new wm5110_snd_controls[] = {
Charles Keepaxc7f38432013-08-06 17:03:55 +0100606SOC_ENUM("IN1 OSR", arizona_in_dmic_osr[0]),
607SOC_ENUM("IN2 OSR", arizona_in_dmic_osr[1]),
608SOC_ENUM("IN3 OSR", arizona_in_dmic_osr[2]),
609SOC_ENUM("IN4 OSR", arizona_in_dmic_osr[3]),
Mark Brown5c6af632012-07-09 19:09:41 +0100610
Charles Keepaxccaadda2015-09-17 10:45:24 +0100611SOC_SINGLE_RANGE_EXT_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL,
612 ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
613 wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
614SOC_SINGLE_RANGE_EXT_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL,
615 ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
616 wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
617SOC_SINGLE_RANGE_EXT_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL,
618 ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
619 wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
620SOC_SINGLE_RANGE_EXT_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL,
621 ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
622 wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
623SOC_SINGLE_RANGE_EXT_TLV("IN3L Volume", ARIZONA_IN3L_CONTROL,
624 ARIZONA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
625 wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
626SOC_SINGLE_RANGE_EXT_TLV("IN3R Volume", ARIZONA_IN3R_CONTROL,
627 ARIZONA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
628 wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
Mark Brown5c6af632012-07-09 19:09:41 +0100629
Charles Keepax254dc322013-11-19 16:04:03 +0000630SOC_ENUM("IN HPF Cutoff Frequency", arizona_in_hpf_cut_enum),
631
632SOC_SINGLE("IN1L HPF Switch", ARIZONA_IN1L_CONTROL,
633 ARIZONA_IN1L_HPF_SHIFT, 1, 0),
634SOC_SINGLE("IN1R HPF Switch", ARIZONA_IN1R_CONTROL,
635 ARIZONA_IN1R_HPF_SHIFT, 1, 0),
636SOC_SINGLE("IN2L HPF Switch", ARIZONA_IN2L_CONTROL,
637 ARIZONA_IN2L_HPF_SHIFT, 1, 0),
638SOC_SINGLE("IN2R HPF Switch", ARIZONA_IN2R_CONTROL,
639 ARIZONA_IN2R_HPF_SHIFT, 1, 0),
640SOC_SINGLE("IN3L HPF Switch", ARIZONA_IN3L_CONTROL,
641 ARIZONA_IN3L_HPF_SHIFT, 1, 0),
642SOC_SINGLE("IN3R HPF Switch", ARIZONA_IN3R_CONTROL,
643 ARIZONA_IN3R_HPF_SHIFT, 1, 0),
644SOC_SINGLE("IN4L HPF Switch", ARIZONA_IN4L_CONTROL,
645 ARIZONA_IN4L_HPF_SHIFT, 1, 0),
646SOC_SINGLE("IN4R HPF Switch", ARIZONA_IN4R_CONTROL,
647 ARIZONA_IN4R_HPF_SHIFT, 1, 0),
648
Mark Brown02482da2012-12-14 15:18:30 +0900649SOC_SINGLE_TLV("IN1L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1L,
650 ARIZONA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
651SOC_SINGLE_TLV("IN1R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1R,
652 ARIZONA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
653SOC_SINGLE_TLV("IN2L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2L,
654 ARIZONA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
655SOC_SINGLE_TLV("IN2R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2R,
656 ARIZONA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
657SOC_SINGLE_TLV("IN3L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3L,
658 ARIZONA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
659SOC_SINGLE_TLV("IN3R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3R,
660 ARIZONA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
661SOC_SINGLE_TLV("IN4L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4L,
662 ARIZONA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
663SOC_SINGLE_TLV("IN4R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4R,
664 ARIZONA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
Mark Brown5c6af632012-07-09 19:09:41 +0100665
Mark Browna1abfa82012-12-09 12:50:05 +0900666SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp),
667SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp),
668
Charles Keepaxd1901062015-11-19 16:11:10 +0000669SND_SOC_BYTES("RXANC Coefficients", ARIZONA_ANC_COEFF_START,
670 ARIZONA_ANC_COEFF_END - ARIZONA_ANC_COEFF_START + 1),
671SND_SOC_BYTES("RXANCL Config", ARIZONA_FCL_FILTER_CONTROL, 1),
672SND_SOC_BYTES("RXANCL Coefficients", ARIZONA_FCL_COEFF_START,
673 ARIZONA_FCL_COEFF_END - ARIZONA_FCL_COEFF_START + 1),
674SND_SOC_BYTES("RXANCR Config", ARIZONA_FCR_FILTER_CONTROL, 1),
675SND_SOC_BYTES("RXANCR Coefficients", ARIZONA_FCR_COEFF_START,
676 ARIZONA_FCR_COEFF_END - ARIZONA_FCR_COEFF_START + 1),
677
Mark Brown5c6af632012-07-09 19:09:41 +0100678ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE),
679ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
680ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
681ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
682
Charles Keepaxc05d9a82015-06-25 09:35:11 +0100683ARIZONA_EQ_CONTROL("EQ1 Coefficients", ARIZONA_EQ1_2),
Mark Brown5c6af632012-07-09 19:09:41 +0100684SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
685 24, 0, eq_tlv),
686SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT,
687 24, 0, eq_tlv),
688SOC_SINGLE_TLV("EQ1 B3 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B3_GAIN_SHIFT,
689 24, 0, eq_tlv),
690SOC_SINGLE_TLV("EQ1 B4 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B4_GAIN_SHIFT,
691 24, 0, eq_tlv),
692SOC_SINGLE_TLV("EQ1 B5 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B5_GAIN_SHIFT,
693 24, 0, eq_tlv),
694
Charles Keepaxc05d9a82015-06-25 09:35:11 +0100695ARIZONA_EQ_CONTROL("EQ2 Coefficients", ARIZONA_EQ2_2),
Mark Brown5c6af632012-07-09 19:09:41 +0100696SOC_SINGLE_TLV("EQ2 B1 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B1_GAIN_SHIFT,
697 24, 0, eq_tlv),
698SOC_SINGLE_TLV("EQ2 B2 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B2_GAIN_SHIFT,
699 24, 0, eq_tlv),
700SOC_SINGLE_TLV("EQ2 B3 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B3_GAIN_SHIFT,
701 24, 0, eq_tlv),
702SOC_SINGLE_TLV("EQ2 B4 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B4_GAIN_SHIFT,
703 24, 0, eq_tlv),
704SOC_SINGLE_TLV("EQ2 B5 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B5_GAIN_SHIFT,
705 24, 0, eq_tlv),
706
Charles Keepaxc05d9a82015-06-25 09:35:11 +0100707ARIZONA_EQ_CONTROL("EQ3 Coefficients", ARIZONA_EQ3_2),
Mark Brown5c6af632012-07-09 19:09:41 +0100708SOC_SINGLE_TLV("EQ3 B1 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B1_GAIN_SHIFT,
709 24, 0, eq_tlv),
710SOC_SINGLE_TLV("EQ3 B2 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B2_GAIN_SHIFT,
711 24, 0, eq_tlv),
712SOC_SINGLE_TLV("EQ3 B3 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B3_GAIN_SHIFT,
713 24, 0, eq_tlv),
714SOC_SINGLE_TLV("EQ3 B4 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B4_GAIN_SHIFT,
715 24, 0, eq_tlv),
716SOC_SINGLE_TLV("EQ3 B5 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B5_GAIN_SHIFT,
717 24, 0, eq_tlv),
718
Charles Keepaxc05d9a82015-06-25 09:35:11 +0100719ARIZONA_EQ_CONTROL("EQ4 Coefficients", ARIZONA_EQ4_2),
Mark Brown5c6af632012-07-09 19:09:41 +0100720SOC_SINGLE_TLV("EQ4 B1 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B1_GAIN_SHIFT,
721 24, 0, eq_tlv),
722SOC_SINGLE_TLV("EQ4 B2 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B2_GAIN_SHIFT,
723 24, 0, eq_tlv),
724SOC_SINGLE_TLV("EQ4 B3 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B3_GAIN_SHIFT,
725 24, 0, eq_tlv),
726SOC_SINGLE_TLV("EQ4 B4 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B4_GAIN_SHIFT,
727 24, 0, eq_tlv),
728SOC_SINGLE_TLV("EQ4 B5 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B5_GAIN_SHIFT,
729 24, 0, eq_tlv),
730
731ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE),
732ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE),
733ARIZONA_MIXER_CONTROLS("DRC2L", ARIZONA_DRC2LMIX_INPUT_1_SOURCE),
734ARIZONA_MIXER_CONTROLS("DRC2R", ARIZONA_DRC2RMIX_INPUT_1_SOURCE),
735
736SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5,
737 ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA),
738SND_SOC_BYTES_MASK("DRC2", ARIZONA_DRC2_CTRL1, 5,
739 ARIZONA_DRC2R_ENA | ARIZONA_DRC2L_ENA),
740
741ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE),
742ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE),
743ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE),
744ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE),
745
Charles Keepax5f8e6712015-06-25 09:35:12 +0100746ARIZONA_LHPF_CONTROL("LHPF1 Coefficients", ARIZONA_HPLPF1_2),
747ARIZONA_LHPF_CONTROL("LHPF2 Coefficients", ARIZONA_HPLPF2_2),
748ARIZONA_LHPF_CONTROL("LHPF3 Coefficients", ARIZONA_HPLPF3_2),
749ARIZONA_LHPF_CONTROL("LHPF4 Coefficients", ARIZONA_HPLPF4_2),
Mark Brownd4d1eaa2012-12-05 16:38:30 +0900750
Mark Brown5c6af632012-07-09 19:09:41 +0100751SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode),
752SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode),
753SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode),
754SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode),
755
Lars-Peter Clausen696d3af2014-04-14 21:31:06 +0200756SOC_ENUM("ISRC1 FSL", arizona_isrc_fsl[0]),
757SOC_ENUM("ISRC2 FSL", arizona_isrc_fsl[1]),
758SOC_ENUM("ISRC3 FSL", arizona_isrc_fsl[2]),
759SOC_ENUM("ISRC1 FSH", arizona_isrc_fsh[0]),
760SOC_ENUM("ISRC2 FSH", arizona_isrc_fsh[1]),
761SOC_ENUM("ISRC3 FSH", arizona_isrc_fsh[2]),
762SOC_ENUM("ASRC RATE 1", arizona_asrc_rate1),
Charles Keepax0da2e5b2013-11-19 16:04:02 +0000763
Mark Brown35d38892012-08-26 13:50:48 -0700764ARIZONA_MIXER_CONTROLS("DSP1L", ARIZONA_DSP1LMIX_INPUT_1_SOURCE),
765ARIZONA_MIXER_CONTROLS("DSP1R", ARIZONA_DSP1RMIX_INPUT_1_SOURCE),
766ARIZONA_MIXER_CONTROLS("DSP2L", ARIZONA_DSP2LMIX_INPUT_1_SOURCE),
767ARIZONA_MIXER_CONTROLS("DSP2R", ARIZONA_DSP2RMIX_INPUT_1_SOURCE),
768ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE),
769ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE),
770ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE),
Charles Keepax39d4ecd2013-05-24 11:38:24 +0100771ARIZONA_MIXER_CONTROLS("DSP4R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE),
Mark Brown35d38892012-08-26 13:50:48 -0700772
Mark Brown5c6af632012-07-09 19:09:41 +0100773ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE),
774ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE),
775
776SOC_SINGLE_TLV("Noise Generator Volume", ARIZONA_COMFORT_NOISE_GENERATOR,
777 ARIZONA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, noise_tlv),
778
779ARIZONA_MIXER_CONTROLS("HPOUT1L", ARIZONA_OUT1LMIX_INPUT_1_SOURCE),
780ARIZONA_MIXER_CONTROLS("HPOUT1R", ARIZONA_OUT1RMIX_INPUT_1_SOURCE),
781ARIZONA_MIXER_CONTROLS("HPOUT2L", ARIZONA_OUT2LMIX_INPUT_1_SOURCE),
782ARIZONA_MIXER_CONTROLS("HPOUT2R", ARIZONA_OUT2RMIX_INPUT_1_SOURCE),
Mark Brown35d38892012-08-26 13:50:48 -0700783ARIZONA_MIXER_CONTROLS("HPOUT3L", ARIZONA_OUT3LMIX_INPUT_1_SOURCE),
784ARIZONA_MIXER_CONTROLS("HPOUT3R", ARIZONA_OUT3RMIX_INPUT_1_SOURCE),
Mark Brown5c6af632012-07-09 19:09:41 +0100785ARIZONA_MIXER_CONTROLS("SPKOUTL", ARIZONA_OUT4LMIX_INPUT_1_SOURCE),
786ARIZONA_MIXER_CONTROLS("SPKOUTR", ARIZONA_OUT4RMIX_INPUT_1_SOURCE),
787ARIZONA_MIXER_CONTROLS("SPKDAT1L", ARIZONA_OUT5LMIX_INPUT_1_SOURCE),
788ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE),
789ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE),
790ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE),
791
Charles Keepaxafb6d4e2014-01-09 14:29:25 +0000792SOC_SINGLE("HPOUT1 SC Protect Switch", ARIZONA_HP1_SHORT_CIRCUIT_CTRL,
793 ARIZONA_HP1_SC_ENA_SHIFT, 1, 0),
794SOC_SINGLE("HPOUT2 SC Protect Switch", ARIZONA_HP2_SHORT_CIRCUIT_CTRL,
795 ARIZONA_HP2_SC_ENA_SHIFT, 1, 0),
796SOC_SINGLE("HPOUT3 SC Protect Switch", ARIZONA_HP3_SHORT_CIRCUIT_CTRL,
797 ARIZONA_HP3_SC_ENA_SHIFT, 1, 0),
798
Charles Keepax9374f372014-04-05 12:11:48 +0100799SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L,
800 ARIZONA_OUT5_OSR_SHIFT, 1, 0),
801SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L,
802 ARIZONA_OUT6_OSR_SHIFT, 1, 0),
803
Mark Brown5c6af632012-07-09 19:09:41 +0100804SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L,
805 ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1),
Charles Keepax5752ec92013-02-15 10:37:27 +0000806SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L,
Mark Brown5c6af632012-07-09 19:09:41 +0100807 ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1),
Charles Keepax5752ec92013-02-15 10:37:27 +0000808SOC_DOUBLE_R("HPOUT3 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L,
Mark Brown35d38892012-08-26 13:50:48 -0700809 ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_MUTE_SHIFT, 1, 1),
Mark Brown5c6af632012-07-09 19:09:41 +0100810SOC_DOUBLE_R("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L,
811 ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_MUTE_SHIFT, 1, 1),
812SOC_DOUBLE_R("SPKDAT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_5L,
813 ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_MUTE_SHIFT, 1, 1),
814SOC_DOUBLE_R("SPKDAT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_6L,
815 ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_MUTE_SHIFT, 1, 1),
816
817SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L,
818 ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT,
819 0xbf, 0, digital_tlv),
Charles Keepax5752ec92013-02-15 10:37:27 +0000820SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L,
Mark Brown5c6af632012-07-09 19:09:41 +0100821 ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT,
822 0xbf, 0, digital_tlv),
Charles Keepax5752ec92013-02-15 10:37:27 +0000823SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L,
Mark Brown35d38892012-08-26 13:50:48 -0700824 ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_VOL_SHIFT,
825 0xbf, 0, digital_tlv),
Mark Brown5c6af632012-07-09 19:09:41 +0100826SOC_DOUBLE_R_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L,
827 ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_VOL_SHIFT,
828 0xbf, 0, digital_tlv),
829SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_5L,
830 ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_VOL_SHIFT,
831 0xbf, 0, digital_tlv),
832SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_6L,
833 ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT,
834 0xbf, 0, digital_tlv),
835
Mark Brown5c6af632012-07-09 19:09:41 +0100836SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT,
837 ARIZONA_SPK1R_MUTE_SHIFT, 1, 1),
838SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT,
839 ARIZONA_SPK2R_MUTE_SHIFT, 1, 1),
840
Charles Keepaxd1acd312015-07-07 15:28:14 +0100841SOC_DOUBLE_EXT("HPOUT1 DRE Switch", ARIZONA_DRE_ENABLE,
842 ARIZONA_DRE1L_ENA_SHIFT, ARIZONA_DRE1R_ENA_SHIFT, 1, 0,
843 snd_soc_get_volsw, wm5110_put_dre),
844SOC_DOUBLE_EXT("HPOUT2 DRE Switch", ARIZONA_DRE_ENABLE,
845 ARIZONA_DRE2L_ENA_SHIFT, ARIZONA_DRE2R_ENA_SHIFT, 1, 0,
846 snd_soc_get_volsw, wm5110_put_dre),
847SOC_DOUBLE_EXT("HPOUT3 DRE Switch", ARIZONA_DRE_ENABLE,
848 ARIZONA_DRE3L_ENA_SHIFT, ARIZONA_DRE3R_ENA_SHIFT, 1, 0,
849 snd_soc_get_volsw, wm5110_put_dre),
Charles Keepaxa4c0d272013-12-19 09:11:02 +0000850
Mark Browna1abfa82012-12-09 12:50:05 +0900851SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp),
852SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp),
853
Mark Brownbd7fe242012-12-18 13:53:26 +0000854SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL,
855 ARIZONA_NGATE_ENA_SHIFT, 1, 0),
856SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL,
857 ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv),
858SOC_ENUM("Noise Gate Hold", arizona_ng_hold),
859
860WM5110_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L),
861WM5110_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R),
862WM5110_NG_SRC("HPOUT2L", ARIZONA_NOISE_GATE_SELECT_2L),
863WM5110_NG_SRC("HPOUT2R", ARIZONA_NOISE_GATE_SELECT_2R),
864WM5110_NG_SRC("HPOUT3L", ARIZONA_NOISE_GATE_SELECT_3L),
865WM5110_NG_SRC("HPOUT3R", ARIZONA_NOISE_GATE_SELECT_3R),
866WM5110_NG_SRC("SPKOUTL", ARIZONA_NOISE_GATE_SELECT_4L),
867WM5110_NG_SRC("SPKOUTR", ARIZONA_NOISE_GATE_SELECT_4R),
868WM5110_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L),
869WM5110_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R),
870WM5110_NG_SRC("SPKDAT2L", ARIZONA_NOISE_GATE_SELECT_6L),
871WM5110_NG_SRC("SPKDAT2R", ARIZONA_NOISE_GATE_SELECT_6R),
872
Mark Brown5c6af632012-07-09 19:09:41 +0100873ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE),
874ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE),
875ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE),
876ARIZONA_MIXER_CONTROLS("AIF1TX4", ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE),
877ARIZONA_MIXER_CONTROLS("AIF1TX5", ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE),
878ARIZONA_MIXER_CONTROLS("AIF1TX6", ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE),
879ARIZONA_MIXER_CONTROLS("AIF1TX7", ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE),
880ARIZONA_MIXER_CONTROLS("AIF1TX8", ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE),
881
882ARIZONA_MIXER_CONTROLS("AIF2TX1", ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE),
883ARIZONA_MIXER_CONTROLS("AIF2TX2", ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +0000884ARIZONA_MIXER_CONTROLS("AIF2TX3", ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE),
885ARIZONA_MIXER_CONTROLS("AIF2TX4", ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE),
886ARIZONA_MIXER_CONTROLS("AIF2TX5", ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE),
887ARIZONA_MIXER_CONTROLS("AIF2TX6", ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE),
Mark Brown5c6af632012-07-09 19:09:41 +0100888
889ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE),
890ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE),
Mark Brownd217f902013-05-17 13:29:05 +0100891
892ARIZONA_MIXER_CONTROLS("SLIMTX1", ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE),
893ARIZONA_MIXER_CONTROLS("SLIMTX2", ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE),
894ARIZONA_MIXER_CONTROLS("SLIMTX3", ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE),
895ARIZONA_MIXER_CONTROLS("SLIMTX4", ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE),
896ARIZONA_MIXER_CONTROLS("SLIMTX5", ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE),
897ARIZONA_MIXER_CONTROLS("SLIMTX6", ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE),
898ARIZONA_MIXER_CONTROLS("SLIMTX7", ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE),
899ARIZONA_MIXER_CONTROLS("SLIMTX8", ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE),
Mark Brown5c6af632012-07-09 19:09:41 +0100900};
901
902ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE);
903ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE);
904ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE);
905ARIZONA_MIXER_ENUMS(EQ4, ARIZONA_EQ4MIX_INPUT_1_SOURCE);
906
907ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE);
908ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE);
909ARIZONA_MIXER_ENUMS(DRC2L, ARIZONA_DRC2LMIX_INPUT_1_SOURCE);
910ARIZONA_MIXER_ENUMS(DRC2R, ARIZONA_DRC2RMIX_INPUT_1_SOURCE);
911
912ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE);
913ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE);
914ARIZONA_MIXER_ENUMS(LHPF3, ARIZONA_HPLP3MIX_INPUT_1_SOURCE);
915ARIZONA_MIXER_ENUMS(LHPF4, ARIZONA_HPLP4MIX_INPUT_1_SOURCE);
916
Mark Brown9a3e1b82013-11-19 16:04:01 +0000917ARIZONA_MIXER_ENUMS(DSP1L, ARIZONA_DSP1LMIX_INPUT_1_SOURCE);
918ARIZONA_MIXER_ENUMS(DSP1R, ARIZONA_DSP1RMIX_INPUT_1_SOURCE);
919ARIZONA_DSP_AUX_ENUMS(DSP1, ARIZONA_DSP1AUX1MIX_INPUT_1_SOURCE);
920
921ARIZONA_MIXER_ENUMS(DSP2L, ARIZONA_DSP2LMIX_INPUT_1_SOURCE);
922ARIZONA_MIXER_ENUMS(DSP2R, ARIZONA_DSP2RMIX_INPUT_1_SOURCE);
923ARIZONA_DSP_AUX_ENUMS(DSP2, ARIZONA_DSP2AUX1MIX_INPUT_1_SOURCE);
924
925ARIZONA_MIXER_ENUMS(DSP3L, ARIZONA_DSP3LMIX_INPUT_1_SOURCE);
926ARIZONA_MIXER_ENUMS(DSP3R, ARIZONA_DSP3RMIX_INPUT_1_SOURCE);
927ARIZONA_DSP_AUX_ENUMS(DSP3, ARIZONA_DSP3AUX1MIX_INPUT_1_SOURCE);
928
929ARIZONA_MIXER_ENUMS(DSP4L, ARIZONA_DSP4LMIX_INPUT_1_SOURCE);
930ARIZONA_MIXER_ENUMS(DSP4R, ARIZONA_DSP4RMIX_INPUT_1_SOURCE);
931ARIZONA_DSP_AUX_ENUMS(DSP4, ARIZONA_DSP4AUX1MIX_INPUT_1_SOURCE);
932
Mark Brown5c6af632012-07-09 19:09:41 +0100933ARIZONA_MIXER_ENUMS(Mic, ARIZONA_MICMIX_INPUT_1_SOURCE);
934ARIZONA_MIXER_ENUMS(Noise, ARIZONA_NOISEMIX_INPUT_1_SOURCE);
935
936ARIZONA_MIXER_ENUMS(PWM1, ARIZONA_PWM1MIX_INPUT_1_SOURCE);
937ARIZONA_MIXER_ENUMS(PWM2, ARIZONA_PWM2MIX_INPUT_1_SOURCE);
938
939ARIZONA_MIXER_ENUMS(OUT1L, ARIZONA_OUT1LMIX_INPUT_1_SOURCE);
940ARIZONA_MIXER_ENUMS(OUT1R, ARIZONA_OUT1RMIX_INPUT_1_SOURCE);
941ARIZONA_MIXER_ENUMS(OUT2L, ARIZONA_OUT2LMIX_INPUT_1_SOURCE);
942ARIZONA_MIXER_ENUMS(OUT2R, ARIZONA_OUT2RMIX_INPUT_1_SOURCE);
Mark Brown35d38892012-08-26 13:50:48 -0700943ARIZONA_MIXER_ENUMS(OUT3L, ARIZONA_OUT3LMIX_INPUT_1_SOURCE);
944ARIZONA_MIXER_ENUMS(OUT3R, ARIZONA_OUT3RMIX_INPUT_1_SOURCE);
Mark Brown5c6af632012-07-09 19:09:41 +0100945ARIZONA_MIXER_ENUMS(SPKOUTL, ARIZONA_OUT4LMIX_INPUT_1_SOURCE);
946ARIZONA_MIXER_ENUMS(SPKOUTR, ARIZONA_OUT4RMIX_INPUT_1_SOURCE);
947ARIZONA_MIXER_ENUMS(SPKDAT1L, ARIZONA_OUT5LMIX_INPUT_1_SOURCE);
948ARIZONA_MIXER_ENUMS(SPKDAT1R, ARIZONA_OUT5RMIX_INPUT_1_SOURCE);
949ARIZONA_MIXER_ENUMS(SPKDAT2L, ARIZONA_OUT6LMIX_INPUT_1_SOURCE);
950ARIZONA_MIXER_ENUMS(SPKDAT2R, ARIZONA_OUT6RMIX_INPUT_1_SOURCE);
951
952ARIZONA_MIXER_ENUMS(AIF1TX1, ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE);
953ARIZONA_MIXER_ENUMS(AIF1TX2, ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE);
954ARIZONA_MIXER_ENUMS(AIF1TX3, ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE);
955ARIZONA_MIXER_ENUMS(AIF1TX4, ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE);
956ARIZONA_MIXER_ENUMS(AIF1TX5, ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE);
957ARIZONA_MIXER_ENUMS(AIF1TX6, ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE);
958ARIZONA_MIXER_ENUMS(AIF1TX7, ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE);
959ARIZONA_MIXER_ENUMS(AIF1TX8, ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE);
960
961ARIZONA_MIXER_ENUMS(AIF2TX1, ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE);
962ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE);
Richard Fitzgeralde64001e2013-11-20 13:17:07 +0000963ARIZONA_MIXER_ENUMS(AIF2TX3, ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE);
964ARIZONA_MIXER_ENUMS(AIF2TX4, ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE);
965ARIZONA_MIXER_ENUMS(AIF2TX5, ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE);
966ARIZONA_MIXER_ENUMS(AIF2TX6, ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE);
Mark Brown5c6af632012-07-09 19:09:41 +0100967
968ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE);
969ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE);
970
Mark Brownd217f902013-05-17 13:29:05 +0100971ARIZONA_MIXER_ENUMS(SLIMTX1, ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE);
972ARIZONA_MIXER_ENUMS(SLIMTX2, ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE);
973ARIZONA_MIXER_ENUMS(SLIMTX3, ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE);
974ARIZONA_MIXER_ENUMS(SLIMTX4, ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE);
975ARIZONA_MIXER_ENUMS(SLIMTX5, ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE);
976ARIZONA_MIXER_ENUMS(SLIMTX6, ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE);
977ARIZONA_MIXER_ENUMS(SLIMTX7, ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE);
978ARIZONA_MIXER_ENUMS(SLIMTX8, ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE);
979
Charles Keepax5886c742012-11-13 16:40:34 +0000980ARIZONA_MUX_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE);
981ARIZONA_MUX_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE);
982ARIZONA_MUX_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE);
983ARIZONA_MUX_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE);
Mark Brown5c6af632012-07-09 19:09:41 +0100984
Charles Keepax0da2e5b2013-11-19 16:04:02 +0000985ARIZONA_MUX_ENUMS(ISRC1INT1, ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE);
986ARIZONA_MUX_ENUMS(ISRC1INT2, ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE);
987ARIZONA_MUX_ENUMS(ISRC1INT3, ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE);
988ARIZONA_MUX_ENUMS(ISRC1INT4, ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE);
989
990ARIZONA_MUX_ENUMS(ISRC1DEC1, ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE);
991ARIZONA_MUX_ENUMS(ISRC1DEC2, ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE);
992ARIZONA_MUX_ENUMS(ISRC1DEC3, ARIZONA_ISRC1DEC3MIX_INPUT_1_SOURCE);
993ARIZONA_MUX_ENUMS(ISRC1DEC4, ARIZONA_ISRC1DEC4MIX_INPUT_1_SOURCE);
994
995ARIZONA_MUX_ENUMS(ISRC2INT1, ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE);
996ARIZONA_MUX_ENUMS(ISRC2INT2, ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE);
997ARIZONA_MUX_ENUMS(ISRC2INT3, ARIZONA_ISRC2INT3MIX_INPUT_1_SOURCE);
998ARIZONA_MUX_ENUMS(ISRC2INT4, ARIZONA_ISRC2INT4MIX_INPUT_1_SOURCE);
999
1000ARIZONA_MUX_ENUMS(ISRC2DEC1, ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE);
1001ARIZONA_MUX_ENUMS(ISRC2DEC2, ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE);
1002ARIZONA_MUX_ENUMS(ISRC2DEC3, ARIZONA_ISRC2DEC3MIX_INPUT_1_SOURCE);
1003ARIZONA_MUX_ENUMS(ISRC2DEC4, ARIZONA_ISRC2DEC4MIX_INPUT_1_SOURCE);
1004
1005ARIZONA_MUX_ENUMS(ISRC3INT1, ARIZONA_ISRC3INT1MIX_INPUT_1_SOURCE);
1006ARIZONA_MUX_ENUMS(ISRC3INT2, ARIZONA_ISRC3INT2MIX_INPUT_1_SOURCE);
1007ARIZONA_MUX_ENUMS(ISRC3INT3, ARIZONA_ISRC3INT3MIX_INPUT_1_SOURCE);
1008ARIZONA_MUX_ENUMS(ISRC3INT4, ARIZONA_ISRC3INT4MIX_INPUT_1_SOURCE);
1009
1010ARIZONA_MUX_ENUMS(ISRC3DEC1, ARIZONA_ISRC3DEC1MIX_INPUT_1_SOURCE);
1011ARIZONA_MUX_ENUMS(ISRC3DEC2, ARIZONA_ISRC3DEC2MIX_INPUT_1_SOURCE);
1012ARIZONA_MUX_ENUMS(ISRC3DEC3, ARIZONA_ISRC3DEC3MIX_INPUT_1_SOURCE);
1013ARIZONA_MUX_ENUMS(ISRC3DEC4, ARIZONA_ISRC3DEC4MIX_INPUT_1_SOURCE);
1014
Mark Browndac8f1c2012-08-26 13:51:27 -07001015static const char *wm5110_aec_loopback_texts[] = {
1016 "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R",
1017 "SPKOUTL", "SPKOUTR", "SPKDAT1L", "SPKDAT1R", "SPKDAT2L", "SPKDAT2R",
1018};
1019
1020static const unsigned int wm5110_aec_loopback_values[] = {
1021 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1022};
1023
1024static const struct soc_enum wm5110_aec_loopback =
1025 SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1,
Mark Brown7d5cb4f2013-01-11 13:32:00 +00001026 ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf,
Mark Browndac8f1c2012-08-26 13:51:27 -07001027 ARRAY_SIZE(wm5110_aec_loopback_texts),
1028 wm5110_aec_loopback_texts,
1029 wm5110_aec_loopback_values);
1030
1031static const struct snd_kcontrol_new wm5110_aec_loopback_mux =
Lars-Peter Clausen696d3af2014-04-14 21:31:06 +02001032 SOC_DAPM_ENUM("AEC Loopback", wm5110_aec_loopback);
Mark Browndac8f1c2012-08-26 13:51:27 -07001033
Charles Keepaxd1901062015-11-19 16:11:10 +00001034static const struct snd_kcontrol_new wm5110_anc_input_mux[] = {
1035 SOC_DAPM_ENUM("RXANCL Input", arizona_anc_input_src[0]),
1036 SOC_DAPM_ENUM("RXANCL Channel", arizona_anc_input_src[1]),
1037 SOC_DAPM_ENUM("RXANCR Input", arizona_anc_input_src[2]),
1038 SOC_DAPM_ENUM("RXANCR Channel", arizona_anc_input_src[3]),
1039};
1040
1041static const struct snd_kcontrol_new wm5110_anc_ng_mux =
1042 SOC_DAPM_ENUM("RXANC NG Source", arizona_anc_ng_enum);
1043
1044static const struct snd_kcontrol_new wm5110_output_anc_src[] = {
1045 SOC_DAPM_ENUM("HPOUT1L ANC Source", arizona_output_anc_src[0]),
1046 SOC_DAPM_ENUM("HPOUT1R ANC Source", arizona_output_anc_src[1]),
1047 SOC_DAPM_ENUM("HPOUT2L ANC Source", arizona_output_anc_src[2]),
1048 SOC_DAPM_ENUM("HPOUT2R ANC Source", arizona_output_anc_src[3]),
1049 SOC_DAPM_ENUM("HPOUT3L ANC Source", arizona_output_anc_src[4]),
1050 SOC_DAPM_ENUM("HPOUT3R ANC Source", arizona_output_anc_src[5]),
1051 SOC_DAPM_ENUM("SPKOUTL ANC Source", arizona_output_anc_src[6]),
1052 SOC_DAPM_ENUM("SPKOUTR ANC Source", arizona_output_anc_src[7]),
1053 SOC_DAPM_ENUM("SPKDAT1L ANC Source", arizona_output_anc_src[8]),
1054 SOC_DAPM_ENUM("SPKDAT1R ANC Source", arizona_output_anc_src[9]),
1055 SOC_DAPM_ENUM("SPKDAT2L ANC Source", arizona_output_anc_src[10]),
1056 SOC_DAPM_ENUM("SPKDAT2R ANC Source", arizona_output_anc_src[11]),
1057};
1058
Mark Brown5c6af632012-07-09 19:09:41 +01001059static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = {
1060SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT,
Charles Keepaxf69f86b2013-11-19 10:51:29 +00001061 0, wm5110_sysclk_ev, SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001062SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1,
1063 ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
Mark Brown94237f82012-08-09 19:14:43 +01001064SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK,
1065 ARIZONA_OPCLK_ENA_SHIFT, 0, NULL, 0),
1066SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", ARIZONA_OUTPUT_ASYNC_CLOCK,
1067 ARIZONA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0),
Mark Brown5c6af632012-07-09 19:09:41 +01001068
Mark Brown822b4b82012-09-07 10:54:32 +08001069SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0),
1070SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD3", 0, 0),
1071SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD", 20, 0),
Mark Brown76dbd2a2012-09-07 12:58:54 +08001072SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS),
Mark Brown822b4b82012-09-07 10:54:32 +08001073SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDL", 0, 0),
1074SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0),
Mark Brown5c6af632012-07-09 19:09:41 +01001075
1076SND_SOC_DAPM_SIGGEN("TONE"),
1077SND_SOC_DAPM_SIGGEN("NOISE"),
Mark Brown2f76e682012-11-26 21:18:18 +00001078SND_SOC_DAPM_SIGGEN("HAPTICS"),
Mark Brown5c6af632012-07-09 19:09:41 +01001079
1080SND_SOC_DAPM_INPUT("IN1L"),
1081SND_SOC_DAPM_INPUT("IN1R"),
1082SND_SOC_DAPM_INPUT("IN2L"),
1083SND_SOC_DAPM_INPUT("IN2R"),
1084SND_SOC_DAPM_INPUT("IN3L"),
1085SND_SOC_DAPM_INPUT("IN3R"),
1086SND_SOC_DAPM_INPUT("IN4L"),
1087SND_SOC_DAPM_INPUT("IN4R"),
1088
Charles Keepaxb63144e2013-07-04 08:56:28 +01001089SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"),
1090SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"),
1091
Mark Brown5c6af632012-07-09 19:09:41 +01001092SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT,
Charles Keepaxccaadda2015-09-17 10:45:24 +01001093 0, NULL, 0, wm5110_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001094 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxccaadda2015-09-17 10:45:24 +01001095 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1096 SND_SOC_DAPM_WILL_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001097SND_SOC_DAPM_PGA_E("IN1R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1R_ENA_SHIFT,
Charles Keepaxccaadda2015-09-17 10:45:24 +01001098 0, NULL, 0, wm5110_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001099 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxccaadda2015-09-17 10:45:24 +01001100 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1101 SND_SOC_DAPM_WILL_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001102SND_SOC_DAPM_PGA_E("IN2L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2L_ENA_SHIFT,
Charles Keepaxccaadda2015-09-17 10:45:24 +01001103 0, NULL, 0, wm5110_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001104 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxccaadda2015-09-17 10:45:24 +01001105 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1106 SND_SOC_DAPM_WILL_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001107SND_SOC_DAPM_PGA_E("IN2R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2R_ENA_SHIFT,
Charles Keepaxccaadda2015-09-17 10:45:24 +01001108 0, NULL, 0, wm5110_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001109 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxccaadda2015-09-17 10:45:24 +01001110 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1111 SND_SOC_DAPM_WILL_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001112SND_SOC_DAPM_PGA_E("IN3L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3L_ENA_SHIFT,
Charles Keepaxccaadda2015-09-17 10:45:24 +01001113 0, NULL, 0, wm5110_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001114 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxccaadda2015-09-17 10:45:24 +01001115 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1116 SND_SOC_DAPM_WILL_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001117SND_SOC_DAPM_PGA_E("IN3R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3R_ENA_SHIFT,
Charles Keepaxccaadda2015-09-17 10:45:24 +01001118 0, NULL, 0, wm5110_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001119 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxccaadda2015-09-17 10:45:24 +01001120 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1121 SND_SOC_DAPM_WILL_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001122SND_SOC_DAPM_PGA_E("IN4L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4L_ENA_SHIFT,
1123 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001124 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1125 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001126SND_SOC_DAPM_PGA_E("IN4R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4R_ENA_SHIFT,
1127 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +00001128 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1129 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001130
1131SND_SOC_DAPM_SUPPLY("MICBIAS1", ARIZONA_MIC_BIAS_CTRL_1,
1132 ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
1133SND_SOC_DAPM_SUPPLY("MICBIAS2", ARIZONA_MIC_BIAS_CTRL_2,
1134 ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
1135SND_SOC_DAPM_SUPPLY("MICBIAS3", ARIZONA_MIC_BIAS_CTRL_3,
1136 ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
1137
1138SND_SOC_DAPM_PGA("Noise Generator", ARIZONA_COMFORT_NOISE_GENERATOR,
1139 ARIZONA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0),
1140
1141SND_SOC_DAPM_PGA("Tone Generator 1", ARIZONA_TONE_GENERATOR_1,
1142 ARIZONA_TONE1_ENA_SHIFT, 0, NULL, 0),
1143SND_SOC_DAPM_PGA("Tone Generator 2", ARIZONA_TONE_GENERATOR_1,
1144 ARIZONA_TONE2_ENA_SHIFT, 0, NULL, 0),
1145
1146SND_SOC_DAPM_PGA("Mic Mute Mixer", ARIZONA_MIC_NOISE_MIX_CONTROL_1,
1147 ARIZONA_MICMUTE_MIX_ENA_SHIFT, 0, NULL, 0),
1148
1149SND_SOC_DAPM_PGA("EQ1", ARIZONA_EQ1_1, ARIZONA_EQ1_ENA_SHIFT, 0, NULL, 0),
1150SND_SOC_DAPM_PGA("EQ2", ARIZONA_EQ2_1, ARIZONA_EQ2_ENA_SHIFT, 0, NULL, 0),
1151SND_SOC_DAPM_PGA("EQ3", ARIZONA_EQ3_1, ARIZONA_EQ3_ENA_SHIFT, 0, NULL, 0),
1152SND_SOC_DAPM_PGA("EQ4", ARIZONA_EQ4_1, ARIZONA_EQ4_ENA_SHIFT, 0, NULL, 0),
1153
1154SND_SOC_DAPM_PGA("DRC1L", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1L_ENA_SHIFT, 0,
1155 NULL, 0),
1156SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0,
1157 NULL, 0),
1158SND_SOC_DAPM_PGA("DRC2L", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2L_ENA_SHIFT, 0,
1159 NULL, 0),
1160SND_SOC_DAPM_PGA("DRC2R", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2R_ENA_SHIFT, 0,
1161 NULL, 0),
1162
1163SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0,
1164 NULL, 0),
1165SND_SOC_DAPM_PGA("LHPF2", ARIZONA_HPLPF2_1, ARIZONA_LHPF2_ENA_SHIFT, 0,
1166 NULL, 0),
1167SND_SOC_DAPM_PGA("LHPF3", ARIZONA_HPLPF3_1, ARIZONA_LHPF3_ENA_SHIFT, 0,
1168 NULL, 0),
1169SND_SOC_DAPM_PGA("LHPF4", ARIZONA_HPLPF4_1, ARIZONA_LHPF4_ENA_SHIFT, 0,
1170 NULL, 0),
1171
1172SND_SOC_DAPM_PGA("PWM1 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM1_ENA_SHIFT,
1173 0, NULL, 0),
1174SND_SOC_DAPM_PGA("PWM2 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM2_ENA_SHIFT,
1175 0, NULL, 0),
1176
1177SND_SOC_DAPM_PGA("ASRC1L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1L_ENA_SHIFT, 0,
1178 NULL, 0),
1179SND_SOC_DAPM_PGA("ASRC1R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1R_ENA_SHIFT, 0,
1180 NULL, 0),
1181SND_SOC_DAPM_PGA("ASRC2L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2L_ENA_SHIFT, 0,
1182 NULL, 0),
1183SND_SOC_DAPM_PGA("ASRC2R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2R_ENA_SHIFT, 0,
1184 NULL, 0),
1185
Mark Brown9a3e1b82013-11-19 16:04:01 +00001186WM_ADSP2("DSP1", 0),
1187WM_ADSP2("DSP2", 1),
1188WM_ADSP2("DSP3", 2),
1189WM_ADSP2("DSP4", 3),
1190
Charles Keepax0da2e5b2013-11-19 16:04:02 +00001191SND_SOC_DAPM_PGA("ISRC1INT1", ARIZONA_ISRC_1_CTRL_3,
1192 ARIZONA_ISRC1_INT0_ENA_SHIFT, 0, NULL, 0),
1193SND_SOC_DAPM_PGA("ISRC1INT2", ARIZONA_ISRC_1_CTRL_3,
1194 ARIZONA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0),
1195SND_SOC_DAPM_PGA("ISRC1INT3", ARIZONA_ISRC_1_CTRL_3,
1196 ARIZONA_ISRC1_INT2_ENA_SHIFT, 0, NULL, 0),
1197SND_SOC_DAPM_PGA("ISRC1INT4", ARIZONA_ISRC_1_CTRL_3,
1198 ARIZONA_ISRC1_INT3_ENA_SHIFT, 0, NULL, 0),
1199
1200SND_SOC_DAPM_PGA("ISRC1DEC1", ARIZONA_ISRC_1_CTRL_3,
1201 ARIZONA_ISRC1_DEC0_ENA_SHIFT, 0, NULL, 0),
1202SND_SOC_DAPM_PGA("ISRC1DEC2", ARIZONA_ISRC_1_CTRL_3,
1203 ARIZONA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0),
1204SND_SOC_DAPM_PGA("ISRC1DEC3", ARIZONA_ISRC_1_CTRL_3,
1205 ARIZONA_ISRC1_DEC2_ENA_SHIFT, 0, NULL, 0),
1206SND_SOC_DAPM_PGA("ISRC1DEC4", ARIZONA_ISRC_1_CTRL_3,
1207 ARIZONA_ISRC1_DEC3_ENA_SHIFT, 0, NULL, 0),
1208
1209SND_SOC_DAPM_PGA("ISRC2INT1", ARIZONA_ISRC_2_CTRL_3,
1210 ARIZONA_ISRC2_INT0_ENA_SHIFT, 0, NULL, 0),
1211SND_SOC_DAPM_PGA("ISRC2INT2", ARIZONA_ISRC_2_CTRL_3,
1212 ARIZONA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0),
1213SND_SOC_DAPM_PGA("ISRC2INT3", ARIZONA_ISRC_2_CTRL_3,
1214 ARIZONA_ISRC2_INT2_ENA_SHIFT, 0, NULL, 0),
1215SND_SOC_DAPM_PGA("ISRC2INT4", ARIZONA_ISRC_2_CTRL_3,
1216 ARIZONA_ISRC2_INT3_ENA_SHIFT, 0, NULL, 0),
1217
1218SND_SOC_DAPM_PGA("ISRC2DEC1", ARIZONA_ISRC_2_CTRL_3,
1219 ARIZONA_ISRC2_DEC0_ENA_SHIFT, 0, NULL, 0),
1220SND_SOC_DAPM_PGA("ISRC2DEC2", ARIZONA_ISRC_2_CTRL_3,
1221 ARIZONA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0),
1222SND_SOC_DAPM_PGA("ISRC2DEC3", ARIZONA_ISRC_2_CTRL_3,
1223 ARIZONA_ISRC2_DEC2_ENA_SHIFT, 0, NULL, 0),
1224SND_SOC_DAPM_PGA("ISRC2DEC4", ARIZONA_ISRC_2_CTRL_3,
1225 ARIZONA_ISRC2_DEC3_ENA_SHIFT, 0, NULL, 0),
1226
1227SND_SOC_DAPM_PGA("ISRC3INT1", ARIZONA_ISRC_3_CTRL_3,
1228 ARIZONA_ISRC3_INT0_ENA_SHIFT, 0, NULL, 0),
1229SND_SOC_DAPM_PGA("ISRC3INT2", ARIZONA_ISRC_3_CTRL_3,
1230 ARIZONA_ISRC3_INT1_ENA_SHIFT, 0, NULL, 0),
1231SND_SOC_DAPM_PGA("ISRC3INT3", ARIZONA_ISRC_3_CTRL_3,
1232 ARIZONA_ISRC3_INT2_ENA_SHIFT, 0, NULL, 0),
1233SND_SOC_DAPM_PGA("ISRC3INT4", ARIZONA_ISRC_3_CTRL_3,
1234 ARIZONA_ISRC3_INT3_ENA_SHIFT, 0, NULL, 0),
1235
1236SND_SOC_DAPM_PGA("ISRC3DEC1", ARIZONA_ISRC_3_CTRL_3,
1237 ARIZONA_ISRC3_DEC0_ENA_SHIFT, 0, NULL, 0),
1238SND_SOC_DAPM_PGA("ISRC3DEC2", ARIZONA_ISRC_3_CTRL_3,
1239 ARIZONA_ISRC3_DEC1_ENA_SHIFT, 0, NULL, 0),
1240SND_SOC_DAPM_PGA("ISRC3DEC3", ARIZONA_ISRC_3_CTRL_3,
1241 ARIZONA_ISRC3_DEC2_ENA_SHIFT, 0, NULL, 0),
1242SND_SOC_DAPM_PGA("ISRC3DEC4", ARIZONA_ISRC_3_CTRL_3,
1243 ARIZONA_ISRC3_DEC3_ENA_SHIFT, 0, NULL, 0),
1244
Lars-Peter Clausen696d3af2014-04-14 21:31:06 +02001245SND_SOC_DAPM_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1,
Charles Keepaxee4b7c72013-06-05 14:51:30 +01001246 ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0,
1247 &wm5110_aec_loopback_mux),
Mark Browndac8f1c2012-08-26 13:51:27 -07001248
Charles Keepaxd1901062015-11-19 16:11:10 +00001249SND_SOC_DAPM_SUPPLY("RXANC NG External Clock", SND_SOC_NOPM,
1250 ARIZONA_EXT_NG_SEL_SET_SHIFT, 0, arizona_anc_ev,
1251 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1252SND_SOC_DAPM_PGA("RXANCL NG External", SND_SOC_NOPM, 0, 0, NULL, 0),
1253SND_SOC_DAPM_PGA("RXANCR NG External", SND_SOC_NOPM, 0, 0, NULL, 0),
1254
1255SND_SOC_DAPM_SUPPLY("RXANC NG Clock", SND_SOC_NOPM,
1256 ARIZONA_CLK_NG_ENA_SET_SHIFT, 0, arizona_anc_ev,
1257 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1258SND_SOC_DAPM_PGA("RXANCL NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0),
1259SND_SOC_DAPM_PGA("RXANCR NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0),
1260
1261SND_SOC_DAPM_MUX("RXANCL Left Input", SND_SOC_NOPM, 0, 0,
1262 &wm5110_anc_input_mux[0]),
1263SND_SOC_DAPM_MUX("RXANCL Right Input", SND_SOC_NOPM, 0, 0,
1264 &wm5110_anc_input_mux[0]),
1265SND_SOC_DAPM_MUX("RXANCL Channel", SND_SOC_NOPM, 0, 0,
1266 &wm5110_anc_input_mux[1]),
1267SND_SOC_DAPM_MUX("RXANCL NG Mux", SND_SOC_NOPM, 0, 0, &wm5110_anc_ng_mux),
1268SND_SOC_DAPM_MUX("RXANCR Left Input", SND_SOC_NOPM, 0, 0,
1269 &wm5110_anc_input_mux[2]),
1270SND_SOC_DAPM_MUX("RXANCR Right Input", SND_SOC_NOPM, 0, 0,
1271 &wm5110_anc_input_mux[2]),
1272SND_SOC_DAPM_MUX("RXANCR Channel", SND_SOC_NOPM, 0, 0,
1273 &wm5110_anc_input_mux[3]),
1274SND_SOC_DAPM_MUX("RXANCR NG Mux", SND_SOC_NOPM, 0, 0, &wm5110_anc_ng_mux),
1275
1276SND_SOC_DAPM_PGA_E("RXANCL", SND_SOC_NOPM, ARIZONA_CLK_L_ENA_SET_SHIFT,
1277 0, NULL, 0, arizona_anc_ev,
1278 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1279SND_SOC_DAPM_PGA_E("RXANCR", SND_SOC_NOPM, ARIZONA_CLK_R_ENA_SET_SHIFT,
1280 0, NULL, 0, arizona_anc_ev,
1281 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1282
1283SND_SOC_DAPM_MUX("HPOUT1L ANC Source", SND_SOC_NOPM, 0, 0,
1284 &wm5110_output_anc_src[0]),
1285SND_SOC_DAPM_MUX("HPOUT1R ANC Source", SND_SOC_NOPM, 0, 0,
1286 &wm5110_output_anc_src[1]),
1287SND_SOC_DAPM_MUX("HPOUT2L ANC Source", SND_SOC_NOPM, 0, 0,
1288 &wm5110_output_anc_src[2]),
1289SND_SOC_DAPM_MUX("HPOUT2R ANC Source", SND_SOC_NOPM, 0, 0,
1290 &wm5110_output_anc_src[3]),
1291SND_SOC_DAPM_MUX("HPOUT3L ANC Source", SND_SOC_NOPM, 0, 0,
1292 &wm5110_output_anc_src[4]),
1293SND_SOC_DAPM_MUX("HPOUT3R ANC Source", SND_SOC_NOPM, 0, 0,
1294 &wm5110_output_anc_src[5]),
1295SND_SOC_DAPM_MUX("SPKOUTL ANC Source", SND_SOC_NOPM, 0, 0,
1296 &wm5110_output_anc_src[6]),
1297SND_SOC_DAPM_MUX("SPKOUTR ANC Source", SND_SOC_NOPM, 0, 0,
1298 &wm5110_output_anc_src[7]),
1299SND_SOC_DAPM_MUX("SPKDAT1L ANC Source", SND_SOC_NOPM, 0, 0,
1300 &wm5110_output_anc_src[8]),
1301SND_SOC_DAPM_MUX("SPKDAT1R ANC Source", SND_SOC_NOPM, 0, 0,
1302 &wm5110_output_anc_src[9]),
1303SND_SOC_DAPM_MUX("SPKDAT2L ANC Source", SND_SOC_NOPM, 0, 0,
1304 &wm5110_output_anc_src[10]),
1305SND_SOC_DAPM_MUX("SPKDAT2R ANC Source", SND_SOC_NOPM, 0, 0,
1306 &wm5110_output_anc_src[11]),
1307
Mark Brown5c6af632012-07-09 19:09:41 +01001308SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0,
1309 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0),
1310SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0,
1311 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX2_ENA_SHIFT, 0),
1312SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0,
1313 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX3_ENA_SHIFT, 0),
1314SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0,
1315 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX4_ENA_SHIFT, 0),
1316SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0,
1317 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX5_ENA_SHIFT, 0),
1318SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0,
1319 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX6_ENA_SHIFT, 0),
1320SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0,
1321 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX7_ENA_SHIFT, 0),
1322SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0,
1323 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX8_ENA_SHIFT, 0),
1324
1325SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0,
1326 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX1_ENA_SHIFT, 0),
1327SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0,
1328 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX2_ENA_SHIFT, 0),
1329SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0,
1330 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX3_ENA_SHIFT, 0),
1331SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0,
1332 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX4_ENA_SHIFT, 0),
1333SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0,
1334 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX5_ENA_SHIFT, 0),
1335SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0,
1336 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX6_ENA_SHIFT, 0),
1337SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0,
1338 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX7_ENA_SHIFT, 0),
1339SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0,
1340 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX8_ENA_SHIFT, 0),
1341
1342SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0,
1343 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX1_ENA_SHIFT, 0),
1344SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0,
1345 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX2_ENA_SHIFT, 0),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001346SND_SOC_DAPM_AIF_OUT("AIF2TX3", NULL, 0,
1347 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX3_ENA_SHIFT, 0),
1348SND_SOC_DAPM_AIF_OUT("AIF2TX4", NULL, 0,
1349 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX4_ENA_SHIFT, 0),
1350SND_SOC_DAPM_AIF_OUT("AIF2TX5", NULL, 0,
1351 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX5_ENA_SHIFT, 0),
1352SND_SOC_DAPM_AIF_OUT("AIF2TX6", NULL, 0,
1353 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX6_ENA_SHIFT, 0),
Mark Brown5c6af632012-07-09 19:09:41 +01001354
1355SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0,
1356 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX1_ENA_SHIFT, 0),
1357SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0,
1358 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX2_ENA_SHIFT, 0),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001359SND_SOC_DAPM_AIF_IN("AIF2RX3", NULL, 0,
1360 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX3_ENA_SHIFT, 0),
1361SND_SOC_DAPM_AIF_IN("AIF2RX4", NULL, 0,
1362 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX4_ENA_SHIFT, 0),
1363SND_SOC_DAPM_AIF_IN("AIF2RX5", NULL, 0,
1364 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX5_ENA_SHIFT, 0),
1365SND_SOC_DAPM_AIF_IN("AIF2RX6", NULL, 0,
1366 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX6_ENA_SHIFT, 0),
Mark Brown5c6af632012-07-09 19:09:41 +01001367
Mark Brownd217f902013-05-17 13:29:05 +01001368SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0,
1369 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1370 ARIZONA_SLIMRX1_ENA_SHIFT, 0),
1371SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0,
1372 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1373 ARIZONA_SLIMRX2_ENA_SHIFT, 0),
1374SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0,
1375 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1376 ARIZONA_SLIMRX3_ENA_SHIFT, 0),
1377SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0,
1378 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1379 ARIZONA_SLIMRX4_ENA_SHIFT, 0),
1380SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0,
1381 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1382 ARIZONA_SLIMRX5_ENA_SHIFT, 0),
1383SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0,
1384 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1385 ARIZONA_SLIMRX6_ENA_SHIFT, 0),
1386SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0,
1387 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1388 ARIZONA_SLIMRX7_ENA_SHIFT, 0),
1389SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0,
1390 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1391 ARIZONA_SLIMRX8_ENA_SHIFT, 0),
1392
1393SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0,
1394 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1395 ARIZONA_SLIMTX1_ENA_SHIFT, 0),
1396SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0,
1397 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1398 ARIZONA_SLIMTX2_ENA_SHIFT, 0),
1399SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0,
1400 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1401 ARIZONA_SLIMTX3_ENA_SHIFT, 0),
1402SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0,
1403 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1404 ARIZONA_SLIMTX4_ENA_SHIFT, 0),
1405SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0,
1406 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1407 ARIZONA_SLIMTX5_ENA_SHIFT, 0),
1408SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0,
1409 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1410 ARIZONA_SLIMTX6_ENA_SHIFT, 0),
1411SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0,
1412 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1413 ARIZONA_SLIMTX7_ENA_SHIFT, 0),
1414SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0,
1415 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1416 ARIZONA_SLIMTX8_ENA_SHIFT, 0),
1417
Mark Brown5c6af632012-07-09 19:09:41 +01001418SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0,
1419 ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX1_ENA_SHIFT, 0),
1420SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 0,
1421 ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX2_ENA_SHIFT, 0),
1422
1423SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0,
1424 ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX1_ENA_SHIFT, 0),
1425SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0,
1426 ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX2_ENA_SHIFT, 0),
1427
Mark Brownf607e312013-02-22 18:36:53 +00001428SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
Charles Keepaxd1acd312015-07-07 15:28:14 +01001429 ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, wm5110_hp_ev,
Charles Keepax054e1b42015-01-20 16:31:50 +00001430 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxe1ae5fb2015-01-20 16:31:51 +00001431 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brownf607e312013-02-22 18:36:53 +00001432SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM,
Charles Keepaxd1acd312015-07-07 15:28:14 +01001433 ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, wm5110_hp_ev,
Charles Keepax054e1b42015-01-20 16:31:50 +00001434 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxe1ae5fb2015-01-20 16:31:51 +00001435 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001436SND_SOC_DAPM_PGA_E("OUT2L", ARIZONA_OUTPUT_ENABLES_1,
1437 ARIZONA_OUT2L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
Charles Keepax054e1b42015-01-20 16:31:50 +00001438 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxe1ae5fb2015-01-20 16:31:51 +00001439 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001440SND_SOC_DAPM_PGA_E("OUT2R", ARIZONA_OUTPUT_ENABLES_1,
1441 ARIZONA_OUT2R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
Charles Keepax054e1b42015-01-20 16:31:50 +00001442 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxe1ae5fb2015-01-20 16:31:51 +00001443 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001444SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
1445 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
Charles Keepax054e1b42015-01-20 16:31:50 +00001446 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxe1ae5fb2015-01-20 16:31:51 +00001447 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown20bf6912012-09-26 17:52:36 +01001448SND_SOC_DAPM_PGA_E("OUT3R", ARIZONA_OUTPUT_ENABLES_1,
1449 ARIZONA_OUT3R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
Charles Keepax054e1b42015-01-20 16:31:50 +00001450 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
Charles Keepaxe1ae5fb2015-01-20 16:31:51 +00001451 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +01001452SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1,
1453 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1454 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1455SND_SOC_DAPM_PGA_E("OUT5R", ARIZONA_OUTPUT_ENABLES_1,
1456 ARIZONA_OUT5R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1457 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1458SND_SOC_DAPM_PGA_E("OUT6L", ARIZONA_OUTPUT_ENABLES_1,
1459 ARIZONA_OUT6L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1460 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1461SND_SOC_DAPM_PGA_E("OUT6R", ARIZONA_OUTPUT_ENABLES_1,
1462 ARIZONA_OUT6R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1463 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1464
1465ARIZONA_MIXER_WIDGETS(EQ1, "EQ1"),
1466ARIZONA_MIXER_WIDGETS(EQ2, "EQ2"),
1467ARIZONA_MIXER_WIDGETS(EQ3, "EQ3"),
1468ARIZONA_MIXER_WIDGETS(EQ4, "EQ4"),
1469
1470ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"),
1471ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"),
1472ARIZONA_MIXER_WIDGETS(DRC2L, "DRC2L"),
1473ARIZONA_MIXER_WIDGETS(DRC2R, "DRC2R"),
1474
1475ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"),
1476ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"),
1477ARIZONA_MIXER_WIDGETS(LHPF3, "LHPF3"),
1478ARIZONA_MIXER_WIDGETS(LHPF4, "LHPF4"),
1479
1480ARIZONA_MIXER_WIDGETS(Mic, "Mic"),
1481ARIZONA_MIXER_WIDGETS(Noise, "Noise"),
1482
1483ARIZONA_MIXER_WIDGETS(PWM1, "PWM1"),
1484ARIZONA_MIXER_WIDGETS(PWM2, "PWM2"),
1485
1486ARIZONA_MIXER_WIDGETS(OUT1L, "HPOUT1L"),
1487ARIZONA_MIXER_WIDGETS(OUT1R, "HPOUT1R"),
1488ARIZONA_MIXER_WIDGETS(OUT2L, "HPOUT2L"),
1489ARIZONA_MIXER_WIDGETS(OUT2R, "HPOUT2R"),
Mark Brown35d38892012-08-26 13:50:48 -07001490ARIZONA_MIXER_WIDGETS(OUT3L, "HPOUT3L"),
1491ARIZONA_MIXER_WIDGETS(OUT3R, "HPOUT3R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001492ARIZONA_MIXER_WIDGETS(SPKOUTL, "SPKOUTL"),
1493ARIZONA_MIXER_WIDGETS(SPKOUTR, "SPKOUTR"),
1494ARIZONA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"),
1495ARIZONA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"),
1496ARIZONA_MIXER_WIDGETS(SPKDAT2L, "SPKDAT2L"),
1497ARIZONA_MIXER_WIDGETS(SPKDAT2R, "SPKDAT2R"),
1498
1499ARIZONA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"),
1500ARIZONA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"),
1501ARIZONA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"),
1502ARIZONA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"),
1503ARIZONA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"),
1504ARIZONA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"),
1505ARIZONA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"),
1506ARIZONA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"),
1507
1508ARIZONA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"),
1509ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001510ARIZONA_MIXER_WIDGETS(AIF2TX3, "AIF2TX3"),
1511ARIZONA_MIXER_WIDGETS(AIF2TX4, "AIF2TX4"),
1512ARIZONA_MIXER_WIDGETS(AIF2TX5, "AIF2TX5"),
1513ARIZONA_MIXER_WIDGETS(AIF2TX6, "AIF2TX6"),
Mark Brown5c6af632012-07-09 19:09:41 +01001514
1515ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"),
1516ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"),
1517
Mark Brownd217f902013-05-17 13:29:05 +01001518ARIZONA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"),
1519ARIZONA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"),
1520ARIZONA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"),
1521ARIZONA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"),
1522ARIZONA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"),
1523ARIZONA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"),
1524ARIZONA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"),
1525ARIZONA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"),
1526
Charles Keepax5886c742012-11-13 16:40:34 +00001527ARIZONA_MUX_WIDGETS(ASRC1L, "ASRC1L"),
1528ARIZONA_MUX_WIDGETS(ASRC1R, "ASRC1R"),
1529ARIZONA_MUX_WIDGETS(ASRC2L, "ASRC2L"),
1530ARIZONA_MUX_WIDGETS(ASRC2R, "ASRC2R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001531
Mark Brown9a3e1b82013-11-19 16:04:01 +00001532ARIZONA_DSP_WIDGETS(DSP1, "DSP1"),
1533ARIZONA_DSP_WIDGETS(DSP2, "DSP2"),
1534ARIZONA_DSP_WIDGETS(DSP3, "DSP3"),
1535ARIZONA_DSP_WIDGETS(DSP4, "DSP4"),
1536
Charles Keepax0da2e5b2013-11-19 16:04:02 +00001537ARIZONA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"),
1538ARIZONA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"),
1539ARIZONA_MUX_WIDGETS(ISRC1DEC3, "ISRC1DEC3"),
1540ARIZONA_MUX_WIDGETS(ISRC1DEC4, "ISRC1DEC4"),
1541
1542ARIZONA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"),
1543ARIZONA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"),
1544ARIZONA_MUX_WIDGETS(ISRC1INT3, "ISRC1INT3"),
1545ARIZONA_MUX_WIDGETS(ISRC1INT4, "ISRC1INT4"),
1546
1547ARIZONA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"),
1548ARIZONA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"),
1549ARIZONA_MUX_WIDGETS(ISRC2DEC3, "ISRC2DEC3"),
1550ARIZONA_MUX_WIDGETS(ISRC2DEC4, "ISRC2DEC4"),
1551
1552ARIZONA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"),
1553ARIZONA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"),
1554ARIZONA_MUX_WIDGETS(ISRC2INT3, "ISRC2INT3"),
1555ARIZONA_MUX_WIDGETS(ISRC2INT4, "ISRC2INT4"),
1556
1557ARIZONA_MUX_WIDGETS(ISRC3DEC1, "ISRC3DEC1"),
1558ARIZONA_MUX_WIDGETS(ISRC3DEC2, "ISRC3DEC2"),
1559ARIZONA_MUX_WIDGETS(ISRC3DEC3, "ISRC3DEC3"),
1560ARIZONA_MUX_WIDGETS(ISRC3DEC4, "ISRC3DEC4"),
1561
1562ARIZONA_MUX_WIDGETS(ISRC3INT1, "ISRC3INT1"),
1563ARIZONA_MUX_WIDGETS(ISRC3INT2, "ISRC3INT2"),
1564ARIZONA_MUX_WIDGETS(ISRC3INT3, "ISRC3INT3"),
1565ARIZONA_MUX_WIDGETS(ISRC3INT4, "ISRC3INT4"),
1566
Mark Brown5c6af632012-07-09 19:09:41 +01001567SND_SOC_DAPM_OUTPUT("HPOUT1L"),
1568SND_SOC_DAPM_OUTPUT("HPOUT1R"),
1569SND_SOC_DAPM_OUTPUT("HPOUT2L"),
1570SND_SOC_DAPM_OUTPUT("HPOUT2R"),
Mark Brown35d38892012-08-26 13:50:48 -07001571SND_SOC_DAPM_OUTPUT("HPOUT3L"),
1572SND_SOC_DAPM_OUTPUT("HPOUT3R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001573SND_SOC_DAPM_OUTPUT("SPKOUTLN"),
1574SND_SOC_DAPM_OUTPUT("SPKOUTLP"),
1575SND_SOC_DAPM_OUTPUT("SPKOUTRN"),
1576SND_SOC_DAPM_OUTPUT("SPKOUTRP"),
1577SND_SOC_DAPM_OUTPUT("SPKDAT1L"),
1578SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
1579SND_SOC_DAPM_OUTPUT("SPKDAT2L"),
1580SND_SOC_DAPM_OUTPUT("SPKDAT2R"),
Mark Brown57a10a12013-01-10 19:32:33 +00001581
1582SND_SOC_DAPM_OUTPUT("MICSUPP"),
Mark Brown5c6af632012-07-09 19:09:41 +01001583};
1584
1585#define ARIZONA_MIXER_INPUT_ROUTES(name) \
1586 { name, "Noise Generator", "Noise Generator" }, \
1587 { name, "Tone Generator 1", "Tone Generator 1" }, \
1588 { name, "Tone Generator 2", "Tone Generator 2" }, \
Mark Brown2f76e682012-11-26 21:18:18 +00001589 { name, "Haptics", "HAPTICS" }, \
Mark Browndac8f1c2012-08-26 13:51:27 -07001590 { name, "AEC", "AEC Loopback" }, \
Mark Brown5c6af632012-07-09 19:09:41 +01001591 { name, "IN1L", "IN1L PGA" }, \
1592 { name, "IN1R", "IN1R PGA" }, \
1593 { name, "IN2L", "IN2L PGA" }, \
1594 { name, "IN2R", "IN2R PGA" }, \
1595 { name, "IN3L", "IN3L PGA" }, \
1596 { name, "IN3R", "IN3R PGA" }, \
1597 { name, "IN4L", "IN4L PGA" }, \
1598 { name, "IN4R", "IN4R PGA" }, \
1599 { name, "Mic Mute Mixer", "Mic Mute Mixer" }, \
1600 { name, "AIF1RX1", "AIF1RX1" }, \
1601 { name, "AIF1RX2", "AIF1RX2" }, \
1602 { name, "AIF1RX3", "AIF1RX3" }, \
1603 { name, "AIF1RX4", "AIF1RX4" }, \
1604 { name, "AIF1RX5", "AIF1RX5" }, \
1605 { name, "AIF1RX6", "AIF1RX6" }, \
1606 { name, "AIF1RX7", "AIF1RX7" }, \
1607 { name, "AIF1RX8", "AIF1RX8" }, \
1608 { name, "AIF2RX1", "AIF2RX1" }, \
1609 { name, "AIF2RX2", "AIF2RX2" }, \
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001610 { name, "AIF2RX3", "AIF2RX3" }, \
1611 { name, "AIF2RX4", "AIF2RX4" }, \
1612 { name, "AIF2RX5", "AIF2RX5" }, \
1613 { name, "AIF2RX6", "AIF2RX6" }, \
Mark Brown5c6af632012-07-09 19:09:41 +01001614 { name, "AIF3RX1", "AIF3RX1" }, \
1615 { name, "AIF3RX2", "AIF3RX2" }, \
Mark Brownd217f902013-05-17 13:29:05 +01001616 { name, "SLIMRX1", "SLIMRX1" }, \
1617 { name, "SLIMRX2", "SLIMRX2" }, \
1618 { name, "SLIMRX3", "SLIMRX3" }, \
1619 { name, "SLIMRX4", "SLIMRX4" }, \
1620 { name, "SLIMRX5", "SLIMRX5" }, \
1621 { name, "SLIMRX6", "SLIMRX6" }, \
1622 { name, "SLIMRX7", "SLIMRX7" }, \
1623 { name, "SLIMRX8", "SLIMRX8" }, \
Mark Brown5c6af632012-07-09 19:09:41 +01001624 { name, "EQ1", "EQ1" }, \
1625 { name, "EQ2", "EQ2" }, \
1626 { name, "EQ3", "EQ3" }, \
1627 { name, "EQ4", "EQ4" }, \
1628 { name, "DRC1L", "DRC1L" }, \
1629 { name, "DRC1R", "DRC1R" }, \
1630 { name, "DRC2L", "DRC2L" }, \
1631 { name, "DRC2R", "DRC2R" }, \
1632 { name, "LHPF1", "LHPF1" }, \
1633 { name, "LHPF2", "LHPF2" }, \
1634 { name, "LHPF3", "LHPF3" }, \
1635 { name, "LHPF4", "LHPF4" }, \
1636 { name, "ASRC1L", "ASRC1L" }, \
1637 { name, "ASRC1R", "ASRC1R" }, \
1638 { name, "ASRC2L", "ASRC2L" }, \
Mark Brown9a3e1b82013-11-19 16:04:01 +00001639 { name, "ASRC2R", "ASRC2R" }, \
Charles Keepax0da2e5b2013-11-19 16:04:02 +00001640 { name, "ISRC1DEC1", "ISRC1DEC1" }, \
1641 { name, "ISRC1DEC2", "ISRC1DEC2" }, \
1642 { name, "ISRC1DEC3", "ISRC1DEC3" }, \
1643 { name, "ISRC1DEC4", "ISRC1DEC4" }, \
1644 { name, "ISRC1INT1", "ISRC1INT1" }, \
1645 { name, "ISRC1INT2", "ISRC1INT2" }, \
1646 { name, "ISRC1INT3", "ISRC1INT3" }, \
1647 { name, "ISRC1INT4", "ISRC1INT4" }, \
1648 { name, "ISRC2DEC1", "ISRC2DEC1" }, \
1649 { name, "ISRC2DEC2", "ISRC2DEC2" }, \
1650 { name, "ISRC2DEC3", "ISRC2DEC3" }, \
1651 { name, "ISRC2DEC4", "ISRC2DEC4" }, \
1652 { name, "ISRC2INT1", "ISRC2INT1" }, \
1653 { name, "ISRC2INT2", "ISRC2INT2" }, \
1654 { name, "ISRC2INT3", "ISRC2INT3" }, \
1655 { name, "ISRC2INT4", "ISRC2INT4" }, \
1656 { name, "ISRC3DEC1", "ISRC3DEC1" }, \
1657 { name, "ISRC3DEC2", "ISRC3DEC2" }, \
1658 { name, "ISRC3DEC3", "ISRC3DEC3" }, \
1659 { name, "ISRC3DEC4", "ISRC3DEC4" }, \
1660 { name, "ISRC3INT1", "ISRC3INT1" }, \
1661 { name, "ISRC3INT2", "ISRC3INT2" }, \
1662 { name, "ISRC3INT3", "ISRC3INT3" }, \
1663 { name, "ISRC3INT4", "ISRC3INT4" }, \
Mark Brown9a3e1b82013-11-19 16:04:01 +00001664 { name, "DSP1.1", "DSP1" }, \
1665 { name, "DSP1.2", "DSP1" }, \
1666 { name, "DSP1.3", "DSP1" }, \
1667 { name, "DSP1.4", "DSP1" }, \
1668 { name, "DSP1.5", "DSP1" }, \
1669 { name, "DSP1.6", "DSP1" }, \
1670 { name, "DSP2.1", "DSP2" }, \
1671 { name, "DSP2.2", "DSP2" }, \
1672 { name, "DSP2.3", "DSP2" }, \
1673 { name, "DSP2.4", "DSP2" }, \
1674 { name, "DSP2.5", "DSP2" }, \
1675 { name, "DSP2.6", "DSP2" }, \
1676 { name, "DSP3.1", "DSP3" }, \
1677 { name, "DSP3.2", "DSP3" }, \
1678 { name, "DSP3.3", "DSP3" }, \
1679 { name, "DSP3.4", "DSP3" }, \
1680 { name, "DSP3.5", "DSP3" }, \
1681 { name, "DSP3.6", "DSP3" }, \
1682 { name, "DSP4.1", "DSP4" }, \
1683 { name, "DSP4.2", "DSP4" }, \
1684 { name, "DSP4.3", "DSP4" }, \
1685 { name, "DSP4.4", "DSP4" }, \
1686 { name, "DSP4.5", "DSP4" }, \
1687 { name, "DSP4.6", "DSP4" }
Mark Brown5c6af632012-07-09 19:09:41 +01001688
1689static const struct snd_soc_dapm_route wm5110_dapm_routes[] = {
1690 { "AIF2 Capture", NULL, "DBVDD2" },
1691 { "AIF2 Playback", NULL, "DBVDD2" },
1692
1693 { "AIF3 Capture", NULL, "DBVDD3" },
1694 { "AIF3 Playback", NULL, "DBVDD3" },
1695
1696 { "OUT1L", NULL, "CPVDD" },
1697 { "OUT1R", NULL, "CPVDD" },
1698 { "OUT2L", NULL, "CPVDD" },
1699 { "OUT2R", NULL, "CPVDD" },
1700 { "OUT3L", NULL, "CPVDD" },
Mark Brown20bf6912012-09-26 17:52:36 +01001701 { "OUT3R", NULL, "CPVDD" },
Mark Brown5c6af632012-07-09 19:09:41 +01001702
1703 { "OUT4L", NULL, "SPKVDDL" },
1704 { "OUT4R", NULL, "SPKVDDR" },
1705
1706 { "OUT1L", NULL, "SYSCLK" },
1707 { "OUT1R", NULL, "SYSCLK" },
1708 { "OUT2L", NULL, "SYSCLK" },
1709 { "OUT2R", NULL, "SYSCLK" },
1710 { "OUT3L", NULL, "SYSCLK" },
1711 { "OUT4L", NULL, "SYSCLK" },
1712 { "OUT4R", NULL, "SYSCLK" },
1713 { "OUT5L", NULL, "SYSCLK" },
1714 { "OUT5R", NULL, "SYSCLK" },
1715 { "OUT6L", NULL, "SYSCLK" },
1716 { "OUT6R", NULL, "SYSCLK" },
1717
Charles Keepax6dc6a3f2013-06-05 14:51:31 +01001718 { "IN1L", NULL, "SYSCLK" },
1719 { "IN1R", NULL, "SYSCLK" },
1720 { "IN2L", NULL, "SYSCLK" },
1721 { "IN2R", NULL, "SYSCLK" },
1722 { "IN3L", NULL, "SYSCLK" },
1723 { "IN3R", NULL, "SYSCLK" },
1724 { "IN4L", NULL, "SYSCLK" },
1725 { "IN4R", NULL, "SYSCLK" },
1726
Mark Brown5c6af632012-07-09 19:09:41 +01001727 { "MICBIAS1", NULL, "MICVDD" },
1728 { "MICBIAS2", NULL, "MICVDD" },
1729 { "MICBIAS3", NULL, "MICVDD" },
1730
Charles Keepax6dc6a3f2013-06-05 14:51:31 +01001731 { "Noise Generator", NULL, "SYSCLK" },
1732 { "Tone Generator 1", NULL, "SYSCLK" },
1733 { "Tone Generator 2", NULL, "SYSCLK" },
1734
Mark Brown5c6af632012-07-09 19:09:41 +01001735 { "Noise Generator", NULL, "NOISE" },
1736 { "Tone Generator 1", NULL, "TONE" },
1737 { "Tone Generator 2", NULL, "TONE" },
1738
Mark Brown5c6af632012-07-09 19:09:41 +01001739 { "AIF1 Capture", NULL, "AIF1TX1" },
1740 { "AIF1 Capture", NULL, "AIF1TX2" },
1741 { "AIF1 Capture", NULL, "AIF1TX3" },
1742 { "AIF1 Capture", NULL, "AIF1TX4" },
1743 { "AIF1 Capture", NULL, "AIF1TX5" },
1744 { "AIF1 Capture", NULL, "AIF1TX6" },
1745 { "AIF1 Capture", NULL, "AIF1TX7" },
1746 { "AIF1 Capture", NULL, "AIF1TX8" },
1747
1748 { "AIF1RX1", NULL, "AIF1 Playback" },
1749 { "AIF1RX2", NULL, "AIF1 Playback" },
1750 { "AIF1RX3", NULL, "AIF1 Playback" },
1751 { "AIF1RX4", NULL, "AIF1 Playback" },
1752 { "AIF1RX5", NULL, "AIF1 Playback" },
1753 { "AIF1RX6", NULL, "AIF1 Playback" },
1754 { "AIF1RX7", NULL, "AIF1 Playback" },
1755 { "AIF1RX8", NULL, "AIF1 Playback" },
1756
1757 { "AIF2 Capture", NULL, "AIF2TX1" },
1758 { "AIF2 Capture", NULL, "AIF2TX2" },
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001759 { "AIF2 Capture", NULL, "AIF2TX3" },
1760 { "AIF2 Capture", NULL, "AIF2TX4" },
1761 { "AIF2 Capture", NULL, "AIF2TX5" },
1762 { "AIF2 Capture", NULL, "AIF2TX6" },
Mark Brown5c6af632012-07-09 19:09:41 +01001763
1764 { "AIF2RX1", NULL, "AIF2 Playback" },
1765 { "AIF2RX2", NULL, "AIF2 Playback" },
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001766 { "AIF2RX3", NULL, "AIF2 Playback" },
1767 { "AIF2RX4", NULL, "AIF2 Playback" },
1768 { "AIF2RX5", NULL, "AIF2 Playback" },
1769 { "AIF2RX6", NULL, "AIF2 Playback" },
Mark Brown5c6af632012-07-09 19:09:41 +01001770
1771 { "AIF3 Capture", NULL, "AIF3TX1" },
1772 { "AIF3 Capture", NULL, "AIF3TX2" },
1773
1774 { "AIF3RX1", NULL, "AIF3 Playback" },
1775 { "AIF3RX2", NULL, "AIF3 Playback" },
1776
Mark Brownd217f902013-05-17 13:29:05 +01001777 { "Slim1 Capture", NULL, "SLIMTX1" },
1778 { "Slim1 Capture", NULL, "SLIMTX2" },
1779 { "Slim1 Capture", NULL, "SLIMTX3" },
1780 { "Slim1 Capture", NULL, "SLIMTX4" },
1781
1782 { "SLIMRX1", NULL, "Slim1 Playback" },
1783 { "SLIMRX2", NULL, "Slim1 Playback" },
1784 { "SLIMRX3", NULL, "Slim1 Playback" },
1785 { "SLIMRX4", NULL, "Slim1 Playback" },
1786
1787 { "Slim2 Capture", NULL, "SLIMTX5" },
1788 { "Slim2 Capture", NULL, "SLIMTX6" },
1789
1790 { "SLIMRX5", NULL, "Slim2 Playback" },
1791 { "SLIMRX6", NULL, "Slim2 Playback" },
1792
1793 { "Slim3 Capture", NULL, "SLIMTX7" },
1794 { "Slim3 Capture", NULL, "SLIMTX8" },
1795
1796 { "SLIMRX7", NULL, "Slim3 Playback" },
1797 { "SLIMRX8", NULL, "Slim3 Playback" },
1798
Mark Brown5c6af632012-07-09 19:09:41 +01001799 { "AIF1 Playback", NULL, "SYSCLK" },
1800 { "AIF2 Playback", NULL, "SYSCLK" },
1801 { "AIF3 Playback", NULL, "SYSCLK" },
Mark Brownd217f902013-05-17 13:29:05 +01001802 { "Slim1 Playback", NULL, "SYSCLK" },
1803 { "Slim2 Playback", NULL, "SYSCLK" },
1804 { "Slim3 Playback", NULL, "SYSCLK" },
Mark Brown5c6af632012-07-09 19:09:41 +01001805
1806 { "AIF1 Capture", NULL, "SYSCLK" },
1807 { "AIF2 Capture", NULL, "SYSCLK" },
1808 { "AIF3 Capture", NULL, "SYSCLK" },
Mark Brownd217f902013-05-17 13:29:05 +01001809 { "Slim1 Capture", NULL, "SYSCLK" },
1810 { "Slim2 Capture", NULL, "SYSCLK" },
1811 { "Slim3 Capture", NULL, "SYSCLK" },
Mark Brown5c6af632012-07-09 19:09:41 +01001812
Charles Keepax1d981e02015-12-15 11:29:42 +00001813 { "Voice Control DSP", NULL, "DSP3" },
1814 { "Voice Control DSP", NULL, "SYSCLK" },
1815
Mark Brown17c3f7e2012-08-10 15:40:22 +01001816 { "IN1L PGA", NULL, "IN1L" },
1817 { "IN1R PGA", NULL, "IN1R" },
1818
1819 { "IN2L PGA", NULL, "IN2L" },
1820 { "IN2R PGA", NULL, "IN2R" },
1821
1822 { "IN3L PGA", NULL, "IN3L" },
1823 { "IN3R PGA", NULL, "IN3R" },
1824
1825 { "IN4L PGA", NULL, "IN4L" },
1826 { "IN4R PGA", NULL, "IN4R" },
1827
Mark Brown5c6af632012-07-09 19:09:41 +01001828 ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
1829 ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
1830 ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"),
1831 ARIZONA_MIXER_ROUTES("OUT2R", "HPOUT2R"),
Mark Brown35d38892012-08-26 13:50:48 -07001832 ARIZONA_MIXER_ROUTES("OUT3L", "HPOUT3L"),
1833 ARIZONA_MIXER_ROUTES("OUT3R", "HPOUT3R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001834
1835 ARIZONA_MIXER_ROUTES("OUT4L", "SPKOUTL"),
1836 ARIZONA_MIXER_ROUTES("OUT4R", "SPKOUTR"),
1837 ARIZONA_MIXER_ROUTES("OUT5L", "SPKDAT1L"),
1838 ARIZONA_MIXER_ROUTES("OUT5R", "SPKDAT1R"),
1839 ARIZONA_MIXER_ROUTES("OUT6L", "SPKDAT2L"),
1840 ARIZONA_MIXER_ROUTES("OUT6R", "SPKDAT2R"),
1841
1842 ARIZONA_MIXER_ROUTES("PWM1 Driver", "PWM1"),
1843 ARIZONA_MIXER_ROUTES("PWM2 Driver", "PWM2"),
1844
1845 ARIZONA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"),
1846 ARIZONA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"),
1847 ARIZONA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"),
1848 ARIZONA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"),
1849 ARIZONA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"),
1850 ARIZONA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"),
1851 ARIZONA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"),
1852 ARIZONA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"),
1853
1854 ARIZONA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"),
1855 ARIZONA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001856 ARIZONA_MIXER_ROUTES("AIF2TX3", "AIF2TX3"),
1857 ARIZONA_MIXER_ROUTES("AIF2TX4", "AIF2TX4"),
1858 ARIZONA_MIXER_ROUTES("AIF2TX5", "AIF2TX5"),
1859 ARIZONA_MIXER_ROUTES("AIF2TX6", "AIF2TX6"),
Mark Brown5c6af632012-07-09 19:09:41 +01001860
1861 ARIZONA_MIXER_ROUTES("AIF3TX1", "AIF3TX1"),
1862 ARIZONA_MIXER_ROUTES("AIF3TX2", "AIF3TX2"),
1863
Mark Brownd217f902013-05-17 13:29:05 +01001864 ARIZONA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"),
1865 ARIZONA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"),
1866 ARIZONA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"),
1867 ARIZONA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"),
1868 ARIZONA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"),
1869 ARIZONA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"),
1870 ARIZONA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"),
1871 ARIZONA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"),
1872
Mark Brown5c6af632012-07-09 19:09:41 +01001873 ARIZONA_MIXER_ROUTES("EQ1", "EQ1"),
1874 ARIZONA_MIXER_ROUTES("EQ2", "EQ2"),
1875 ARIZONA_MIXER_ROUTES("EQ3", "EQ3"),
1876 ARIZONA_MIXER_ROUTES("EQ4", "EQ4"),
1877
1878 ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"),
1879 ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"),
1880 ARIZONA_MIXER_ROUTES("DRC2L", "DRC2L"),
1881 ARIZONA_MIXER_ROUTES("DRC2R", "DRC2R"),
1882
1883 ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"),
1884 ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"),
1885 ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"),
1886 ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"),
1887
Mark Brown66e7aa22013-08-12 23:59:08 +01001888 ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Noise"),
1889 ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"),
1890
Charles Keepaxe7edb272013-08-12 11:33:32 +01001891 ARIZONA_MUX_ROUTES("ASRC1L", "ASRC1L"),
1892 ARIZONA_MUX_ROUTES("ASRC1R", "ASRC1R"),
1893 ARIZONA_MUX_ROUTES("ASRC2L", "ASRC2L"),
1894 ARIZONA_MUX_ROUTES("ASRC2R", "ASRC2R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001895
Mark Brown9a3e1b82013-11-19 16:04:01 +00001896 ARIZONA_DSP_ROUTES("DSP1"),
1897 ARIZONA_DSP_ROUTES("DSP2"),
1898 ARIZONA_DSP_ROUTES("DSP3"),
1899 ARIZONA_DSP_ROUTES("DSP4"),
1900
Charles Keepax0da2e5b2013-11-19 16:04:02 +00001901 ARIZONA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"),
1902 ARIZONA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"),
1903 ARIZONA_MUX_ROUTES("ISRC1INT3", "ISRC1INT3"),
1904 ARIZONA_MUX_ROUTES("ISRC1INT4", "ISRC1INT4"),
1905
1906 ARIZONA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"),
1907 ARIZONA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"),
1908 ARIZONA_MUX_ROUTES("ISRC1DEC3", "ISRC1DEC3"),
1909 ARIZONA_MUX_ROUTES("ISRC1DEC4", "ISRC1DEC4"),
1910
1911 ARIZONA_MUX_ROUTES("ISRC2INT1", "ISRC2INT1"),
1912 ARIZONA_MUX_ROUTES("ISRC2INT2", "ISRC2INT2"),
1913 ARIZONA_MUX_ROUTES("ISRC2INT3", "ISRC2INT3"),
1914 ARIZONA_MUX_ROUTES("ISRC2INT4", "ISRC2INT4"),
1915
1916 ARIZONA_MUX_ROUTES("ISRC2DEC1", "ISRC2DEC1"),
1917 ARIZONA_MUX_ROUTES("ISRC2DEC2", "ISRC2DEC2"),
1918 ARIZONA_MUX_ROUTES("ISRC2DEC3", "ISRC2DEC3"),
1919 ARIZONA_MUX_ROUTES("ISRC2DEC4", "ISRC2DEC4"),
1920
1921 ARIZONA_MUX_ROUTES("ISRC3INT1", "ISRC3INT1"),
1922 ARIZONA_MUX_ROUTES("ISRC3INT2", "ISRC3INT2"),
1923 ARIZONA_MUX_ROUTES("ISRC3INT3", "ISRC3INT3"),
1924 ARIZONA_MUX_ROUTES("ISRC3INT4", "ISRC3INT4"),
1925
1926 ARIZONA_MUX_ROUTES("ISRC3DEC1", "ISRC3DEC1"),
1927 ARIZONA_MUX_ROUTES("ISRC3DEC2", "ISRC3DEC2"),
1928 ARIZONA_MUX_ROUTES("ISRC3DEC3", "ISRC3DEC3"),
1929 ARIZONA_MUX_ROUTES("ISRC3DEC4", "ISRC3DEC4"),
1930
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001931 { "AEC Loopback", "HPOUT1L", "OUT1L" },
1932 { "AEC Loopback", "HPOUT1R", "OUT1R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001933 { "HPOUT1L", NULL, "OUT1L" },
1934 { "HPOUT1R", NULL, "OUT1R" },
1935
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001936 { "AEC Loopback", "HPOUT2L", "OUT2L" },
1937 { "AEC Loopback", "HPOUT2R", "OUT2R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001938 { "HPOUT2L", NULL, "OUT2L" },
1939 { "HPOUT2R", NULL, "OUT2R" },
1940
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001941 { "AEC Loopback", "HPOUT3L", "OUT3L" },
1942 { "AEC Loopback", "HPOUT3R", "OUT3R" },
Mark Brown35d38892012-08-26 13:50:48 -07001943 { "HPOUT3L", NULL, "OUT3L" },
Charles Keepax280484e2013-12-17 13:16:16 +00001944 { "HPOUT3R", NULL, "OUT3R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001945
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001946 { "AEC Loopback", "SPKOUTL", "OUT4L" },
Mark Brown5c6af632012-07-09 19:09:41 +01001947 { "SPKOUTLN", NULL, "OUT4L" },
1948 { "SPKOUTLP", NULL, "OUT4L" },
1949
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001950 { "AEC Loopback", "SPKOUTR", "OUT4R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001951 { "SPKOUTRN", NULL, "OUT4R" },
1952 { "SPKOUTRP", NULL, "OUT4R" },
1953
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001954 { "AEC Loopback", "SPKDAT1L", "OUT5L" },
1955 { "AEC Loopback", "SPKDAT1R", "OUT5R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001956 { "SPKDAT1L", NULL, "OUT5L" },
1957 { "SPKDAT1R", NULL, "OUT5R" },
1958
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001959 { "AEC Loopback", "SPKDAT2L", "OUT6L" },
1960 { "AEC Loopback", "SPKDAT2R", "OUT6R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001961 { "SPKDAT2L", NULL, "OUT6L" },
1962 { "SPKDAT2R", NULL, "OUT6R" },
Mark Brown57a10a12013-01-10 19:32:33 +00001963
Charles Keepaxd1901062015-11-19 16:11:10 +00001964 WM5110_RXANC_INPUT_ROUTES("RXANCL", "RXANCL"),
1965 WM5110_RXANC_INPUT_ROUTES("RXANCR", "RXANCR"),
1966
1967 WM5110_RXANC_OUTPUT_ROUTES("OUT1L", "HPOUT1L"),
1968 WM5110_RXANC_OUTPUT_ROUTES("OUT1R", "HPOUT1R"),
1969 WM5110_RXANC_OUTPUT_ROUTES("OUT2L", "HPOUT2L"),
1970 WM5110_RXANC_OUTPUT_ROUTES("OUT2R", "HPOUT2R"),
1971 WM5110_RXANC_OUTPUT_ROUTES("OUT3L", "HPOUT3L"),
1972 WM5110_RXANC_OUTPUT_ROUTES("OUT3R", "HPOUT3R"),
1973 WM5110_RXANC_OUTPUT_ROUTES("OUT4L", "SPKOUTL"),
1974 WM5110_RXANC_OUTPUT_ROUTES("OUT4R", "SPKOUTR"),
1975 WM5110_RXANC_OUTPUT_ROUTES("OUT5L", "SPKDAT1L"),
1976 WM5110_RXANC_OUTPUT_ROUTES("OUT5R", "SPKDAT1R"),
1977 WM5110_RXANC_OUTPUT_ROUTES("OUT6L", "SPKDAT2L"),
1978 WM5110_RXANC_OUTPUT_ROUTES("OUT6R", "SPKDAT2R"),
1979
Mark Brown57a10a12013-01-10 19:32:33 +00001980 { "MICSUPP", NULL, "SYSCLK" },
Charles Keepaxb63144e2013-07-04 08:56:28 +01001981
1982 { "DRC1 Signal Activity", NULL, "DRC1L" },
1983 { "DRC1 Signal Activity", NULL, "DRC1R" },
1984 { "DRC2 Signal Activity", NULL, "DRC2L" },
1985 { "DRC2 Signal Activity", NULL, "DRC2R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001986};
1987
1988static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
1989 unsigned int Fref, unsigned int Fout)
1990{
1991 struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec);
1992
1993 switch (fll_id) {
1994 case WM5110_FLL1:
1995 return arizona_set_fll(&wm5110->fll[0], source, Fref, Fout);
1996 case WM5110_FLL2:
1997 return arizona_set_fll(&wm5110->fll[1], source, Fref, Fout);
Charles Keepaxee929a92013-02-20 17:28:40 +00001998 case WM5110_FLL1_REFCLK:
1999 return arizona_set_fll_refclk(&wm5110->fll[0], source, Fref,
2000 Fout);
2001 case WM5110_FLL2_REFCLK:
2002 return arizona_set_fll_refclk(&wm5110->fll[1], source, Fref,
2003 Fout);
Mark Brown5c6af632012-07-09 19:09:41 +01002004 default:
2005 return -EINVAL;
2006 }
2007}
2008
2009#define WM5110_RATES SNDRV_PCM_RATE_8000_192000
2010
2011#define WM5110_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
2012 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
2013
2014static struct snd_soc_dai_driver wm5110_dai[] = {
2015 {
2016 .name = "wm5110-aif1",
2017 .id = 1,
2018 .base = ARIZONA_AIF1_BCLK_CTRL,
2019 .playback = {
2020 .stream_name = "AIF1 Playback",
2021 .channels_min = 1,
2022 .channels_max = 8,
2023 .rates = WM5110_RATES,
2024 .formats = WM5110_FORMATS,
2025 },
2026 .capture = {
2027 .stream_name = "AIF1 Capture",
2028 .channels_min = 1,
2029 .channels_max = 8,
2030 .rates = WM5110_RATES,
2031 .formats = WM5110_FORMATS,
2032 },
2033 .ops = &arizona_dai_ops,
2034 .symmetric_rates = 1,
Richard Fitzgerald3d02cc72014-07-22 11:50:22 +01002035 .symmetric_samplebits = 1,
Mark Brown5c6af632012-07-09 19:09:41 +01002036 },
2037 {
2038 .name = "wm5110-aif2",
2039 .id = 2,
2040 .base = ARIZONA_AIF2_BCLK_CTRL,
2041 .playback = {
2042 .stream_name = "AIF2 Playback",
2043 .channels_min = 1,
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00002044 .channels_max = 6,
Mark Brown5c6af632012-07-09 19:09:41 +01002045 .rates = WM5110_RATES,
2046 .formats = WM5110_FORMATS,
2047 },
2048 .capture = {
2049 .stream_name = "AIF2 Capture",
2050 .channels_min = 1,
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00002051 .channels_max = 6,
Mark Brown5c6af632012-07-09 19:09:41 +01002052 .rates = WM5110_RATES,
2053 .formats = WM5110_FORMATS,
2054 },
2055 .ops = &arizona_dai_ops,
2056 .symmetric_rates = 1,
Richard Fitzgerald3d02cc72014-07-22 11:50:22 +01002057 .symmetric_samplebits = 1,
Mark Brown5c6af632012-07-09 19:09:41 +01002058 },
2059 {
2060 .name = "wm5110-aif3",
2061 .id = 3,
2062 .base = ARIZONA_AIF3_BCLK_CTRL,
2063 .playback = {
2064 .stream_name = "AIF3 Playback",
2065 .channels_min = 1,
2066 .channels_max = 2,
2067 .rates = WM5110_RATES,
2068 .formats = WM5110_FORMATS,
2069 },
2070 .capture = {
2071 .stream_name = "AIF3 Capture",
2072 .channels_min = 1,
2073 .channels_max = 2,
2074 .rates = WM5110_RATES,
2075 .formats = WM5110_FORMATS,
2076 },
2077 .ops = &arizona_dai_ops,
2078 .symmetric_rates = 1,
Richard Fitzgerald3d02cc72014-07-22 11:50:22 +01002079 .symmetric_samplebits = 1,
Mark Brown5c6af632012-07-09 19:09:41 +01002080 },
Mark Brownd217f902013-05-17 13:29:05 +01002081 {
2082 .name = "wm5110-slim1",
2083 .id = 4,
2084 .playback = {
2085 .stream_name = "Slim1 Playback",
2086 .channels_min = 1,
2087 .channels_max = 4,
2088 .rates = WM5110_RATES,
2089 .formats = WM5110_FORMATS,
2090 },
2091 .capture = {
2092 .stream_name = "Slim1 Capture",
2093 .channels_min = 1,
2094 .channels_max = 4,
2095 .rates = WM5110_RATES,
2096 .formats = WM5110_FORMATS,
2097 },
2098 .ops = &arizona_simple_dai_ops,
2099 },
2100 {
2101 .name = "wm5110-slim2",
2102 .id = 5,
2103 .playback = {
2104 .stream_name = "Slim2 Playback",
2105 .channels_min = 1,
2106 .channels_max = 2,
2107 .rates = WM5110_RATES,
2108 .formats = WM5110_FORMATS,
2109 },
2110 .capture = {
2111 .stream_name = "Slim2 Capture",
2112 .channels_min = 1,
2113 .channels_max = 2,
2114 .rates = WM5110_RATES,
2115 .formats = WM5110_FORMATS,
2116 },
2117 .ops = &arizona_simple_dai_ops,
2118 },
2119 {
2120 .name = "wm5110-slim3",
2121 .id = 6,
2122 .playback = {
2123 .stream_name = "Slim3 Playback",
2124 .channels_min = 1,
2125 .channels_max = 2,
2126 .rates = WM5110_RATES,
2127 .formats = WM5110_FORMATS,
2128 },
2129 .capture = {
2130 .stream_name = "Slim3 Capture",
2131 .channels_min = 1,
2132 .channels_max = 2,
2133 .rates = WM5110_RATES,
2134 .formats = WM5110_FORMATS,
2135 },
2136 .ops = &arizona_simple_dai_ops,
2137 },
Charles Keepax1d981e02015-12-15 11:29:42 +00002138 {
2139 .name = "wm5110-cpu-voicectrl",
2140 .capture = {
2141 .stream_name = "Voice Control CPU",
2142 .channels_min = 1,
2143 .channels_max = 1,
2144 .rates = WM5110_RATES,
2145 .formats = WM5110_FORMATS,
2146 },
2147 .compress_new = snd_soc_new_compress,
2148 },
2149 {
2150 .name = "wm5110-dsp-voicectrl",
2151 .capture = {
2152 .stream_name = "Voice Control DSP",
2153 .channels_min = 1,
2154 .channels_max = 1,
2155 .rates = WM5110_RATES,
2156 .formats = WM5110_FORMATS,
2157 },
2158 },
Mark Brown5c6af632012-07-09 19:09:41 +01002159};
2160
Charles Keepax406abc92015-12-15 11:29:45 +00002161static int wm5110_open(struct snd_compr_stream *stream)
2162{
2163 struct snd_soc_pcm_runtime *rtd = stream->private_data;
2164 struct wm5110_priv *priv = snd_soc_codec_get_drvdata(rtd->codec);
2165 struct arizona *arizona = priv->core.arizona;
2166 int n_adsp;
2167
2168 if (strcmp(rtd->codec_dai->name, "wm5110-dsp-voicectrl") == 0) {
2169 n_adsp = 2;
2170 } else {
2171 dev_err(arizona->dev,
2172 "No suitable compressed stream for DAI '%s'\n",
2173 rtd->codec_dai->name);
2174 return -EINVAL;
2175 }
2176
2177 return wm_adsp_compr_open(&priv->core.adsp[n_adsp], stream);
2178}
2179
Charles Keepax565ace42016-01-06 12:33:18 +00002180static irqreturn_t wm5110_adsp2_irq(int irq, void *data)
2181{
2182 struct wm5110_priv *florida = data;
2183 int ret;
2184
2185 ret = wm_adsp_compr_handle_irq(&florida->core.adsp[2]);
2186 if (ret == -ENODEV)
2187 return IRQ_NONE;
2188
2189 return IRQ_HANDLED;
2190}
2191
Mark Brown5c6af632012-07-09 19:09:41 +01002192static int wm5110_codec_probe(struct snd_soc_codec *codec)
2193{
Lars-Peter Clausen72945b32015-06-01 10:10:28 +02002194 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
Mark Brown5c6af632012-07-09 19:09:41 +01002195 struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);
Charles Keepax565ace42016-01-06 12:33:18 +00002196 struct arizona *arizona = priv->core.arizona;
Richard Fitzgeraldf5e2ce92015-06-11 11:32:30 +01002197 int i, ret;
Mark Brown5c6af632012-07-09 19:09:41 +01002198
Lars-Peter Clausen72945b32015-06-01 10:10:28 +02002199 priv->core.arizona->dapm = dapm;
Mark Brown2f76e682012-11-26 21:18:18 +00002200
Mark Brown62cc4d52013-05-20 11:28:35 -05002201 arizona_init_spk(codec);
Charles Keepaxb63144e2013-07-04 08:56:28 +01002202 arizona_init_gpio(codec);
Charles Keepaxb60f3632014-06-10 18:41:02 +01002203 arizona_init_mono(codec);
Mark Brown62cc4d52013-05-20 11:28:35 -05002204
Charles Keepax565ace42016-01-06 12:33:18 +00002205 ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
2206 "ADSP2 Compressed IRQ", wm5110_adsp2_irq,
2207 priv);
2208 if (ret != 0) {
2209 dev_err(codec->dev, "Failed to request DSP IRQ: %d\n", ret);
2210 return ret;
2211 }
2212
Richard Fitzgeraldf5e2ce92015-06-11 11:32:30 +01002213 for (i = 0; i < WM5110_NUM_ADSP; ++i) {
2214 ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec);
2215 if (ret)
Charles Keepaxd90c6cc2015-07-10 14:37:25 +01002216 goto err_adsp2_codec_probe;
Richard Fitzgeraldf5e2ce92015-06-11 11:32:30 +01002217 }
Mark Brown9a3e1b82013-11-19 16:04:01 +00002218
Richard Fitzgerald336d0442015-06-18 13:43:19 +01002219 ret = snd_soc_add_codec_controls(codec,
2220 arizona_adsp2_rate_controls,
2221 WM5110_NUM_ADSP);
2222 if (ret)
Charles Keepaxd90c6cc2015-07-10 14:37:25 +01002223 goto err_adsp2_codec_probe;
Richard Fitzgerald336d0442015-06-18 13:43:19 +01002224
Lars-Peter Clausen72945b32015-06-01 10:10:28 +02002225 snd_soc_dapm_disable_pin(dapm, "HAPTICS");
Mark Brown2f76e682012-11-26 21:18:18 +00002226
2227 return 0;
Charles Keepaxd90c6cc2015-07-10 14:37:25 +01002228
2229err_adsp2_codec_probe:
2230 for (--i; i >= 0; --i)
2231 wm_adsp2_codec_remove(&priv->core.adsp[i], codec);
2232
Charles Keepax565ace42016-01-06 12:33:18 +00002233 arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv);
2234
Charles Keepaxd90c6cc2015-07-10 14:37:25 +01002235 return ret;
Mark Brown2f76e682012-11-26 21:18:18 +00002236}
2237
2238static int wm5110_codec_remove(struct snd_soc_codec *codec)
2239{
2240 struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);
Charles Keepax565ace42016-01-06 12:33:18 +00002241 struct arizona *arizona = priv->core.arizona;
Richard Fitzgeraldf5e2ce92015-06-11 11:32:30 +01002242 int i;
2243
2244 for (i = 0; i < WM5110_NUM_ADSP; ++i)
2245 wm_adsp2_codec_remove(&priv->core.adsp[i], codec);
Mark Brown2f76e682012-11-26 21:18:18 +00002246
2247 priv->core.arizona->dapm = NULL;
2248
Charles Keepax565ace42016-01-06 12:33:18 +00002249 arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv);
2250
Mark Brown2f76e682012-11-26 21:18:18 +00002251 return 0;
Mark Brown5c6af632012-07-09 19:09:41 +01002252}
2253
2254#define WM5110_DIG_VU 0x0200
2255
2256static unsigned int wm5110_digital_vu[] = {
Mark Brown5c6af632012-07-09 19:09:41 +01002257 ARIZONA_DAC_DIGITAL_VOLUME_1L,
2258 ARIZONA_DAC_DIGITAL_VOLUME_1R,
2259 ARIZONA_DAC_DIGITAL_VOLUME_2L,
2260 ARIZONA_DAC_DIGITAL_VOLUME_2R,
2261 ARIZONA_DAC_DIGITAL_VOLUME_3L,
2262 ARIZONA_DAC_DIGITAL_VOLUME_3R,
2263 ARIZONA_DAC_DIGITAL_VOLUME_4L,
2264 ARIZONA_DAC_DIGITAL_VOLUME_4R,
2265 ARIZONA_DAC_DIGITAL_VOLUME_5L,
2266 ARIZONA_DAC_DIGITAL_VOLUME_5R,
Charles Keepaxae605032012-09-27 13:21:48 +01002267 ARIZONA_DAC_DIGITAL_VOLUME_6L,
2268 ARIZONA_DAC_DIGITAL_VOLUME_6R,
Mark Brown5c6af632012-07-09 19:09:41 +01002269};
2270
Xiubo Li7a34b1c2014-04-03 07:53:59 +08002271static struct regmap *wm5110_get_regmap(struct device *dev)
Xiubo Li6e4842d2014-03-26 13:40:29 +08002272{
2273 struct wm5110_priv *priv = dev_get_drvdata(dev);
2274
2275 return priv->core.arizona->regmap;
2276}
2277
Mark Brown5c6af632012-07-09 19:09:41 +01002278static struct snd_soc_codec_driver soc_codec_dev_wm5110 = {
2279 .probe = wm5110_codec_probe,
Mark Brown2f76e682012-11-26 21:18:18 +00002280 .remove = wm5110_codec_remove,
Xiubo Li6e4842d2014-03-26 13:40:29 +08002281 .get_regmap = wm5110_get_regmap,
Mark Brown5c6af632012-07-09 19:09:41 +01002282
2283 .idle_bias_off = true,
2284
2285 .set_sysclk = arizona_set_sysclk,
2286 .set_pll = wm5110_set_fll,
2287
2288 .controls = wm5110_snd_controls,
2289 .num_controls = ARRAY_SIZE(wm5110_snd_controls),
2290 .dapm_widgets = wm5110_dapm_widgets,
2291 .num_dapm_widgets = ARRAY_SIZE(wm5110_dapm_widgets),
2292 .dapm_routes = wm5110_dapm_routes,
2293 .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes),
2294};
2295
Charles Keepax1d981e02015-12-15 11:29:42 +00002296static struct snd_compr_ops wm5110_compr_ops = {
Charles Keepax406abc92015-12-15 11:29:45 +00002297 .open = wm5110_open,
2298 .free = wm_adsp_compr_free,
2299 .set_params = wm_adsp_compr_set_params,
2300 .get_caps = wm_adsp_compr_get_caps,
Charles Keepax95fe9592015-12-15 11:29:47 +00002301 .trigger = wm_adsp_compr_trigger,
Charles Keepax565ace42016-01-06 12:33:18 +00002302 .pointer = wm_adsp_compr_pointer,
Charles Keepax83a40ce2016-01-06 12:33:19 +00002303 .copy = wm_adsp_compr_copy,
Charles Keepax1d981e02015-12-15 11:29:42 +00002304};
2305
2306static struct snd_soc_platform_driver wm5110_compr_platform = {
2307 .compr_ops = &wm5110_compr_ops,
2308};
2309
Bill Pemberton7a79e942012-12-07 09:26:37 -05002310static int wm5110_probe(struct platform_device *pdev)
Mark Brown5c6af632012-07-09 19:09:41 +01002311{
2312 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
2313 struct wm5110_priv *wm5110;
Mark Brown9a3e1b82013-11-19 16:04:01 +00002314 int i, ret;
Mark Brown5c6af632012-07-09 19:09:41 +01002315
2316 wm5110 = devm_kzalloc(&pdev->dev, sizeof(struct wm5110_priv),
2317 GFP_KERNEL);
2318 if (wm5110 == NULL)
2319 return -ENOMEM;
2320 platform_set_drvdata(pdev, wm5110);
2321
2322 wm5110->core.arizona = arizona;
Mark Brownddbce972013-02-15 17:27:22 +00002323 wm5110->core.num_inputs = 8;
Mark Brown5c6af632012-07-09 19:09:41 +01002324
Mark Brown9a3e1b82013-11-19 16:04:01 +00002325 for (i = 0; i < WM5110_NUM_ADSP; i++) {
2326 wm5110->core.adsp[i].part = "wm5110";
2327 wm5110->core.adsp[i].num = i + 1;
2328 wm5110->core.adsp[i].type = WMFW_ADSP2;
2329 wm5110->core.adsp[i].dev = arizona->dev;
2330 wm5110->core.adsp[i].regmap = arizona->regmap;
2331
2332 wm5110->core.adsp[i].base = ARIZONA_DSP1_CONTROL_1
2333 + (0x100 * i);
2334 wm5110->core.adsp[i].mem = wm5110_dsp_regions[i];
2335 wm5110->core.adsp[i].num_mems
2336 = ARRAY_SIZE(wm5110_dsp1_regions);
2337
Richard Fitzgerald81ac58b2015-06-02 11:53:34 +01002338 ret = wm_adsp2_init(&wm5110->core.adsp[i]);
Mark Brown9a3e1b82013-11-19 16:04:01 +00002339 if (ret != 0)
2340 return ret;
2341 }
2342
Mark Brown5c6af632012-07-09 19:09:41 +01002343 for (i = 0; i < ARRAY_SIZE(wm5110->fll); i++)
2344 wm5110->fll[i].vco_mult = 3;
2345
2346 arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1,
2347 ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK,
2348 &wm5110->fll[0]);
2349 arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1,
2350 ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK,
2351 &wm5110->fll[1]);
2352
Charles Keepax0da2e5b2013-11-19 16:04:02 +00002353 /* SR2 fixed at 8kHz, SR3 fixed at 16kHz */
2354 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2,
2355 ARIZONA_SAMPLE_RATE_2_MASK, 0x11);
2356 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3,
2357 ARIZONA_SAMPLE_RATE_3_MASK, 0x12);
2358
Mark Brown5c6af632012-07-09 19:09:41 +01002359 for (i = 0; i < ARRAY_SIZE(wm5110_dai); i++)
2360 arizona_init_dai(&wm5110->core, i);
2361
2362 /* Latch volume update bits */
2363 for (i = 0; i < ARRAY_SIZE(wm5110_digital_vu); i++)
2364 regmap_update_bits(arizona->regmap, wm5110_digital_vu[i],
2365 WM5110_DIG_VU, WM5110_DIG_VU);
2366
2367 pm_runtime_enable(&pdev->dev);
2368 pm_runtime_idle(&pdev->dev);
2369
Charles Keepax1d981e02015-12-15 11:29:42 +00002370 ret = snd_soc_register_platform(&pdev->dev, &wm5110_compr_platform);
2371 if (ret < 0) {
2372 dev_err(&pdev->dev, "Failed to register platform: %d\n", ret);
2373 goto error;
2374 }
2375
2376 ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm5110,
Mark Brown5c6af632012-07-09 19:09:41 +01002377 wm5110_dai, ARRAY_SIZE(wm5110_dai));
Charles Keepax1d981e02015-12-15 11:29:42 +00002378 if (ret < 0) {
2379 dev_err(&pdev->dev, "Failed to register codec: %d\n", ret);
2380 snd_soc_unregister_platform(&pdev->dev);
2381 }
2382
2383error:
2384 return ret;
Mark Brown5c6af632012-07-09 19:09:41 +01002385}
2386
Bill Pemberton7a79e942012-12-07 09:26:37 -05002387static int wm5110_remove(struct platform_device *pdev)
Mark Brown5c6af632012-07-09 19:09:41 +01002388{
2389 snd_soc_unregister_codec(&pdev->dev);
2390 pm_runtime_disable(&pdev->dev);
2391
2392 return 0;
2393}
2394
2395static struct platform_driver wm5110_codec_driver = {
2396 .driver = {
2397 .name = "wm5110-codec",
Mark Brown5c6af632012-07-09 19:09:41 +01002398 },
2399 .probe = wm5110_probe,
Bill Pemberton7a79e942012-12-07 09:26:37 -05002400 .remove = wm5110_remove,
Mark Brown5c6af632012-07-09 19:09:41 +01002401};
2402
2403module_platform_driver(wm5110_codec_driver);
2404
2405MODULE_DESCRIPTION("ASoC WM5110 driver");
2406MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
2407MODULE_LICENSE("GPL");
2408MODULE_ALIAS("platform:wm5110-codec");