Version:  2.0.40 2.2.26 2.4.37 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 4.0 4.1 4.2 4.3 4.4 4.5

Linux/sound/soc/codecs/wm5110.c

  1 /*
  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"
 33 #include "wm_adsp.h"
 34 #include "wm5110.h"
 35 
 36 #define WM5110_NUM_ADSP 4
 37 
 38 struct wm5110_priv {
 39         struct arizona_priv core;
 40         struct arizona_fll fll[2];
 41 
 42         unsigned int in_value;
 43         int in_pre_pending;
 44         int in_post_pending;
 45 
 46         unsigned int in_pga_cache[6];
 47 };
 48 
 49 static 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 
 56 static 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 
 63 static 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 
 70 static 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 
 77 static 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 
 84 static const struct reg_default wm5110_sysclk_revd_patch[] = {
 85         { 0x3093, 0x1001 },
 86         { 0x30E3, 0x1301 },
 87         { 0x3133, 0x1201 },
 88         { 0x3183, 0x1501 },
 89         { 0x31D3, 0x1401 },
 90         { 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 },
138 };
139 
140 static 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 
159 static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w,
160                             struct snd_kcontrol *kcontrol, int event)
161 {
162         struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
163         struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
164         struct regmap *regmap = arizona->regmap;
165         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:
174                 patch = wm5110_sysclk_reve_patch;
175                 patch_size = ARRAY_SIZE(wm5110_sysclk_reve_patch);
176                 break;
177         }
178 
179         switch (event) {
180         case SND_SOC_DAPM_POST_PMU:
181                 if (patch)
182                         for (i = 0; i < patch_size; i++)
183                                 regmap_write_async(regmap, patch[i].reg,
184                                                    patch[i].def);
185                 break;
186 
187         default:
188                 break;
189         }
190 
191         return 0;
192 }
193 
194 static const struct reg_sequence wm5110_no_dre_left_enable[] = {
195         { 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 
212 static const struct reg_sequence wm5110_dre_left_enable[] = {
213         { 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 
230 static const struct reg_sequence wm5110_no_dre_right_enable[] = {
231         { 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 
248 static const struct reg_sequence wm5110_dre_right_enable[] = {
249         { 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 
266 static 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);
272         const struct reg_sequence *wseq;
273         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 
303 static 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 
335 static 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 
361 static int wm5110_clear_pga_volume(struct arizona *arizona, int output)
362 {
363         unsigned int reg = ARIZONA_OUTPUT_PATH_CONFIG_1L + output * 4;
364         int ret;
365 
366         ret = regmap_write(arizona->regmap, reg, 0x80);
367         if (ret)
368                 dev_err(arizona->dev, "Failed to clear PGA (0x%x): %d\n",
369                         reg, ret);
370 
371         return ret;
372 }
373 
374 static int wm5110_put_dre(struct snd_kcontrol *kcontrol,
375                           struct snd_ctl_elem_value *ucontrol)
376 {
377         struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
378         struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
379         struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
380         struct soc_mixer_control *mc =
381                 (struct soc_mixer_control *)kcontrol->private_value;
382         unsigned int ena, dre;
383         unsigned int mask = (0x1 << mc->shift) | (0x1 << mc->rshift);
384         unsigned int lnew = (!!ucontrol->value.integer.value[0]) << mc->shift;
385         unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift;
386         unsigned int lold, rold;
387         unsigned int lena, rena;
388         int ret;
389 
390         snd_soc_dapm_mutex_lock(dapm);
391 
392         ret = regmap_read(arizona->regmap, ARIZONA_OUTPUT_ENABLES_1, &ena);
393         if (ret) {
394                 dev_err(arizona->dev, "Failed to read output state: %d\n", ret);
395                 goto err;
396         }
397         ret = regmap_read(arizona->regmap, ARIZONA_DRE_ENABLE, &dre);
398         if (ret) {
399                 dev_err(arizona->dev, "Failed to read DRE state: %d\n", ret);
400                 goto err;
401         }
402 
403         lold = dre & (1 << mc->shift);
404         rold = dre & (1 << mc->rshift);
405         /* Enables are channel wise swapped from the DRE enables */
406         lena = ena & (1 << mc->rshift);
407         rena = ena & (1 << mc->shift);
408 
409         if ((lena && lnew != lold) || (rena && rnew != rold)) {
410                 dev_err(arizona->dev, "Can't change DRE on active outputs\n");
411                 ret = -EBUSY;
412                 goto err;
413         }
414 
415         ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE,
416                                  mask, lnew | rnew);
417         if (ret) {
418                 dev_err(arizona->dev, "Failed to set DRE: %d\n", ret);
419                 goto err;
420         }
421 
422         /* Force reset of PGA volumes, if turning DRE off */
423         if (!lnew && lold)
424                 wm5110_clear_pga_volume(arizona, mc->shift);
425 
426         if (!rnew && rold)
427                 wm5110_clear_pga_volume(arizona, mc->rshift);
428 
429 err:
430         snd_soc_dapm_mutex_unlock(dapm);
431 
432         return ret;
433 }
434 
435 static int wm5110_in_pga_get(struct snd_kcontrol *kcontrol,
436                              struct snd_ctl_elem_value *ucontrol)
437 {
438         struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
439         struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
440         int ret;
441 
442         /*
443          * PGA Volume is also used as part of the enable sequence, so
444          * usage of it should be avoided whilst that is running.
445          */
446         snd_soc_dapm_mutex_lock(dapm);
447 
448         ret = snd_soc_get_volsw_range(kcontrol, ucontrol);
449 
450         snd_soc_dapm_mutex_unlock(dapm);
451 
452         return ret;
453 }
454 
455 static int wm5110_in_pga_put(struct snd_kcontrol *kcontrol,
456                              struct snd_ctl_elem_value *ucontrol)
457 {
458         struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
459         struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
460         int ret;
461 
462         /*
463          * PGA Volume is also used as part of the enable sequence, so
464          * usage of it should be avoided whilst that is running.
465          */
466         snd_soc_dapm_mutex_lock(dapm);
467 
468         ret = snd_soc_put_volsw_range(kcontrol, ucontrol);
469 
470         snd_soc_dapm_mutex_unlock(dapm);
471 
472         return ret;
473 }
474 
475 static int wm5110_in_analog_ev(struct snd_soc_dapm_widget *w,
476                                struct snd_kcontrol *kcontrol, int event)
477 {
478         struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
479         struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
480         struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec);
481         struct arizona *arizona = priv->arizona;
482         unsigned int reg, mask;
483         struct reg_sequence analog_seq[] = {
484                 { 0x80, 0x3 },
485                 { 0x35d, 0 },
486                 { 0x80, 0x0 },
487         };
488 
489         reg = ARIZONA_IN1L_CONTROL + ((w->shift ^ 0x1) * 4);
490         mask = ARIZONA_IN1L_PGA_VOL_MASK;
491 
492         switch (event) {
493         case SND_SOC_DAPM_WILL_PMU:
494                 wm5110->in_value |= 0x3 << ((w->shift ^ 0x1) * 2);
495                 wm5110->in_pre_pending++;
496                 wm5110->in_post_pending++;
497                 return 0;
498         case SND_SOC_DAPM_PRE_PMU:
499                 wm5110->in_pga_cache[w->shift] = snd_soc_read(codec, reg);
500 
501                 snd_soc_update_bits(codec, reg, mask,
502                                     0x40 << ARIZONA_IN1L_PGA_VOL_SHIFT);
503 
504                 wm5110->in_pre_pending--;
505                 if (wm5110->in_pre_pending == 0) {
506                         analog_seq[1].def = wm5110->in_value;
507                         regmap_multi_reg_write_bypassed(arizona->regmap,
508                                                         analog_seq,
509                                                         ARRAY_SIZE(analog_seq));
510 
511                         msleep(55);
512 
513                         wm5110->in_value = 0;
514                 }
515 
516                 break;
517         case SND_SOC_DAPM_POST_PMU:
518                 snd_soc_update_bits(codec, reg, mask,
519                                     wm5110->in_pga_cache[w->shift]);
520 
521                 wm5110->in_post_pending--;
522                 if (wm5110->in_post_pending == 0)
523                         regmap_multi_reg_write_bypassed(arizona->regmap,
524                                                         analog_seq,
525                                                         ARRAY_SIZE(analog_seq));
526                 break;
527         default:
528                 break;
529         }
530 
531         return 0;
532 }
533 
534 static int wm5110_in_ev(struct snd_soc_dapm_widget *w,
535                         struct snd_kcontrol *kcontrol, int event)
536 {
537         struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
538         struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
539         struct arizona *arizona = priv->arizona;
540 
541         switch (arizona->rev) {
542         case 0 ... 4:
543                 if (arizona_input_analog(codec, w->shift))
544                         wm5110_in_analog_ev(w, kcontrol, event);
545 
546                 break;
547         default:
548                 break;
549         }
550 
551         return arizona_in_ev(w, kcontrol, event);
552 }
553 
554 static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
555 static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
556 static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
557 static DECLARE_TLV_DB_SCALE(noise_tlv, -13200, 600, 0);
558 static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
559 
560 #define WM5110_NG_SRC(name, base) \
561         SOC_SINGLE(name " NG HPOUT1L Switch",  base,  0, 1, 0), \
562         SOC_SINGLE(name " NG HPOUT1R Switch",  base,  1, 1, 0), \
563         SOC_SINGLE(name " NG HPOUT2L Switch",  base,  2, 1, 0), \
564         SOC_SINGLE(name " NG HPOUT2R Switch",  base,  3, 1, 0), \
565         SOC_SINGLE(name " NG HPOUT3L Switch",  base,  4, 1, 0), \
566         SOC_SINGLE(name " NG HPOUT3R Switch",  base,  5, 1, 0), \
567         SOC_SINGLE(name " NG SPKOUTL Switch",  base,  6, 1, 0), \
568         SOC_SINGLE(name " NG SPKOUTR Switch",  base,  7, 1, 0), \
569         SOC_SINGLE(name " NG SPKDAT1L Switch", base,  8, 1, 0), \
570         SOC_SINGLE(name " NG SPKDAT1R Switch", base,  9, 1, 0), \
571         SOC_SINGLE(name " NG SPKDAT2L Switch", base, 10, 1, 0), \
572         SOC_SINGLE(name " NG SPKDAT2R Switch", base, 11, 1, 0)
573 
574 #define WM5110_RXANC_INPUT_ROUTES(widget, name) \
575         { widget, NULL, name " NG Mux" }, \
576         { name " NG Internal", NULL, "RXANC NG Clock" }, \
577         { name " NG Internal", NULL, name " Channel" }, \
578         { name " NG External", NULL, "RXANC NG External Clock" }, \
579         { name " NG External", NULL, name " Channel" }, \
580         { name " NG Mux", "None", name " Channel" }, \
581         { name " NG Mux", "Internal", name " NG Internal" }, \
582         { name " NG Mux", "External", name " NG External" }, \
583         { name " Channel", "Left", name " Left Input" }, \
584         { name " Channel", "Combine", name " Left Input" }, \
585         { name " Channel", "Right", name " Right Input" }, \
586         { name " Channel", "Combine", name " Right Input" }, \
587         { name " Left Input", "IN1", "IN1L PGA" }, \
588         { name " Right Input", "IN1", "IN1R PGA" }, \
589         { name " Left Input", "IN2", "IN2L PGA" }, \
590         { name " Right Input", "IN2", "IN2R PGA" }, \
591         { name " Left Input", "IN3", "IN3L PGA" }, \
592         { name " Right Input", "IN3", "IN3R PGA" }, \
593         { name " Left Input", "IN4", "IN4L PGA" }, \
594         { name " Right Input", "IN4", "IN4R PGA" }
595 
596 #define WM5110_RXANC_OUTPUT_ROUTES(widget, name) \
597         { widget, NULL, name " ANC Source" }, \
598         { name " ANC Source", "RXANCL", "RXANCL" }, \
599         { name " ANC Source", "RXANCR", "RXANCR" }
600 
601 static const struct snd_kcontrol_new wm5110_snd_controls[] = {
602 SOC_ENUM("IN1 OSR", arizona_in_dmic_osr[0]),
603 SOC_ENUM("IN2 OSR", arizona_in_dmic_osr[1]),
604 SOC_ENUM("IN3 OSR", arizona_in_dmic_osr[2]),
605 SOC_ENUM("IN4 OSR", arizona_in_dmic_osr[3]),
606 
607 SOC_SINGLE_RANGE_EXT_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL,
608                          ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
609                          wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
610 SOC_SINGLE_RANGE_EXT_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL,
611                          ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
612                          wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
613 SOC_SINGLE_RANGE_EXT_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL,
614                          ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
615                          wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
616 SOC_SINGLE_RANGE_EXT_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL,
617                          ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
618                          wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
619 SOC_SINGLE_RANGE_EXT_TLV("IN3L Volume", ARIZONA_IN3L_CONTROL,
620                          ARIZONA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
621                          wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
622 SOC_SINGLE_RANGE_EXT_TLV("IN3R Volume", ARIZONA_IN3R_CONTROL,
623                          ARIZONA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0,
624                          wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv),
625 
626 SOC_ENUM("IN HPF Cutoff Frequency", arizona_in_hpf_cut_enum),
627 
628 SOC_SINGLE("IN1L HPF Switch", ARIZONA_IN1L_CONTROL,
629            ARIZONA_IN1L_HPF_SHIFT, 1, 0),
630 SOC_SINGLE("IN1R HPF Switch", ARIZONA_IN1R_CONTROL,
631            ARIZONA_IN1R_HPF_SHIFT, 1, 0),
632 SOC_SINGLE("IN2L HPF Switch", ARIZONA_IN2L_CONTROL,
633            ARIZONA_IN2L_HPF_SHIFT, 1, 0),
634 SOC_SINGLE("IN2R HPF Switch", ARIZONA_IN2R_CONTROL,
635            ARIZONA_IN2R_HPF_SHIFT, 1, 0),
636 SOC_SINGLE("IN3L HPF Switch", ARIZONA_IN3L_CONTROL,
637            ARIZONA_IN3L_HPF_SHIFT, 1, 0),
638 SOC_SINGLE("IN3R HPF Switch", ARIZONA_IN3R_CONTROL,
639            ARIZONA_IN3R_HPF_SHIFT, 1, 0),
640 SOC_SINGLE("IN4L HPF Switch", ARIZONA_IN4L_CONTROL,
641            ARIZONA_IN4L_HPF_SHIFT, 1, 0),
642 SOC_SINGLE("IN4R HPF Switch", ARIZONA_IN4R_CONTROL,
643            ARIZONA_IN4R_HPF_SHIFT, 1, 0),
644 
645 SOC_SINGLE_TLV("IN1L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1L,
646                ARIZONA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
647 SOC_SINGLE_TLV("IN1R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1R,
648                ARIZONA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
649 SOC_SINGLE_TLV("IN2L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2L,
650                ARIZONA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
651 SOC_SINGLE_TLV("IN2R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2R,
652                ARIZONA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
653 SOC_SINGLE_TLV("IN3L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3L,
654                ARIZONA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
655 SOC_SINGLE_TLV("IN3R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3R,
656                ARIZONA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
657 SOC_SINGLE_TLV("IN4L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4L,
658                ARIZONA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
659 SOC_SINGLE_TLV("IN4R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4R,
660                ARIZONA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
661 
662 SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp),
663 SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp),
664 
665 SND_SOC_BYTES("RXANC Coefficients", ARIZONA_ANC_COEFF_START,
666               ARIZONA_ANC_COEFF_END - ARIZONA_ANC_COEFF_START + 1),
667 SND_SOC_BYTES("RXANCL Config", ARIZONA_FCL_FILTER_CONTROL, 1),
668 SND_SOC_BYTES("RXANCL Coefficients", ARIZONA_FCL_COEFF_START,
669               ARIZONA_FCL_COEFF_END - ARIZONA_FCL_COEFF_START + 1),
670 SND_SOC_BYTES("RXANCR Config", ARIZONA_FCR_FILTER_CONTROL, 1),
671 SND_SOC_BYTES("RXANCR Coefficients", ARIZONA_FCR_COEFF_START,
672               ARIZONA_FCR_COEFF_END - ARIZONA_FCR_COEFF_START + 1),
673 
674 ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE),
675 ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
676 ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
677 ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
678 
679 ARIZONA_EQ_CONTROL("EQ1 Coefficients", ARIZONA_EQ1_2),
680 SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
681                24, 0, eq_tlv),
682 SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT,
683                24, 0, eq_tlv),
684 SOC_SINGLE_TLV("EQ1 B3 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B3_GAIN_SHIFT,
685                24, 0, eq_tlv),
686 SOC_SINGLE_TLV("EQ1 B4 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B4_GAIN_SHIFT,
687                24, 0, eq_tlv),
688 SOC_SINGLE_TLV("EQ1 B5 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B5_GAIN_SHIFT,
689                24, 0, eq_tlv),
690 
691 ARIZONA_EQ_CONTROL("EQ2 Coefficients", ARIZONA_EQ2_2),
692 SOC_SINGLE_TLV("EQ2 B1 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B1_GAIN_SHIFT,
693                24, 0, eq_tlv),
694 SOC_SINGLE_TLV("EQ2 B2 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B2_GAIN_SHIFT,
695                24, 0, eq_tlv),
696 SOC_SINGLE_TLV("EQ2 B3 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B3_GAIN_SHIFT,
697                24, 0, eq_tlv),
698 SOC_SINGLE_TLV("EQ2 B4 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B4_GAIN_SHIFT,
699                24, 0, eq_tlv),
700 SOC_SINGLE_TLV("EQ2 B5 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B5_GAIN_SHIFT,
701                24, 0, eq_tlv),
702 
703 ARIZONA_EQ_CONTROL("EQ3 Coefficients", ARIZONA_EQ3_2),
704 SOC_SINGLE_TLV("EQ3 B1 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B1_GAIN_SHIFT,
705                24, 0, eq_tlv),
706 SOC_SINGLE_TLV("EQ3 B2 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B2_GAIN_SHIFT,
707                24, 0, eq_tlv),
708 SOC_SINGLE_TLV("EQ3 B3 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B3_GAIN_SHIFT,
709                24, 0, eq_tlv),
710 SOC_SINGLE_TLV("EQ3 B4 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B4_GAIN_SHIFT,
711                24, 0, eq_tlv),
712 SOC_SINGLE_TLV("EQ3 B5 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B5_GAIN_SHIFT,
713                24, 0, eq_tlv),
714 
715 ARIZONA_EQ_CONTROL("EQ4 Coefficients", ARIZONA_EQ4_2),
716 SOC_SINGLE_TLV("EQ4 B1 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B1_GAIN_SHIFT,
717                24, 0, eq_tlv),
718 SOC_SINGLE_TLV("EQ4 B2 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B2_GAIN_SHIFT,
719                24, 0, eq_tlv),
720 SOC_SINGLE_TLV("EQ4 B3 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B3_GAIN_SHIFT,
721                24, 0, eq_tlv),
722 SOC_SINGLE_TLV("EQ4 B4 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B4_GAIN_SHIFT,
723                24, 0, eq_tlv),
724 SOC_SINGLE_TLV("EQ4 B5 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B5_GAIN_SHIFT,
725                24, 0, eq_tlv),
726 
727 ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE),
728 ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE),
729 ARIZONA_MIXER_CONTROLS("DRC2L", ARIZONA_DRC2LMIX_INPUT_1_SOURCE),
730 ARIZONA_MIXER_CONTROLS("DRC2R", ARIZONA_DRC2RMIX_INPUT_1_SOURCE),
731 
732 SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5,
733                    ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA),
734 SND_SOC_BYTES_MASK("DRC2", ARIZONA_DRC2_CTRL1, 5,
735                    ARIZONA_DRC2R_ENA | ARIZONA_DRC2L_ENA),
736 
737 ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE),
738 ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE),
739 ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE),
740 ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE),
741 
742 ARIZONA_LHPF_CONTROL("LHPF1 Coefficients", ARIZONA_HPLPF1_2),
743 ARIZONA_LHPF_CONTROL("LHPF2 Coefficients", ARIZONA_HPLPF2_2),
744 ARIZONA_LHPF_CONTROL("LHPF3 Coefficients", ARIZONA_HPLPF3_2),
745 ARIZONA_LHPF_CONTROL("LHPF4 Coefficients", ARIZONA_HPLPF4_2),
746 
747 SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode),
748 SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode),
749 SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode),
750 SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode),
751 
752 SOC_ENUM("ISRC1 FSL", arizona_isrc_fsl[0]),
753 SOC_ENUM("ISRC2 FSL", arizona_isrc_fsl[1]),
754 SOC_ENUM("ISRC3 FSL", arizona_isrc_fsl[2]),
755 SOC_ENUM("ISRC1 FSH", arizona_isrc_fsh[0]),
756 SOC_ENUM("ISRC2 FSH", arizona_isrc_fsh[1]),
757 SOC_ENUM("ISRC3 FSH", arizona_isrc_fsh[2]),
758 SOC_ENUM("ASRC RATE 1", arizona_asrc_rate1),
759 
760 ARIZONA_MIXER_CONTROLS("DSP1L", ARIZONA_DSP1LMIX_INPUT_1_SOURCE),
761 ARIZONA_MIXER_CONTROLS("DSP1R", ARIZONA_DSP1RMIX_INPUT_1_SOURCE),
762 ARIZONA_MIXER_CONTROLS("DSP2L", ARIZONA_DSP2LMIX_INPUT_1_SOURCE),
763 ARIZONA_MIXER_CONTROLS("DSP2R", ARIZONA_DSP2RMIX_INPUT_1_SOURCE),
764 ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE),
765 ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE),
766 ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE),
767 ARIZONA_MIXER_CONTROLS("DSP4R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE),
768 
769 ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE),
770 ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE),
771 
772 SOC_SINGLE_TLV("Noise Generator Volume", ARIZONA_COMFORT_NOISE_GENERATOR,
773                ARIZONA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, noise_tlv),
774 
775 ARIZONA_MIXER_CONTROLS("HPOUT1L", ARIZONA_OUT1LMIX_INPUT_1_SOURCE),
776 ARIZONA_MIXER_CONTROLS("HPOUT1R", ARIZONA_OUT1RMIX_INPUT_1_SOURCE),
777 ARIZONA_MIXER_CONTROLS("HPOUT2L", ARIZONA_OUT2LMIX_INPUT_1_SOURCE),
778 ARIZONA_MIXER_CONTROLS("HPOUT2R", ARIZONA_OUT2RMIX_INPUT_1_SOURCE),
779 ARIZONA_MIXER_CONTROLS("HPOUT3L", ARIZONA_OUT3LMIX_INPUT_1_SOURCE),
780 ARIZONA_MIXER_CONTROLS("HPOUT3R", ARIZONA_OUT3RMIX_INPUT_1_SOURCE),
781 ARIZONA_MIXER_CONTROLS("SPKOUTL", ARIZONA_OUT4LMIX_INPUT_1_SOURCE),
782 ARIZONA_MIXER_CONTROLS("SPKOUTR", ARIZONA_OUT4RMIX_INPUT_1_SOURCE),
783 ARIZONA_MIXER_CONTROLS("SPKDAT1L", ARIZONA_OUT5LMIX_INPUT_1_SOURCE),
784 ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE),
785 ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE),
786 ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE),
787 
788 SOC_SINGLE("HPOUT1 SC Protect Switch", ARIZONA_HP1_SHORT_CIRCUIT_CTRL,
789            ARIZONA_HP1_SC_ENA_SHIFT, 1, 0),
790 SOC_SINGLE("HPOUT2 SC Protect Switch", ARIZONA_HP2_SHORT_CIRCUIT_CTRL,
791            ARIZONA_HP2_SC_ENA_SHIFT, 1, 0),
792 SOC_SINGLE("HPOUT3 SC Protect Switch", ARIZONA_HP3_SHORT_CIRCUIT_CTRL,
793            ARIZONA_HP3_SC_ENA_SHIFT, 1, 0),
794 
795 SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L,
796            ARIZONA_OUT5_OSR_SHIFT, 1, 0),
797 SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L,
798            ARIZONA_OUT6_OSR_SHIFT, 1, 0),
799 
800 SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L,
801              ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1),
802 SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L,
803              ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1),
804 SOC_DOUBLE_R("HPOUT3 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L,
805              ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_MUTE_SHIFT, 1, 1),
806 SOC_DOUBLE_R("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L,
807              ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_MUTE_SHIFT, 1, 1),
808 SOC_DOUBLE_R("SPKDAT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_5L,
809              ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_MUTE_SHIFT, 1, 1),
810 SOC_DOUBLE_R("SPKDAT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_6L,
811              ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_MUTE_SHIFT, 1, 1),
812 
813 SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L,
814                  ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT,
815                  0xbf, 0, digital_tlv),
816 SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L,
817                  ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT,
818                  0xbf, 0, digital_tlv),
819 SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L,
820                  ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_VOL_SHIFT,
821                  0xbf, 0, digital_tlv),
822 SOC_DOUBLE_R_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L,
823                  ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_VOL_SHIFT,
824                  0xbf, 0, digital_tlv),
825 SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_5L,
826                  ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_VOL_SHIFT,
827                  0xbf, 0, digital_tlv),
828 SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_6L,
829                  ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT,
830                  0xbf, 0, digital_tlv),
831 
832 SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT,
833            ARIZONA_SPK1R_MUTE_SHIFT, 1, 1),
834 SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT,
835            ARIZONA_SPK2R_MUTE_SHIFT, 1, 1),
836 
837 SOC_DOUBLE_EXT("HPOUT1 DRE Switch", ARIZONA_DRE_ENABLE,
838            ARIZONA_DRE1L_ENA_SHIFT, ARIZONA_DRE1R_ENA_SHIFT, 1, 0,
839            snd_soc_get_volsw, wm5110_put_dre),
840 SOC_DOUBLE_EXT("HPOUT2 DRE Switch", ARIZONA_DRE_ENABLE,
841            ARIZONA_DRE2L_ENA_SHIFT, ARIZONA_DRE2R_ENA_SHIFT, 1, 0,
842            snd_soc_get_volsw, wm5110_put_dre),
843 SOC_DOUBLE_EXT("HPOUT3 DRE Switch", ARIZONA_DRE_ENABLE,
844            ARIZONA_DRE3L_ENA_SHIFT, ARIZONA_DRE3R_ENA_SHIFT, 1, 0,
845            snd_soc_get_volsw, wm5110_put_dre),
846 
847 SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp),
848 SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp),
849 
850 SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL,
851            ARIZONA_NGATE_ENA_SHIFT, 1, 0),
852 SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL,
853                ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv),
854 SOC_ENUM("Noise Gate Hold", arizona_ng_hold),
855 
856 WM5110_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L),
857 WM5110_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R),
858 WM5110_NG_SRC("HPOUT2L", ARIZONA_NOISE_GATE_SELECT_2L),
859 WM5110_NG_SRC("HPOUT2R", ARIZONA_NOISE_GATE_SELECT_2R),
860 WM5110_NG_SRC("HPOUT3L", ARIZONA_NOISE_GATE_SELECT_3L),
861 WM5110_NG_SRC("HPOUT3R", ARIZONA_NOISE_GATE_SELECT_3R),
862 WM5110_NG_SRC("SPKOUTL", ARIZONA_NOISE_GATE_SELECT_4L),
863 WM5110_NG_SRC("SPKOUTR", ARIZONA_NOISE_GATE_SELECT_4R),
864 WM5110_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L),
865 WM5110_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R),
866 WM5110_NG_SRC("SPKDAT2L", ARIZONA_NOISE_GATE_SELECT_6L),
867 WM5110_NG_SRC("SPKDAT2R", ARIZONA_NOISE_GATE_SELECT_6R),
868 
869 ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE),
870 ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE),
871 ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE),
872 ARIZONA_MIXER_CONTROLS("AIF1TX4", ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE),
873 ARIZONA_MIXER_CONTROLS("AIF1TX5", ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE),
874 ARIZONA_MIXER_CONTROLS("AIF1TX6", ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE),
875 ARIZONA_MIXER_CONTROLS("AIF1TX7", ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE),
876 ARIZONA_MIXER_CONTROLS("AIF1TX8", ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE),
877 
878 ARIZONA_MIXER_CONTROLS("AIF2TX1", ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE),
879 ARIZONA_MIXER_CONTROLS("AIF2TX2", ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE),
880 ARIZONA_MIXER_CONTROLS("AIF2TX3", ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE),
881 ARIZONA_MIXER_CONTROLS("AIF2TX4", ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE),
882 ARIZONA_MIXER_CONTROLS("AIF2TX5", ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE),
883 ARIZONA_MIXER_CONTROLS("AIF2TX6", ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE),
884 
885 ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE),
886 ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE),
887 
888 ARIZONA_MIXER_CONTROLS("SLIMTX1", ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE),
889 ARIZONA_MIXER_CONTROLS("SLIMTX2", ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE),
890 ARIZONA_MIXER_CONTROLS("SLIMTX3", ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE),
891 ARIZONA_MIXER_CONTROLS("SLIMTX4", ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE),
892 ARIZONA_MIXER_CONTROLS("SLIMTX5", ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE),
893 ARIZONA_MIXER_CONTROLS("SLIMTX6", ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE),
894 ARIZONA_MIXER_CONTROLS("SLIMTX7", ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE),
895 ARIZONA_MIXER_CONTROLS("SLIMTX8", ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE),
896 };
897 
898 ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE);
899 ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE);
900 ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE);
901 ARIZONA_MIXER_ENUMS(EQ4, ARIZONA_EQ4MIX_INPUT_1_SOURCE);
902 
903 ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE);
904 ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE);
905 ARIZONA_MIXER_ENUMS(DRC2L, ARIZONA_DRC2LMIX_INPUT_1_SOURCE);
906 ARIZONA_MIXER_ENUMS(DRC2R, ARIZONA_DRC2RMIX_INPUT_1_SOURCE);
907 
908 ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE);
909 ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE);
910 ARIZONA_MIXER_ENUMS(LHPF3, ARIZONA_HPLP3MIX_INPUT_1_SOURCE);
911 ARIZONA_MIXER_ENUMS(LHPF4, ARIZONA_HPLP4MIX_INPUT_1_SOURCE);
912 
913 ARIZONA_MIXER_ENUMS(DSP1L, ARIZONA_DSP1LMIX_INPUT_1_SOURCE);
914 ARIZONA_MIXER_ENUMS(DSP1R, ARIZONA_DSP1RMIX_INPUT_1_SOURCE);
915 ARIZONA_DSP_AUX_ENUMS(DSP1, ARIZONA_DSP1AUX1MIX_INPUT_1_SOURCE);
916 
917 ARIZONA_MIXER_ENUMS(DSP2L, ARIZONA_DSP2LMIX_INPUT_1_SOURCE);
918 ARIZONA_MIXER_ENUMS(DSP2R, ARIZONA_DSP2RMIX_INPUT_1_SOURCE);
919 ARIZONA_DSP_AUX_ENUMS(DSP2, ARIZONA_DSP2AUX1MIX_INPUT_1_SOURCE);
920 
921 ARIZONA_MIXER_ENUMS(DSP3L, ARIZONA_DSP3LMIX_INPUT_1_SOURCE);
922 ARIZONA_MIXER_ENUMS(DSP3R, ARIZONA_DSP3RMIX_INPUT_1_SOURCE);
923 ARIZONA_DSP_AUX_ENUMS(DSP3, ARIZONA_DSP3AUX1MIX_INPUT_1_SOURCE);
924 
925 ARIZONA_MIXER_ENUMS(DSP4L, ARIZONA_DSP4LMIX_INPUT_1_SOURCE);
926 ARIZONA_MIXER_ENUMS(DSP4R, ARIZONA_DSP4RMIX_INPUT_1_SOURCE);
927 ARIZONA_DSP_AUX_ENUMS(DSP4, ARIZONA_DSP4AUX1MIX_INPUT_1_SOURCE);
928 
929 ARIZONA_MIXER_ENUMS(Mic, ARIZONA_MICMIX_INPUT_1_SOURCE);
930 ARIZONA_MIXER_ENUMS(Noise, ARIZONA_NOISEMIX_INPUT_1_SOURCE);
931 
932 ARIZONA_MIXER_ENUMS(PWM1, ARIZONA_PWM1MIX_INPUT_1_SOURCE);
933 ARIZONA_MIXER_ENUMS(PWM2, ARIZONA_PWM2MIX_INPUT_1_SOURCE);
934 
935 ARIZONA_MIXER_ENUMS(OUT1L, ARIZONA_OUT1LMIX_INPUT_1_SOURCE);
936 ARIZONA_MIXER_ENUMS(OUT1R, ARIZONA_OUT1RMIX_INPUT_1_SOURCE);
937 ARIZONA_MIXER_ENUMS(OUT2L, ARIZONA_OUT2LMIX_INPUT_1_SOURCE);
938 ARIZONA_MIXER_ENUMS(OUT2R, ARIZONA_OUT2RMIX_INPUT_1_SOURCE);
939 ARIZONA_MIXER_ENUMS(OUT3L, ARIZONA_OUT3LMIX_INPUT_1_SOURCE);
940 ARIZONA_MIXER_ENUMS(OUT3R, ARIZONA_OUT3RMIX_INPUT_1_SOURCE);
941 ARIZONA_MIXER_ENUMS(SPKOUTL, ARIZONA_OUT4LMIX_INPUT_1_SOURCE);
942 ARIZONA_MIXER_ENUMS(SPKOUTR, ARIZONA_OUT4RMIX_INPUT_1_SOURCE);
943 ARIZONA_MIXER_ENUMS(SPKDAT1L, ARIZONA_OUT5LMIX_INPUT_1_SOURCE);
944 ARIZONA_MIXER_ENUMS(SPKDAT1R, ARIZONA_OUT5RMIX_INPUT_1_SOURCE);
945 ARIZONA_MIXER_ENUMS(SPKDAT2L, ARIZONA_OUT6LMIX_INPUT_1_SOURCE);
946 ARIZONA_MIXER_ENUMS(SPKDAT2R, ARIZONA_OUT6RMIX_INPUT_1_SOURCE);
947 
948 ARIZONA_MIXER_ENUMS(AIF1TX1, ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE);
949 ARIZONA_MIXER_ENUMS(AIF1TX2, ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE);
950 ARIZONA_MIXER_ENUMS(AIF1TX3, ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE);
951 ARIZONA_MIXER_ENUMS(AIF1TX4, ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE);
952 ARIZONA_MIXER_ENUMS(AIF1TX5, ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE);
953 ARIZONA_MIXER_ENUMS(AIF1TX6, ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE);
954 ARIZONA_MIXER_ENUMS(AIF1TX7, ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE);
955 ARIZONA_MIXER_ENUMS(AIF1TX8, ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE);
956 
957 ARIZONA_MIXER_ENUMS(AIF2TX1, ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE);
958 ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE);
959 ARIZONA_MIXER_ENUMS(AIF2TX3, ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE);
960 ARIZONA_MIXER_ENUMS(AIF2TX4, ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE);
961 ARIZONA_MIXER_ENUMS(AIF2TX5, ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE);
962 ARIZONA_MIXER_ENUMS(AIF2TX6, ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE);
963 
964 ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE);
965 ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE);
966 
967 ARIZONA_MIXER_ENUMS(SLIMTX1, ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE);
968 ARIZONA_MIXER_ENUMS(SLIMTX2, ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE);
969 ARIZONA_MIXER_ENUMS(SLIMTX3, ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE);
970 ARIZONA_MIXER_ENUMS(SLIMTX4, ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE);
971 ARIZONA_MIXER_ENUMS(SLIMTX5, ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE);
972 ARIZONA_MIXER_ENUMS(SLIMTX6, ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE);
973 ARIZONA_MIXER_ENUMS(SLIMTX7, ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE);
974 ARIZONA_MIXER_ENUMS(SLIMTX8, ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE);
975 
976 ARIZONA_MUX_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE);
977 ARIZONA_MUX_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE);
978 ARIZONA_MUX_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE);
979 ARIZONA_MUX_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE);
980 
981 ARIZONA_MUX_ENUMS(ISRC1INT1, ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE);
982 ARIZONA_MUX_ENUMS(ISRC1INT2, ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE);
983 ARIZONA_MUX_ENUMS(ISRC1INT3, ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE);
984 ARIZONA_MUX_ENUMS(ISRC1INT4, ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE);
985 
986 ARIZONA_MUX_ENUMS(ISRC1DEC1, ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE);
987 ARIZONA_MUX_ENUMS(ISRC1DEC2, ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE);
988 ARIZONA_MUX_ENUMS(ISRC1DEC3, ARIZONA_ISRC1DEC3MIX_INPUT_1_SOURCE);
989 ARIZONA_MUX_ENUMS(ISRC1DEC4, ARIZONA_ISRC1DEC4MIX_INPUT_1_SOURCE);
990 
991 ARIZONA_MUX_ENUMS(ISRC2INT1, ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE);
992 ARIZONA_MUX_ENUMS(ISRC2INT2, ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE);
993 ARIZONA_MUX_ENUMS(ISRC2INT3, ARIZONA_ISRC2INT3MIX_INPUT_1_SOURCE);
994 ARIZONA_MUX_ENUMS(ISRC2INT4, ARIZONA_ISRC2INT4MIX_INPUT_1_SOURCE);
995 
996 ARIZONA_MUX_ENUMS(ISRC2DEC1, ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE);
997 ARIZONA_MUX_ENUMS(ISRC2DEC2, ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE);
998 ARIZONA_MUX_ENUMS(ISRC2DEC3, ARIZONA_ISRC2DEC3MIX_INPUT_1_SOURCE);
999 ARIZONA_MUX_ENUMS(ISRC2DEC4, ARIZONA_ISRC2DEC4MIX_INPUT_1_SOURCE);
1000 
1001 ARIZONA_MUX_ENUMS(ISRC3INT1, ARIZONA_ISRC3INT1MIX_INPUT_1_SOURCE);
1002 ARIZONA_MUX_ENUMS(ISRC3INT2, ARIZONA_ISRC3INT2MIX_INPUT_1_SOURCE);
1003 ARIZONA_MUX_ENUMS(ISRC3INT3, ARIZONA_ISRC3INT3MIX_INPUT_1_SOURCE);
1004 ARIZONA_MUX_ENUMS(ISRC3INT4, ARIZONA_ISRC3INT4MIX_INPUT_1_SOURCE);
1005 
1006 ARIZONA_MUX_ENUMS(ISRC3DEC1, ARIZONA_ISRC3DEC1MIX_INPUT_1_SOURCE);
1007 ARIZONA_MUX_ENUMS(ISRC3DEC2, ARIZONA_ISRC3DEC2MIX_INPUT_1_SOURCE);
1008 ARIZONA_MUX_ENUMS(ISRC3DEC3, ARIZONA_ISRC3DEC3MIX_INPUT_1_SOURCE);
1009 ARIZONA_MUX_ENUMS(ISRC3DEC4, ARIZONA_ISRC3DEC4MIX_INPUT_1_SOURCE);
1010 
1011 static const char *wm5110_aec_loopback_texts[] = {
1012         "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R",
1013         "SPKOUTL", "SPKOUTR", "SPKDAT1L", "SPKDAT1R", "SPKDAT2L", "SPKDAT2R",
1014 };
1015 
1016 static const unsigned int wm5110_aec_loopback_values[] = {
1017         0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1018 };
1019 
1020 static const struct soc_enum wm5110_aec_loopback =
1021         SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1,
1022                               ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf,
1023                               ARRAY_SIZE(wm5110_aec_loopback_texts),
1024                               wm5110_aec_loopback_texts,
1025                               wm5110_aec_loopback_values);
1026 
1027 static const struct snd_kcontrol_new wm5110_aec_loopback_mux =
1028         SOC_DAPM_ENUM("AEC Loopback", wm5110_aec_loopback);
1029 
1030 static const struct snd_kcontrol_new wm5110_anc_input_mux[] = {
1031         SOC_DAPM_ENUM("RXANCL Input", arizona_anc_input_src[0]),
1032         SOC_DAPM_ENUM("RXANCL Channel", arizona_anc_input_src[1]),
1033         SOC_DAPM_ENUM("RXANCR Input", arizona_anc_input_src[2]),
1034         SOC_DAPM_ENUM("RXANCR Channel", arizona_anc_input_src[3]),
1035 };
1036 
1037 static const struct snd_kcontrol_new wm5110_anc_ng_mux =
1038         SOC_DAPM_ENUM("RXANC NG Source", arizona_anc_ng_enum);
1039 
1040 static const struct snd_kcontrol_new wm5110_output_anc_src[] = {
1041         SOC_DAPM_ENUM("HPOUT1L ANC Source", arizona_output_anc_src[0]),
1042         SOC_DAPM_ENUM("HPOUT1R ANC Source", arizona_output_anc_src[1]),
1043         SOC_DAPM_ENUM("HPOUT2L ANC Source", arizona_output_anc_src[2]),
1044         SOC_DAPM_ENUM("HPOUT2R ANC Source", arizona_output_anc_src[3]),
1045         SOC_DAPM_ENUM("HPOUT3L ANC Source", arizona_output_anc_src[4]),
1046         SOC_DAPM_ENUM("HPOUT3R ANC Source", arizona_output_anc_src[5]),
1047         SOC_DAPM_ENUM("SPKOUTL ANC Source", arizona_output_anc_src[6]),
1048         SOC_DAPM_ENUM("SPKOUTR ANC Source", arizona_output_anc_src[7]),
1049         SOC_DAPM_ENUM("SPKDAT1L ANC Source", arizona_output_anc_src[8]),
1050         SOC_DAPM_ENUM("SPKDAT1R ANC Source", arizona_output_anc_src[9]),
1051         SOC_DAPM_ENUM("SPKDAT2L ANC Source", arizona_output_anc_src[10]),
1052         SOC_DAPM_ENUM("SPKDAT2R ANC Source", arizona_output_anc_src[11]),
1053 };
1054 
1055 static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = {
1056 SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT,
1057                     0, wm5110_sysclk_ev, SND_SOC_DAPM_POST_PMU),
1058 SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1,
1059                     ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
1060 SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK,
1061                     ARIZONA_OPCLK_ENA_SHIFT, 0, NULL, 0),
1062 SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", ARIZONA_OUTPUT_ASYNC_CLOCK,
1063                     ARIZONA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0),
1064 
1065 SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0),
1066 SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD3", 0, 0),
1067 SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD", 20, 0),
1068 SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS),
1069 SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDL", 0, 0),
1070 SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0),
1071 
1072 SND_SOC_DAPM_SIGGEN("TONE"),
1073 SND_SOC_DAPM_SIGGEN("NOISE"),
1074 SND_SOC_DAPM_SIGGEN("HAPTICS"),
1075 
1076 SND_SOC_DAPM_INPUT("IN1L"),
1077 SND_SOC_DAPM_INPUT("IN1R"),
1078 SND_SOC_DAPM_INPUT("IN2L"),
1079 SND_SOC_DAPM_INPUT("IN2R"),
1080 SND_SOC_DAPM_INPUT("IN3L"),
1081 SND_SOC_DAPM_INPUT("IN3R"),
1082 SND_SOC_DAPM_INPUT("IN4L"),
1083 SND_SOC_DAPM_INPUT("IN4R"),
1084 
1085 SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"),
1086 SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"),
1087 
1088 SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT,
1089                    0, NULL, 0, wm5110_in_ev,
1090                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1091                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1092                    SND_SOC_DAPM_WILL_PMU),
1093 SND_SOC_DAPM_PGA_E("IN1R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1R_ENA_SHIFT,
1094                    0, NULL, 0, wm5110_in_ev,
1095                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1096                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1097                    SND_SOC_DAPM_WILL_PMU),
1098 SND_SOC_DAPM_PGA_E("IN2L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2L_ENA_SHIFT,
1099                    0, NULL, 0, wm5110_in_ev,
1100                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1101                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1102                    SND_SOC_DAPM_WILL_PMU),
1103 SND_SOC_DAPM_PGA_E("IN2R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2R_ENA_SHIFT,
1104                    0, NULL, 0, wm5110_in_ev,
1105                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1106                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1107                    SND_SOC_DAPM_WILL_PMU),
1108 SND_SOC_DAPM_PGA_E("IN3L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3L_ENA_SHIFT,
1109                    0, NULL, 0, wm5110_in_ev,
1110                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1111                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1112                    SND_SOC_DAPM_WILL_PMU),
1113 SND_SOC_DAPM_PGA_E("IN3R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3R_ENA_SHIFT,
1114                    0, NULL, 0, wm5110_in_ev,
1115                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1116                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
1117                    SND_SOC_DAPM_WILL_PMU),
1118 SND_SOC_DAPM_PGA_E("IN4L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4L_ENA_SHIFT,
1119                    0, NULL, 0, arizona_in_ev,
1120                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1121                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1122 SND_SOC_DAPM_PGA_E("IN4R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4R_ENA_SHIFT,
1123                    0, NULL, 0, arizona_in_ev,
1124                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1125                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1126 
1127 SND_SOC_DAPM_SUPPLY("MICBIAS1", ARIZONA_MIC_BIAS_CTRL_1,
1128                     ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
1129 SND_SOC_DAPM_SUPPLY("MICBIAS2", ARIZONA_MIC_BIAS_CTRL_2,
1130                     ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
1131 SND_SOC_DAPM_SUPPLY("MICBIAS3", ARIZONA_MIC_BIAS_CTRL_3,
1132                     ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
1133 
1134 SND_SOC_DAPM_PGA("Noise Generator", ARIZONA_COMFORT_NOISE_GENERATOR,
1135                  ARIZONA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0),
1136 
1137 SND_SOC_DAPM_PGA("Tone Generator 1", ARIZONA_TONE_GENERATOR_1,
1138                  ARIZONA_TONE1_ENA_SHIFT, 0, NULL, 0),
1139 SND_SOC_DAPM_PGA("Tone Generator 2", ARIZONA_TONE_GENERATOR_1,
1140                  ARIZONA_TONE2_ENA_SHIFT, 0, NULL, 0),
1141 
1142 SND_SOC_DAPM_PGA("Mic Mute Mixer", ARIZONA_MIC_NOISE_MIX_CONTROL_1,
1143                  ARIZONA_MICMUTE_MIX_ENA_SHIFT, 0, NULL, 0),
1144 
1145 SND_SOC_DAPM_PGA("EQ1", ARIZONA_EQ1_1, ARIZONA_EQ1_ENA_SHIFT, 0, NULL, 0),
1146 SND_SOC_DAPM_PGA("EQ2", ARIZONA_EQ2_1, ARIZONA_EQ2_ENA_SHIFT, 0, NULL, 0),
1147 SND_SOC_DAPM_PGA("EQ3", ARIZONA_EQ3_1, ARIZONA_EQ3_ENA_SHIFT, 0, NULL, 0),
1148 SND_SOC_DAPM_PGA("EQ4", ARIZONA_EQ4_1, ARIZONA_EQ4_ENA_SHIFT, 0, NULL, 0),
1149 
1150 SND_SOC_DAPM_PGA("DRC1L", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1L_ENA_SHIFT, 0,
1151                  NULL, 0),
1152 SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0,
1153                  NULL, 0),
1154 SND_SOC_DAPM_PGA("DRC2L", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2L_ENA_SHIFT, 0,
1155                  NULL, 0),
1156 SND_SOC_DAPM_PGA("DRC2R", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2R_ENA_SHIFT, 0,
1157                  NULL, 0),
1158 
1159 SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0,
1160                  NULL, 0),
1161 SND_SOC_DAPM_PGA("LHPF2", ARIZONA_HPLPF2_1, ARIZONA_LHPF2_ENA_SHIFT, 0,
1162                  NULL, 0),
1163 SND_SOC_DAPM_PGA("LHPF3", ARIZONA_HPLPF3_1, ARIZONA_LHPF3_ENA_SHIFT, 0,
1164                  NULL, 0),
1165 SND_SOC_DAPM_PGA("LHPF4", ARIZONA_HPLPF4_1, ARIZONA_LHPF4_ENA_SHIFT, 0,
1166                  NULL, 0),
1167 
1168 SND_SOC_DAPM_PGA("PWM1 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM1_ENA_SHIFT,
1169                  0, NULL, 0),
1170 SND_SOC_DAPM_PGA("PWM2 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM2_ENA_SHIFT,
1171                  0, NULL, 0),
1172 
1173 SND_SOC_DAPM_PGA("ASRC1L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1L_ENA_SHIFT, 0,
1174                  NULL, 0),
1175 SND_SOC_DAPM_PGA("ASRC1R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1R_ENA_SHIFT, 0,
1176                  NULL, 0),
1177 SND_SOC_DAPM_PGA("ASRC2L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2L_ENA_SHIFT, 0,
1178                  NULL, 0),
1179 SND_SOC_DAPM_PGA("ASRC2R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2R_ENA_SHIFT, 0,
1180                  NULL, 0),
1181 
1182 WM_ADSP2("DSP1", 0),
1183 WM_ADSP2("DSP2", 1),
1184 WM_ADSP2("DSP3", 2),
1185 WM_ADSP2("DSP4", 3),
1186 
1187 SND_SOC_DAPM_PGA("ISRC1INT1", ARIZONA_ISRC_1_CTRL_3,
1188                  ARIZONA_ISRC1_INT0_ENA_SHIFT, 0, NULL, 0),
1189 SND_SOC_DAPM_PGA("ISRC1INT2", ARIZONA_ISRC_1_CTRL_3,
1190                  ARIZONA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0),
1191 SND_SOC_DAPM_PGA("ISRC1INT3", ARIZONA_ISRC_1_CTRL_3,
1192                  ARIZONA_ISRC1_INT2_ENA_SHIFT, 0, NULL, 0),
1193 SND_SOC_DAPM_PGA("ISRC1INT4", ARIZONA_ISRC_1_CTRL_3,
1194                  ARIZONA_ISRC1_INT3_ENA_SHIFT, 0, NULL, 0),
1195 
1196 SND_SOC_DAPM_PGA("ISRC1DEC1", ARIZONA_ISRC_1_CTRL_3,
1197                  ARIZONA_ISRC1_DEC0_ENA_SHIFT, 0, NULL, 0),
1198 SND_SOC_DAPM_PGA("ISRC1DEC2", ARIZONA_ISRC_1_CTRL_3,
1199                  ARIZONA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0),
1200 SND_SOC_DAPM_PGA("ISRC1DEC3", ARIZONA_ISRC_1_CTRL_3,
1201                  ARIZONA_ISRC1_DEC2_ENA_SHIFT, 0, NULL, 0),
1202 SND_SOC_DAPM_PGA("ISRC1DEC4", ARIZONA_ISRC_1_CTRL_3,
1203                  ARIZONA_ISRC1_DEC3_ENA_SHIFT, 0, NULL, 0),
1204 
1205 SND_SOC_DAPM_PGA("ISRC2INT1", ARIZONA_ISRC_2_CTRL_3,
1206                  ARIZONA_ISRC2_INT0_ENA_SHIFT, 0, NULL, 0),
1207 SND_SOC_DAPM_PGA("ISRC2INT2", ARIZONA_ISRC_2_CTRL_3,
1208                  ARIZONA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0),
1209 SND_SOC_DAPM_PGA("ISRC2INT3", ARIZONA_ISRC_2_CTRL_3,
1210                  ARIZONA_ISRC2_INT2_ENA_SHIFT, 0, NULL, 0),
1211 SND_SOC_DAPM_PGA("ISRC2INT4", ARIZONA_ISRC_2_CTRL_3,
1212                  ARIZONA_ISRC2_INT3_ENA_SHIFT, 0, NULL, 0),
1213 
1214 SND_SOC_DAPM_PGA("ISRC2DEC1", ARIZONA_ISRC_2_CTRL_3,
1215                  ARIZONA_ISRC2_DEC0_ENA_SHIFT, 0, NULL, 0),
1216 SND_SOC_DAPM_PGA("ISRC2DEC2", ARIZONA_ISRC_2_CTRL_3,
1217                  ARIZONA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0),
1218 SND_SOC_DAPM_PGA("ISRC2DEC3", ARIZONA_ISRC_2_CTRL_3,
1219                  ARIZONA_ISRC2_DEC2_ENA_SHIFT, 0, NULL, 0),
1220 SND_SOC_DAPM_PGA("ISRC2DEC4", ARIZONA_ISRC_2_CTRL_3,
1221                  ARIZONA_ISRC2_DEC3_ENA_SHIFT, 0, NULL, 0),
1222 
1223 SND_SOC_DAPM_PGA("ISRC3INT1", ARIZONA_ISRC_3_CTRL_3,
1224                  ARIZONA_ISRC3_INT0_ENA_SHIFT, 0, NULL, 0),
1225 SND_SOC_DAPM_PGA("ISRC3INT2", ARIZONA_ISRC_3_CTRL_3,
1226                  ARIZONA_ISRC3_INT1_ENA_SHIFT, 0, NULL, 0),
1227 SND_SOC_DAPM_PGA("ISRC3INT3", ARIZONA_ISRC_3_CTRL_3,
1228                  ARIZONA_ISRC3_INT2_ENA_SHIFT, 0, NULL, 0),
1229 SND_SOC_DAPM_PGA("ISRC3INT4", ARIZONA_ISRC_3_CTRL_3,
1230                  ARIZONA_ISRC3_INT3_ENA_SHIFT, 0, NULL, 0),
1231 
1232 SND_SOC_DAPM_PGA("ISRC3DEC1", ARIZONA_ISRC_3_CTRL_3,
1233                  ARIZONA_ISRC3_DEC0_ENA_SHIFT, 0, NULL, 0),
1234 SND_SOC_DAPM_PGA("ISRC3DEC2", ARIZONA_ISRC_3_CTRL_3,
1235                  ARIZONA_ISRC3_DEC1_ENA_SHIFT, 0, NULL, 0),
1236 SND_SOC_DAPM_PGA("ISRC3DEC3", ARIZONA_ISRC_3_CTRL_3,
1237                  ARIZONA_ISRC3_DEC2_ENA_SHIFT, 0, NULL, 0),
1238 SND_SOC_DAPM_PGA("ISRC3DEC4", ARIZONA_ISRC_3_CTRL_3,
1239                  ARIZONA_ISRC3_DEC3_ENA_SHIFT, 0, NULL, 0),
1240 
1241 SND_SOC_DAPM_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1,
1242                        ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0,
1243                        &wm5110_aec_loopback_mux),
1244 
1245 SND_SOC_DAPM_SUPPLY("RXANC NG External Clock", SND_SOC_NOPM,
1246                    ARIZONA_EXT_NG_SEL_SET_SHIFT, 0, arizona_anc_ev,
1247                    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1248 SND_SOC_DAPM_PGA("RXANCL NG External", SND_SOC_NOPM, 0, 0, NULL, 0),
1249 SND_SOC_DAPM_PGA("RXANCR NG External", SND_SOC_NOPM, 0, 0, NULL, 0),
1250 
1251 SND_SOC_DAPM_SUPPLY("RXANC NG Clock", SND_SOC_NOPM,
1252                    ARIZONA_CLK_NG_ENA_SET_SHIFT, 0, arizona_anc_ev,
1253                    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1254 SND_SOC_DAPM_PGA("RXANCL NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0),
1255 SND_SOC_DAPM_PGA("RXANCR NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0),
1256 
1257 SND_SOC_DAPM_MUX("RXANCL Left Input", SND_SOC_NOPM, 0, 0,
1258                  &wm5110_anc_input_mux[0]),
1259 SND_SOC_DAPM_MUX("RXANCL Right Input", SND_SOC_NOPM, 0, 0,
1260                  &wm5110_anc_input_mux[0]),
1261 SND_SOC_DAPM_MUX("RXANCL Channel", SND_SOC_NOPM, 0, 0,
1262                  &wm5110_anc_input_mux[1]),
1263 SND_SOC_DAPM_MUX("RXANCL NG Mux", SND_SOC_NOPM, 0, 0, &wm5110_anc_ng_mux),
1264 SND_SOC_DAPM_MUX("RXANCR Left Input", SND_SOC_NOPM, 0, 0,
1265                  &wm5110_anc_input_mux[2]),
1266 SND_SOC_DAPM_MUX("RXANCR Right Input", SND_SOC_NOPM, 0, 0,
1267                  &wm5110_anc_input_mux[2]),
1268 SND_SOC_DAPM_MUX("RXANCR Channel", SND_SOC_NOPM, 0, 0,
1269                  &wm5110_anc_input_mux[3]),
1270 SND_SOC_DAPM_MUX("RXANCR NG Mux", SND_SOC_NOPM, 0, 0, &wm5110_anc_ng_mux),
1271 
1272 SND_SOC_DAPM_PGA_E("RXANCL", SND_SOC_NOPM, ARIZONA_CLK_L_ENA_SET_SHIFT,
1273                    0, NULL, 0, arizona_anc_ev,
1274                    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1275 SND_SOC_DAPM_PGA_E("RXANCR", SND_SOC_NOPM, ARIZONA_CLK_R_ENA_SET_SHIFT,
1276                    0, NULL, 0, arizona_anc_ev,
1277                    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1278 
1279 SND_SOC_DAPM_MUX("HPOUT1L ANC Source", SND_SOC_NOPM, 0, 0,
1280                  &wm5110_output_anc_src[0]),
1281 SND_SOC_DAPM_MUX("HPOUT1R ANC Source", SND_SOC_NOPM, 0, 0,
1282                  &wm5110_output_anc_src[1]),
1283 SND_SOC_DAPM_MUX("HPOUT2L ANC Source", SND_SOC_NOPM, 0, 0,
1284                  &wm5110_output_anc_src[2]),
1285 SND_SOC_DAPM_MUX("HPOUT2R ANC Source", SND_SOC_NOPM, 0, 0,
1286                  &wm5110_output_anc_src[3]),
1287 SND_SOC_DAPM_MUX("HPOUT3L ANC Source", SND_SOC_NOPM, 0, 0,
1288                  &wm5110_output_anc_src[4]),
1289 SND_SOC_DAPM_MUX("HPOUT3R ANC Source", SND_SOC_NOPM, 0, 0,
1290                  &wm5110_output_anc_src[5]),
1291 SND_SOC_DAPM_MUX("SPKOUTL ANC Source", SND_SOC_NOPM, 0, 0,
1292                  &wm5110_output_anc_src[6]),
1293 SND_SOC_DAPM_MUX("SPKOUTR ANC Source", SND_SOC_NOPM, 0, 0,
1294                  &wm5110_output_anc_src[7]),
1295 SND_SOC_DAPM_MUX("SPKDAT1L ANC Source", SND_SOC_NOPM, 0, 0,
1296                  &wm5110_output_anc_src[8]),
1297 SND_SOC_DAPM_MUX("SPKDAT1R ANC Source", SND_SOC_NOPM, 0, 0,
1298                  &wm5110_output_anc_src[9]),
1299 SND_SOC_DAPM_MUX("SPKDAT2L ANC Source", SND_SOC_NOPM, 0, 0,
1300                  &wm5110_output_anc_src[10]),
1301 SND_SOC_DAPM_MUX("SPKDAT2R ANC Source", SND_SOC_NOPM, 0, 0,
1302                  &wm5110_output_anc_src[11]),
1303 
1304 SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0,
1305                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0),
1306 SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0,
1307                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX2_ENA_SHIFT, 0),
1308 SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0,
1309                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX3_ENA_SHIFT, 0),
1310 SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0,
1311                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX4_ENA_SHIFT, 0),
1312 SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0,
1313                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX5_ENA_SHIFT, 0),
1314 SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0,
1315                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX6_ENA_SHIFT, 0),
1316 SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0,
1317                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX7_ENA_SHIFT, 0),
1318 SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0,
1319                      ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX8_ENA_SHIFT, 0),
1320 
1321 SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0,
1322                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX1_ENA_SHIFT, 0),
1323 SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0,
1324                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX2_ENA_SHIFT, 0),
1325 SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0,
1326                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX3_ENA_SHIFT, 0),
1327 SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0,
1328                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX4_ENA_SHIFT, 0),
1329 SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0,
1330                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX5_ENA_SHIFT, 0),
1331 SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0,
1332                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX6_ENA_SHIFT, 0),
1333 SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0,
1334                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX7_ENA_SHIFT, 0),
1335 SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0,
1336                     ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX8_ENA_SHIFT, 0),
1337 
1338 SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0,
1339                      ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX1_ENA_SHIFT, 0),
1340 SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0,
1341                      ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX2_ENA_SHIFT, 0),
1342 SND_SOC_DAPM_AIF_OUT("AIF2TX3", NULL, 0,
1343                      ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX3_ENA_SHIFT, 0),
1344 SND_SOC_DAPM_AIF_OUT("AIF2TX4", NULL, 0,
1345                      ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX4_ENA_SHIFT, 0),
1346 SND_SOC_DAPM_AIF_OUT("AIF2TX5", NULL, 0,
1347                      ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX5_ENA_SHIFT, 0),
1348 SND_SOC_DAPM_AIF_OUT("AIF2TX6", NULL, 0,
1349                      ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX6_ENA_SHIFT, 0),
1350 
1351 SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0,
1352                     ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX1_ENA_SHIFT, 0),
1353 SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0,
1354                     ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX2_ENA_SHIFT, 0),
1355 SND_SOC_DAPM_AIF_IN("AIF2RX3", NULL, 0,
1356                     ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX3_ENA_SHIFT, 0),
1357 SND_SOC_DAPM_AIF_IN("AIF2RX4", NULL, 0,
1358                     ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX4_ENA_SHIFT, 0),
1359 SND_SOC_DAPM_AIF_IN("AIF2RX5", NULL, 0,
1360                     ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX5_ENA_SHIFT, 0),
1361 SND_SOC_DAPM_AIF_IN("AIF2RX6", NULL, 0,
1362                     ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX6_ENA_SHIFT, 0),
1363 
1364 SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0,
1365                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1366                     ARIZONA_SLIMRX1_ENA_SHIFT, 0),
1367 SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0,
1368                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1369                     ARIZONA_SLIMRX2_ENA_SHIFT, 0),
1370 SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0,
1371                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1372                     ARIZONA_SLIMRX3_ENA_SHIFT, 0),
1373 SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0,
1374                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1375                     ARIZONA_SLIMRX4_ENA_SHIFT, 0),
1376 SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0,
1377                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1378                     ARIZONA_SLIMRX5_ENA_SHIFT, 0),
1379 SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0,
1380                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1381                     ARIZONA_SLIMRX6_ENA_SHIFT, 0),
1382 SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0,
1383                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1384                     ARIZONA_SLIMRX7_ENA_SHIFT, 0),
1385 SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0,
1386                     ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
1387                     ARIZONA_SLIMRX8_ENA_SHIFT, 0),
1388 
1389 SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0,
1390                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1391                      ARIZONA_SLIMTX1_ENA_SHIFT, 0),
1392 SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0,
1393                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1394                      ARIZONA_SLIMTX2_ENA_SHIFT, 0),
1395 SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0,
1396                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1397                      ARIZONA_SLIMTX3_ENA_SHIFT, 0),
1398 SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0,
1399                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1400                      ARIZONA_SLIMTX4_ENA_SHIFT, 0),
1401 SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0,
1402                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1403                      ARIZONA_SLIMTX5_ENA_SHIFT, 0),
1404 SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0,
1405                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1406                      ARIZONA_SLIMTX6_ENA_SHIFT, 0),
1407 SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0,
1408                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1409                      ARIZONA_SLIMTX7_ENA_SHIFT, 0),
1410 SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0,
1411                      ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
1412                      ARIZONA_SLIMTX8_ENA_SHIFT, 0),
1413 
1414 SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0,
1415                      ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX1_ENA_SHIFT, 0),
1416 SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 0,
1417                      ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX2_ENA_SHIFT, 0),
1418 
1419 SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0,
1420                     ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX1_ENA_SHIFT, 0),
1421 SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0,
1422                     ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX2_ENA_SHIFT, 0),
1423 
1424 SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
1425                    ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, wm5110_hp_ev,
1426                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1427                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1428 SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM,
1429                    ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, wm5110_hp_ev,
1430                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1431                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1432 SND_SOC_DAPM_PGA_E("OUT2L", ARIZONA_OUTPUT_ENABLES_1,
1433                    ARIZONA_OUT2L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1434                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1435                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1436 SND_SOC_DAPM_PGA_E("OUT2R", ARIZONA_OUTPUT_ENABLES_1,
1437                    ARIZONA_OUT2R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1438                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1439                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1440 SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
1441                    ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1442                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1443                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1444 SND_SOC_DAPM_PGA_E("OUT3R", ARIZONA_OUTPUT_ENABLES_1,
1445                    ARIZONA_OUT3R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1446                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1447                    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1448 SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1,
1449                    ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1450                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1451 SND_SOC_DAPM_PGA_E("OUT5R", ARIZONA_OUTPUT_ENABLES_1,
1452                    ARIZONA_OUT5R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1453                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1454 SND_SOC_DAPM_PGA_E("OUT6L", ARIZONA_OUTPUT_ENABLES_1,
1455                    ARIZONA_OUT6L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1456                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1457 SND_SOC_DAPM_PGA_E("OUT6R", ARIZONA_OUTPUT_ENABLES_1,
1458                    ARIZONA_OUT6R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
1459                    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1460 
1461 ARIZONA_MIXER_WIDGETS(EQ1, "EQ1"),
1462 ARIZONA_MIXER_WIDGETS(EQ2, "EQ2"),
1463 ARIZONA_MIXER_WIDGETS(EQ3, "EQ3"),
1464 ARIZONA_MIXER_WIDGETS(EQ4, "EQ4"),
1465 
1466 ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"),
1467 ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"),
1468 ARIZONA_MIXER_WIDGETS(DRC2L, "DRC2L"),
1469 ARIZONA_MIXER_WIDGETS(DRC2R, "DRC2R"),
1470 
1471 ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"),
1472 ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"),
1473 ARIZONA_MIXER_WIDGETS(LHPF3, "LHPF3"),
1474 ARIZONA_MIXER_WIDGETS(LHPF4, "LHPF4"),
1475 
1476 ARIZONA_MIXER_WIDGETS(Mic, "Mic"),
1477 ARIZONA_MIXER_WIDGETS(Noise, "Noise"),
1478 
1479 ARIZONA_MIXER_WIDGETS(PWM1, "PWM1"),
1480 ARIZONA_MIXER_WIDGETS(PWM2, "PWM2"),
1481 
1482 ARIZONA_MIXER_WIDGETS(OUT1L, "HPOUT1L"),
1483 ARIZONA_MIXER_WIDGETS(OUT1R, "HPOUT1R"),
1484 ARIZONA_MIXER_WIDGETS(OUT2L, "HPOUT2L"),
1485 ARIZONA_MIXER_WIDGETS(OUT2R, "HPOUT2R"),
1486 ARIZONA_MIXER_WIDGETS(OUT3L, "HPOUT3L"),
1487 ARIZONA_MIXER_WIDGETS(OUT3R, "HPOUT3R"),
1488 ARIZONA_MIXER_WIDGETS(SPKOUTL, "SPKOUTL"),
1489 ARIZONA_MIXER_WIDGETS(SPKOUTR, "SPKOUTR"),
1490 ARIZONA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"),
1491 ARIZONA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"),
1492 ARIZONA_MIXER_WIDGETS(SPKDAT2L, "SPKDAT2L"),
1493 ARIZONA_MIXER_WIDGETS(SPKDAT2R, "SPKDAT2R"),
1494 
1495 ARIZONA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"),
1496 ARIZONA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"),
1497 ARIZONA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"),
1498 ARIZONA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"),
1499 ARIZONA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"),
1500 ARIZONA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"),
1501 ARIZONA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"),
1502 ARIZONA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"),
1503 
1504 ARIZONA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"),
1505 ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"),
1506 ARIZONA_MIXER_WIDGETS(AIF2TX3, "AIF2TX3"),
1507 ARIZONA_MIXER_WIDGETS(AIF2TX4, "AIF2TX4"),
1508 ARIZONA_MIXER_WIDGETS(AIF2TX5, "AIF2TX5"),
1509 ARIZONA_MIXER_WIDGETS(AIF2TX6, "AIF2TX6"),
1510 
1511 ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"),
1512 ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"),
1513 
1514 ARIZONA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"),
1515 ARIZONA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"),
1516 ARIZONA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"),
1517 ARIZONA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"),
1518 ARIZONA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"),
1519 ARIZONA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"),
1520 ARIZONA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"),
1521 ARIZONA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"),
1522 
1523 ARIZONA_MUX_WIDGETS(ASRC1L, "ASRC1L"),
1524 ARIZONA_MUX_WIDGETS(ASRC1R, "ASRC1R"),
1525 ARIZONA_MUX_WIDGETS(ASRC2L, "ASRC2L"),
1526 ARIZONA_MUX_WIDGETS(ASRC2R, "ASRC2R"),
1527 
1528 ARIZONA_DSP_WIDGETS(DSP1, "DSP1"),
1529 ARIZONA_DSP_WIDGETS(DSP2, "DSP2"),
1530 ARIZONA_DSP_WIDGETS(DSP3, "DSP3"),
1531 ARIZONA_DSP_WIDGETS(DSP4, "DSP4"),
1532 
1533 ARIZONA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"),
1534 ARIZONA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"),
1535 ARIZONA_MUX_WIDGETS(ISRC1DEC3, "ISRC1DEC3"),
1536 ARIZONA_MUX_WIDGETS(ISRC1DEC4, "ISRC1DEC4"),
1537 
1538 ARIZONA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"),
1539 ARIZONA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"),
1540 ARIZONA_MUX_WIDGETS(ISRC1INT3, "ISRC1INT3"),
1541 ARIZONA_MUX_WIDGETS(ISRC1INT4, "ISRC1INT4"),
1542 
1543 ARIZONA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"),
1544 ARIZONA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"),
1545 ARIZONA_MUX_WIDGETS(ISRC2DEC3, "ISRC2DEC3"),
1546 ARIZONA_MUX_WIDGETS(ISRC2DEC4, "ISRC2DEC4"),
1547 
1548 ARIZONA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"),
1549 ARIZONA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"),
1550 ARIZONA_MUX_WIDGETS(ISRC2INT3, "ISRC2INT3"),
1551 ARIZONA_MUX_WIDGETS(ISRC2INT4, "ISRC2INT4"),
1552 
1553 ARIZONA_MUX_WIDGETS(ISRC3DEC1, "ISRC3DEC1"),
1554 ARIZONA_MUX_WIDGETS(ISRC3DEC2, "ISRC3DEC2"),
1555 ARIZONA_MUX_WIDGETS(ISRC3DEC3, "ISRC3DEC3"),
1556 ARIZONA_MUX_WIDGETS(ISRC3DEC4, "ISRC3DEC4"),
1557 
1558 ARIZONA_MUX_WIDGETS(ISRC3INT1, "ISRC3INT1"),
1559 ARIZONA_MUX_WIDGETS(ISRC3INT2, "ISRC3INT2"),
1560 ARIZONA_MUX_WIDGETS(ISRC3INT3, "ISRC3INT3"),
1561 ARIZONA_MUX_WIDGETS(ISRC3INT4, "ISRC3INT4"),
1562 
1563 SND_SOC_DAPM_OUTPUT("HPOUT1L"),
1564 SND_SOC_DAPM_OUTPUT("HPOUT1R"),
1565 SND_SOC_DAPM_OUTPUT("HPOUT2L"),
1566 SND_SOC_DAPM_OUTPUT("HPOUT2R"),
1567 SND_SOC_DAPM_OUTPUT("HPOUT3L"),
1568 SND_SOC_DAPM_OUTPUT("HPOUT3R"),
1569 SND_SOC_DAPM_OUTPUT("SPKOUTLN"),
1570 SND_SOC_DAPM_OUTPUT("SPKOUTLP"),
1571 SND_SOC_DAPM_OUTPUT("SPKOUTRN"),
1572 SND_SOC_DAPM_OUTPUT("SPKOUTRP"),
1573 SND_SOC_DAPM_OUTPUT("SPKDAT1L"),
1574 SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
1575 SND_SOC_DAPM_OUTPUT("SPKDAT2L"),
1576 SND_SOC_DAPM_OUTPUT("SPKDAT2R"),
1577 
1578 SND_SOC_DAPM_OUTPUT("MICSUPP"),
1579 };
1580 
1581 #define ARIZONA_MIXER_INPUT_ROUTES(name)        \
1582         { name, "Noise Generator", "Noise Generator" }, \
1583         { name, "Tone Generator 1", "Tone Generator 1" }, \
1584         { name, "Tone Generator 2", "Tone Generator 2" }, \
1585         { name, "Haptics", "HAPTICS" }, \
1586         { name, "AEC", "AEC Loopback" }, \
1587         { name, "IN1L", "IN1L PGA" }, \
1588         { name, "IN1R", "IN1R PGA" }, \
1589         { name, "IN2L", "IN2L PGA" }, \
1590         { name, "IN2R", "IN2R PGA" }, \
1591         { name, "IN3L", "IN3L PGA" }, \
1592         { name, "IN3R", "IN3R PGA" }, \
1593         { name, "IN4L", "IN4L PGA" }, \
1594         { name, "IN4R", "IN4R PGA" }, \
1595         { name, "Mic Mute Mixer", "Mic Mute Mixer" }, \
1596         { name, "AIF1RX1", "AIF1RX1" }, \
1597         { name, "AIF1RX2", "AIF1RX2" }, \
1598         { name, "AIF1RX3", "AIF1RX3" }, \
1599         { name, "AIF1RX4", "AIF1RX4" }, \
1600         { name, "AIF1RX5", "AIF1RX5" }, \
1601         { name, "AIF1RX6", "AIF1RX6" }, \
1602         { name, "AIF1RX7", "AIF1RX7" }, \
1603         { name, "AIF1RX8", "AIF1RX8" }, \
1604         { name, "AIF2RX1", "AIF2RX1" }, \
1605         { name, "AIF2RX2", "AIF2RX2" }, \
1606         { name, "AIF2RX3", "AIF2RX3" }, \
1607         { name, "AIF2RX4", "AIF2RX4" }, \
1608         { name, "AIF2RX5", "AIF2RX5" }, \
1609         { name, "AIF2RX6", "AIF2RX6" }, \
1610         { name, "AIF3RX1", "AIF3RX1" }, \
1611         { name, "AIF3RX2", "AIF3RX2" }, \
1612         { name, "SLIMRX1", "SLIMRX1" }, \
1613         { name, "SLIMRX2", "SLIMRX2" }, \
1614         { name, "SLIMRX3", "SLIMRX3" }, \
1615         { name, "SLIMRX4", "SLIMRX4" }, \
1616         { name, "SLIMRX5", "SLIMRX5" }, \
1617         { name, "SLIMRX6", "SLIMRX6" }, \
1618         { name, "SLIMRX7", "SLIMRX7" }, \
1619         { name, "SLIMRX8", "SLIMRX8" }, \
1620         { name, "EQ1", "EQ1" }, \
1621         { name, "EQ2", "EQ2" }, \
1622         { name, "EQ3", "EQ3" }, \
1623         { name, "EQ4", "EQ4" }, \
1624         { name, "DRC1L", "DRC1L" }, \
1625         { name, "DRC1R", "DRC1R" }, \
1626         { name, "DRC2L", "DRC2L" }, \
1627         { name, "DRC2R", "DRC2R" }, \
1628         { name, "LHPF1", "LHPF1" }, \
1629         { name, "LHPF2", "LHPF2" }, \
1630         { name, "LHPF3", "LHPF3" }, \
1631         { name, "LHPF4", "LHPF4" }, \
1632         { name, "ASRC1L", "ASRC1L" }, \
1633         { name, "ASRC1R", "ASRC1R" }, \
1634         { name, "ASRC2L", "ASRC2L" }, \
1635         { name, "ASRC2R", "ASRC2R" }, \
1636         { name, "ISRC1DEC1", "ISRC1DEC1" }, \
1637         { name, "ISRC1DEC2", "ISRC1DEC2" }, \
1638         { name, "ISRC1DEC3", "ISRC1DEC3" }, \
1639         { name, "ISRC1DEC4", "ISRC1DEC4" }, \
1640         { name, "ISRC1INT1", "ISRC1INT1" }, \
1641         { name, "ISRC1INT2", "ISRC1INT2" }, \
1642         { name, "ISRC1INT3", "ISRC1INT3" }, \
1643         { name, "ISRC1INT4", "ISRC1INT4" }, \
1644         { name, "ISRC2DEC1", "ISRC2DEC1" }, \
1645         { name, "ISRC2DEC2", "ISRC2DEC2" }, \
1646         { name, "ISRC2DEC3", "ISRC2DEC3" }, \
1647         { name, "ISRC2DEC4", "ISRC2DEC4" }, \
1648         { name, "ISRC2INT1", "ISRC2INT1" }, \
1649         { name, "ISRC2INT2", "ISRC2INT2" }, \
1650         { name, "ISRC2INT3", "ISRC2INT3" }, \
1651         { name, "ISRC2INT4", "ISRC2INT4" }, \
1652         { name, "ISRC3DEC1", "ISRC3DEC1" }, \
1653         { name, "ISRC3DEC2", "ISRC3DEC2" }, \
1654         { name, "ISRC3DEC3", "ISRC3DEC3" }, \
1655         { name, "ISRC3DEC4", "ISRC3DEC4" }, \
1656         { name, "ISRC3INT1", "ISRC3INT1" }, \
1657         { name, "ISRC3INT2", "ISRC3INT2" }, \
1658         { name, "ISRC3INT3", "ISRC3INT3" }, \
1659         { name, "ISRC3INT4", "ISRC3INT4" }, \
1660         { name, "DSP1.1", "DSP1" }, \
1661         { name, "DSP1.2", "DSP1" }, \
1662         { name, "DSP1.3", "DSP1" }, \
1663         { name, "DSP1.4", "DSP1" }, \
1664         { name, "DSP1.5", "DSP1" }, \
1665         { name, "DSP1.6", "DSP1" }, \
1666         { name, "DSP2.1", "DSP2" }, \
1667         { name, "DSP2.2", "DSP2" }, \
1668         { name, "DSP2.3", "DSP2" }, \
1669         { name, "DSP2.4", "DSP2" }, \
1670         { name, "DSP2.5", "DSP2" }, \
1671         { name, "DSP2.6", "DSP2" }, \
1672         { name, "DSP3.1", "DSP3" }, \
1673         { name, "DSP3.2", "DSP3" }, \
1674         { name, "DSP3.3", "DSP3" }, \
1675         { name, "DSP3.4", "DSP3" }, \
1676         { name, "DSP3.5", "DSP3" }, \
1677         { name, "DSP3.6", "DSP3" }, \
1678         { name, "DSP4.1", "DSP4" }, \
1679         { name, "DSP4.2", "DSP4" }, \
1680         { name, "DSP4.3", "DSP4" }, \
1681         { name, "DSP4.4", "DSP4" }, \
1682         { name, "DSP4.5", "DSP4" }, \
1683         { name, "DSP4.6", "DSP4" }
1684 
1685 static const struct snd_soc_dapm_route wm5110_dapm_routes[] = {
1686         { "AIF2 Capture", NULL, "DBVDD2" },
1687         { "AIF2 Playback", NULL, "DBVDD2" },
1688 
1689         { "AIF3 Capture", NULL, "DBVDD3" },
1690         { "AIF3 Playback", NULL, "DBVDD3" },
1691 
1692         { "OUT1L", NULL, "CPVDD" },
1693         { "OUT1R", NULL, "CPVDD" },
1694         { "OUT2L", NULL, "CPVDD" },
1695         { "OUT2R", NULL, "CPVDD" },
1696         { "OUT3L", NULL, "CPVDD" },
1697         { "OUT3R", NULL, "CPVDD" },
1698 
1699         { "OUT4L", NULL, "SPKVDDL" },
1700         { "OUT4R", NULL, "SPKVDDR" },
1701 
1702         { "OUT1L", NULL, "SYSCLK" },
1703         { "OUT1R", NULL, "SYSCLK" },
1704         { "OUT2L", NULL, "SYSCLK" },
1705         { "OUT2R", NULL, "SYSCLK" },
1706         { "OUT3L", NULL, "SYSCLK" },
1707         { "OUT4L", NULL, "SYSCLK" },
1708         { "OUT4R", NULL, "SYSCLK" },
1709         { "OUT5L", NULL, "SYSCLK" },
1710         { "OUT5R", NULL, "SYSCLK" },
1711         { "OUT6L", NULL, "SYSCLK" },
1712         { "OUT6R", NULL, "SYSCLK" },
1713 
1714         { "IN1L", NULL, "SYSCLK" },
1715         { "IN1R", NULL, "SYSCLK" },
1716         { "IN2L", NULL, "SYSCLK" },
1717         { "IN2R", NULL, "SYSCLK" },
1718         { "IN3L", NULL, "SYSCLK" },
1719         { "IN3R", NULL, "SYSCLK" },
1720         { "IN4L", NULL, "SYSCLK" },
1721         { "IN4R", NULL, "SYSCLK" },
1722 
1723         { "MICBIAS1", NULL, "MICVDD" },
1724         { "MICBIAS2", NULL, "MICVDD" },
1725         { "MICBIAS3", NULL, "MICVDD" },
1726 
1727         { "Noise Generator", NULL, "SYSCLK" },
1728         { "Tone Generator 1", NULL, "SYSCLK" },
1729         { "Tone Generator 2", NULL, "SYSCLK" },
1730 
1731         { "Noise Generator", NULL, "NOISE" },
1732         { "Tone Generator 1", NULL, "TONE" },
1733         { "Tone Generator 2", NULL, "TONE" },
1734 
1735         { "AIF1 Capture", NULL, "AIF1TX1" },
1736         { "AIF1 Capture", NULL, "AIF1TX2" },
1737         { "AIF1 Capture", NULL, "AIF1TX3" },
1738         { "AIF1 Capture", NULL, "AIF1TX4" },
1739         { "AIF1 Capture", NULL, "AIF1TX5" },
1740         { "AIF1 Capture", NULL, "AIF1TX6" },
1741         { "AIF1 Capture", NULL, "AIF1TX7" },
1742         { "AIF1 Capture", NULL, "AIF1TX8" },
1743 
1744         { "AIF1RX1", NULL, "AIF1 Playback" },
1745         { "AIF1RX2", NULL, "AIF1 Playback" },
1746         { "AIF1RX3", NULL, "AIF1 Playback" },
1747         { "AIF1RX4", NULL, "AIF1 Playback" },
1748         { "AIF1RX5", NULL, "AIF1 Playback" },
1749         { "AIF1RX6", NULL, "AIF1 Playback" },
1750         { "AIF1RX7", NULL, "AIF1 Playback" },
1751         { "AIF1RX8", NULL, "AIF1 Playback" },
1752 
1753         { "AIF2 Capture", NULL, "AIF2TX1" },
1754         { "AIF2 Capture", NULL, "AIF2TX2" },
1755         { "AIF2 Capture", NULL, "AIF2TX3" },
1756         { "AIF2 Capture", NULL, "AIF2TX4" },
1757         { "AIF2 Capture", NULL, "AIF2TX5" },
1758         { "AIF2 Capture", NULL, "AIF2TX6" },
1759 
1760         { "AIF2RX1", NULL, "AIF2 Playback" },
1761         { "AIF2RX2", NULL, "AIF2 Playback" },
1762         { "AIF2RX3", NULL, "AIF2 Playback" },
1763         { "AIF2RX4", NULL, "AIF2 Playback" },
1764         { "AIF2RX5", NULL, "AIF2 Playback" },
1765         { "AIF2RX6", NULL, "AIF2 Playback" },
1766 
1767         { "AIF3 Capture", NULL, "AIF3TX1" },
1768         { "AIF3 Capture", NULL, "AIF3TX2" },
1769 
1770         { "AIF3RX1", NULL, "AIF3 Playback" },
1771         { "AIF3RX2", NULL, "AIF3 Playback" },
1772 
1773         { "Slim1 Capture", NULL, "SLIMTX1" },
1774         { "Slim1 Capture", NULL, "SLIMTX2" },
1775         { "Slim1 Capture", NULL, "SLIMTX3" },
1776         { "Slim1 Capture", NULL, "SLIMTX4" },
1777 
1778         { "SLIMRX1", NULL, "Slim1 Playback" },
1779         { "SLIMRX2", NULL, "Slim1 Playback" },
1780         { "SLIMRX3", NULL, "Slim1 Playback" },
1781         { "SLIMRX4", NULL, "Slim1 Playback" },
1782 
1783         { "Slim2 Capture", NULL, "SLIMTX5" },
1784         { "Slim2 Capture", NULL, "SLIMTX6" },
1785 
1786         { "SLIMRX5", NULL, "Slim2 Playback" },
1787         { "SLIMRX6", NULL, "Slim2 Playback" },
1788 
1789         { "Slim3 Capture", NULL, "SLIMTX7" },
1790         { "Slim3 Capture", NULL, "SLIMTX8" },
1791 
1792         { "SLIMRX7", NULL, "Slim3 Playback" },
1793         { "SLIMRX8", NULL, "Slim3 Playback" },
1794 
1795         { "AIF1 Playback", NULL, "SYSCLK" },
1796         { "AIF2 Playback", NULL, "SYSCLK" },
1797         { "AIF3 Playback", NULL, "SYSCLK" },
1798         { "Slim1 Playback", NULL, "SYSCLK" },
1799         { "Slim2 Playback", NULL, "SYSCLK" },
1800         { "Slim3 Playback", NULL, "SYSCLK" },
1801 
1802         { "AIF1 Capture", NULL, "SYSCLK" },
1803         { "AIF2 Capture", NULL, "SYSCLK" },
1804         { "AIF3 Capture", NULL, "SYSCLK" },
1805         { "Slim1 Capture", NULL, "SYSCLK" },
1806         { "Slim2 Capture", NULL, "SYSCLK" },
1807         { "Slim3 Capture", NULL, "SYSCLK" },
1808 
1809         { "Voice Control DSP", NULL, "DSP3" },
1810         { "Voice Control DSP", NULL, "SYSCLK" },
1811 
1812         { "IN1L PGA", NULL, "IN1L" },
1813         { "IN1R PGA", NULL, "IN1R" },
1814 
1815         { "IN2L PGA", NULL, "IN2L" },
1816         { "IN2R PGA", NULL, "IN2R" },
1817 
1818         { "IN3L PGA", NULL, "IN3L" },
1819         { "IN3R PGA", NULL, "IN3R" },
1820 
1821         { "IN4L PGA", NULL, "IN4L" },
1822         { "IN4R PGA", NULL, "IN4R" },
1823 
1824         ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
1825         ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
1826         ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"),
1827         ARIZONA_MIXER_ROUTES("OUT2R", "HPOUT2R"),
1828         ARIZONA_MIXER_ROUTES("OUT3L", "HPOUT3L"),
1829         ARIZONA_MIXER_ROUTES("OUT3R", "HPOUT3R"),
1830 
1831         ARIZONA_MIXER_ROUTES("OUT4L", "SPKOUTL"),
1832         ARIZONA_MIXER_ROUTES("OUT4R", "SPKOUTR"),
1833         ARIZONA_MIXER_ROUTES("OUT5L", "SPKDAT1L"),
1834         ARIZONA_MIXER_ROUTES("OUT5R", "SPKDAT1R"),
1835         ARIZONA_MIXER_ROUTES("OUT6L", "SPKDAT2L"),
1836         ARIZONA_MIXER_ROUTES("OUT6R", "SPKDAT2R"),
1837 
1838         ARIZONA_MIXER_ROUTES("PWM1 Driver", "PWM1"),
1839         ARIZONA_MIXER_ROUTES("PWM2 Driver", "PWM2"),
1840 
1841         ARIZONA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"),
1842         ARIZONA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"),
1843         ARIZONA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"),
1844         ARIZONA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"),
1845         ARIZONA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"),
1846         ARIZONA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"),
1847         ARIZONA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"),
1848         ARIZONA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"),
1849 
1850         ARIZONA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"),
1851         ARIZONA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"),
1852         ARIZONA_MIXER_ROUTES("AIF2TX3", "AIF2TX3"),
1853         ARIZONA_MIXER_ROUTES("AIF2TX4", "AIF2TX4"),
1854         ARIZONA_MIXER_ROUTES("AIF2TX5", "AIF2TX5"),
1855         ARIZONA_MIXER_ROUTES("AIF2TX6", "AIF2TX6"),
1856 
1857         ARIZONA_MIXER_ROUTES("AIF3TX1", "AIF3TX1"),
1858         ARIZONA_MIXER_ROUTES("AIF3TX2", "AIF3TX2"),
1859 
1860         ARIZONA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"),
1861         ARIZONA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"),
1862         ARIZONA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"),
1863         ARIZONA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"),
1864         ARIZONA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"),
1865         ARIZONA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"),
1866         ARIZONA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"),
1867         ARIZONA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"),
1868 
1869         ARIZONA_MIXER_ROUTES("EQ1", "EQ1"),
1870         ARIZONA_MIXER_ROUTES("EQ2", "EQ2"),
1871         ARIZONA_MIXER_ROUTES("EQ3", "EQ3"),
1872         ARIZONA_MIXER_ROUTES("EQ4", "EQ4"),
1873 
1874         ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"),
1875         ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"),
1876         ARIZONA_MIXER_ROUTES("DRC2L", "DRC2L"),
1877         ARIZONA_MIXER_ROUTES("DRC2R", "DRC2R"),
1878 
1879         ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"),
1880         ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"),
1881         ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"),
1882         ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"),
1883 
1884         ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Noise"),
1885         ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"),
1886 
1887         ARIZONA_MUX_ROUTES("ASRC1L", "ASRC1L"),
1888         ARIZONA_MUX_ROUTES("ASRC1R", "ASRC1R"),
1889         ARIZONA_MUX_ROUTES("ASRC2L", "ASRC2L"),
1890         ARIZONA_MUX_ROUTES("ASRC2R", "ASRC2R"),
1891 
1892         ARIZONA_DSP_ROUTES("DSP1"),
1893         ARIZONA_DSP_ROUTES("DSP2"),
1894         ARIZONA_DSP_ROUTES("DSP3"),
1895         ARIZONA_DSP_ROUTES("DSP4"),
1896 
1897         ARIZONA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"),
1898         ARIZONA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"),
1899         ARIZONA_MUX_ROUTES("ISRC1INT3", "ISRC1INT3"),
1900         ARIZONA_MUX_ROUTES("ISRC1INT4", "ISRC1INT4"),
1901 
1902         ARIZONA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"),
1903         ARIZONA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"),
1904         ARIZONA_MUX_ROUTES("ISRC1DEC3", "ISRC1DEC3"),
1905         ARIZONA_MUX_ROUTES("ISRC1DEC4", "ISRC1DEC4"),
1906 
1907         ARIZONA_MUX_ROUTES("ISRC2INT1", "ISRC2INT1"),
1908         ARIZONA_MUX_ROUTES("ISRC2INT2", "ISRC2INT2"),
1909         ARIZONA_MUX_ROUTES("ISRC2INT3", "ISRC2INT3"),
1910         ARIZONA_MUX_ROUTES("ISRC2INT4", "ISRC2INT4"),
1911 
1912         ARIZONA_MUX_ROUTES("ISRC2DEC1", "ISRC2DEC1"),
1913         ARIZONA_MUX_ROUTES("ISRC2DEC2", "ISRC2DEC2"),
1914         ARIZONA_MUX_ROUTES("ISRC2DEC3", "ISRC2DEC3"),
1915         ARIZONA_MUX_ROUTES("ISRC2DEC4", "ISRC2DEC4"),
1916 
1917         ARIZONA_MUX_ROUTES("ISRC3INT1", "ISRC3INT1"),
1918         ARIZONA_MUX_ROUTES("ISRC3INT2", "ISRC3INT2"),
1919         ARIZONA_MUX_ROUTES("ISRC3INT3", "ISRC3INT3"),
1920         ARIZONA_MUX_ROUTES("ISRC3INT4", "ISRC3INT4"),
1921 
1922         ARIZONA_MUX_ROUTES("ISRC3DEC1", "ISRC3DEC1"),
1923         ARIZONA_MUX_ROUTES("ISRC3DEC2", "ISRC3DEC2"),
1924         ARIZONA_MUX_ROUTES("ISRC3DEC3", "ISRC3DEC3"),
1925         ARIZONA_MUX_ROUTES("ISRC3DEC4", "ISRC3DEC4"),
1926 
1927         { "AEC Loopback", "HPOUT1L", "OUT1L" },
1928         { "AEC Loopback", "HPOUT1R", "OUT1R" },
1929         { "HPOUT1L", NULL, "OUT1L" },
1930         { "HPOUT1R", NULL, "OUT1R" },
1931 
1932         { "AEC Loopback", "HPOUT2L", "OUT2L" },
1933         { "AEC Loopback", "HPOUT2R", "OUT2R" },
1934         { "HPOUT2L", NULL, "OUT2L" },
1935         { "HPOUT2R", NULL, "OUT2R" },
1936 
1937         { "AEC Loopback", "HPOUT3L", "OUT3L" },
1938         { "AEC Loopback", "HPOUT3R", "OUT3R" },
1939         { "HPOUT3L", NULL, "OUT3L" },
1940         { "HPOUT3R", NULL, "OUT3R" },
1941 
1942         { "AEC Loopback", "SPKOUTL", "OUT4L" },
1943         { "SPKOUTLN", NULL, "OUT4L" },
1944         { "SPKOUTLP", NULL, "OUT4L" },
1945 
1946         { "AEC Loopback", "SPKOUTR", "OUT4R" },
1947         { "SPKOUTRN", NULL, "OUT4R" },
1948         { "SPKOUTRP", NULL, "OUT4R" },
1949 
1950         { "AEC Loopback", "SPKDAT1L", "OUT5L" },
1951         { "AEC Loopback", "SPKDAT1R", "OUT5R" },
1952         { "SPKDAT1L", NULL, "OUT5L" },
1953         { "SPKDAT1R", NULL, "OUT5R" },
1954 
1955         { "AEC Loopback", "SPKDAT2L", "OUT6L" },
1956         { "AEC Loopback", "SPKDAT2R", "OUT6R" },
1957         { "SPKDAT2L", NULL, "OUT6L" },
1958         { "SPKDAT2R", NULL, "OUT6R" },
1959 
1960         WM5110_RXANC_INPUT_ROUTES("RXANCL", "RXANCL"),
1961         WM5110_RXANC_INPUT_ROUTES("RXANCR", "RXANCR"),
1962 
1963         WM5110_RXANC_OUTPUT_ROUTES("OUT1L", "HPOUT1L"),
1964         WM5110_RXANC_OUTPUT_ROUTES("OUT1R", "HPOUT1R"),
1965         WM5110_RXANC_OUTPUT_ROUTES("OUT2L", "HPOUT2L"),
1966         WM5110_RXANC_OUTPUT_ROUTES("OUT2R", "HPOUT2R"),
1967         WM5110_RXANC_OUTPUT_ROUTES("OUT3L", "HPOUT3L"),
1968         WM5110_RXANC_OUTPUT_ROUTES("OUT3R", "HPOUT3R"),
1969         WM5110_RXANC_OUTPUT_ROUTES("OUT4L", "SPKOUTL"),
1970         WM5110_RXANC_OUTPUT_ROUTES("OUT4R", "SPKOUTR"),
1971         WM5110_RXANC_OUTPUT_ROUTES("OUT5L", "SPKDAT1L"),
1972         WM5110_RXANC_OUTPUT_ROUTES("OUT5R", "SPKDAT1R"),
1973         WM5110_RXANC_OUTPUT_ROUTES("OUT6L", "SPKDAT2L"),
1974         WM5110_RXANC_OUTPUT_ROUTES("OUT6R", "SPKDAT2R"),
1975 
1976         { "MICSUPP", NULL, "SYSCLK" },
1977 
1978         { "DRC1 Signal Activity", NULL, "DRC1L" },
1979         { "DRC1 Signal Activity", NULL, "DRC1R" },
1980         { "DRC2 Signal Activity", NULL, "DRC2L" },
1981         { "DRC2 Signal Activity", NULL, "DRC2R" },
1982 };
1983 
1984 static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
1985                           unsigned int Fref, unsigned int Fout)
1986 {
1987         struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec);
1988 
1989         switch (fll_id) {
1990         case WM5110_FLL1:
1991                 return arizona_set_fll(&wm5110->fll[0], source, Fref, Fout);
1992         case WM5110_FLL2:
1993                 return arizona_set_fll(&wm5110->fll[1], source, Fref, Fout);
1994         case WM5110_FLL1_REFCLK:
1995                 return arizona_set_fll_refclk(&wm5110->fll[0], source, Fref,
1996                                               Fout);
1997         case WM5110_FLL2_REFCLK:
1998                 return arizona_set_fll_refclk(&wm5110->fll[1], source, Fref,
1999                                               Fout);
2000         default:
2001                 return -EINVAL;
2002         }
2003 }
2004 
2005 #define WM5110_RATES SNDRV_PCM_RATE_8000_192000
2006 
2007 #define WM5110_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
2008                         SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
2009 
2010 static struct snd_soc_dai_driver wm5110_dai[] = {
2011         {
2012                 .name = "wm5110-aif1",
2013                 .id = 1,
2014                 .base = ARIZONA_AIF1_BCLK_CTRL,
2015                 .playback = {
2016                         .stream_name = "AIF1 Playback",
2017                         .channels_min = 1,
2018                         .channels_max = 8,
2019                         .rates = WM5110_RATES,
2020                         .formats = WM5110_FORMATS,
2021                 },
2022                 .capture = {
2023                          .stream_name = "AIF1 Capture",
2024                          .channels_min = 1,
2025                          .channels_max = 8,
2026                          .rates = WM5110_RATES,
2027                          .formats = WM5110_FORMATS,
2028                  },
2029                 .ops = &arizona_dai_ops,
2030                 .symmetric_rates = 1,
2031                 .symmetric_samplebits = 1,
2032         },
2033         {
2034                 .name = "wm5110-aif2",
2035                 .id = 2,
2036                 .base = ARIZONA_AIF2_BCLK_CTRL,
2037                 .playback = {
2038                         .stream_name = "AIF2 Playback",
2039                         .channels_min = 1,
2040                         .channels_max = 6,
2041                         .rates = WM5110_RATES,
2042                         .formats = WM5110_FORMATS,
2043                 },
2044                 .capture = {
2045                          .stream_name = "AIF2 Capture",
2046                          .channels_min = 1,
2047                          .channels_max = 6,
2048                          .rates = WM5110_RATES,
2049                          .formats = WM5110_FORMATS,
2050                  },
2051                 .ops = &arizona_dai_ops,
2052                 .symmetric_rates = 1,
2053                 .symmetric_samplebits = 1,
2054         },
2055         {
2056                 .name = "wm5110-aif3",
2057                 .id = 3,
2058                 .base = ARIZONA_AIF3_BCLK_CTRL,
2059                 .playback = {
2060                         .stream_name = "AIF3 Playback",
2061                         .channels_min = 1,
2062                         .channels_max = 2,
2063                         .rates = WM5110_RATES,
2064                         .formats = WM5110_FORMATS,
2065                 },
2066                 .capture = {
2067                          .stream_name = "AIF3 Capture",
2068                          .channels_min = 1,
2069                          .channels_max = 2,
2070                          .rates = WM5110_RATES,
2071                          .formats = WM5110_FORMATS,
2072                  },
2073                 .ops = &arizona_dai_ops,
2074                 .symmetric_rates = 1,
2075                 .symmetric_samplebits = 1,
2076         },
2077         {
2078                 .name = "wm5110-slim1",
2079                 .id = 4,
2080                 .playback = {
2081                         .stream_name = "Slim1 Playback",
2082                         .channels_min = 1,
2083                         .channels_max = 4,
2084                         .rates = WM5110_RATES,
2085                         .formats = WM5110_FORMATS,
2086                 },
2087                 .capture = {
2088                          .stream_name = "Slim1 Capture",
2089                          .channels_min = 1,
2090                          .channels_max = 4,
2091                          .rates = WM5110_RATES,
2092                          .formats = WM5110_FORMATS,
2093                  },
2094                 .ops = &arizona_simple_dai_ops,
2095         },
2096         {
2097                 .name = "wm5110-slim2",
2098                 .id = 5,
2099                 .playback = {
2100                         .stream_name = "Slim2 Playback",
2101                         .channels_min = 1,
2102                         .channels_max = 2,
2103                         .rates = WM5110_RATES,
2104                         .formats = WM5110_FORMATS,
2105                 },
2106                 .capture = {
2107                          .stream_name = "Slim2 Capture",
2108                          .channels_min = 1,
2109                          .channels_max = 2,
2110                          .rates = WM5110_RATES,
2111                          .formats = WM5110_FORMATS,
2112                  },
2113                 .ops = &arizona_simple_dai_ops,
2114         },
2115         {
2116                 .name = "wm5110-slim3",
2117                 .id = 6,
2118                 .playback = {
2119                         .stream_name = "Slim3 Playback",
2120                         .channels_min = 1,
2121                         .channels_max = 2,
2122                         .rates = WM5110_RATES,
2123                         .formats = WM5110_FORMATS,
2124                 },
2125                 .capture = {
2126                          .stream_name = "Slim3 Capture",
2127                          .channels_min = 1,
2128                          .channels_max = 2,
2129                          .rates = WM5110_RATES,
2130                          .formats = WM5110_FORMATS,
2131                  },
2132                 .ops = &arizona_simple_dai_ops,
2133         },
2134         {
2135                 .name = "wm5110-cpu-voicectrl",
2136                 .capture = {
2137                         .stream_name = "Voice Control CPU",
2138                         .channels_min = 1,
2139                         .channels_max = 1,
2140                         .rates = WM5110_RATES,
2141                         .formats = WM5110_FORMATS,
2142                 },
2143                 .compress_new = snd_soc_new_compress,
2144         },
2145         {
2146                 .name = "wm5110-dsp-voicectrl",
2147                 .capture = {
2148                         .stream_name = "Voice Control DSP",
2149                         .channels_min = 1,
2150                         .channels_max = 1,
2151                         .rates = WM5110_RATES,
2152                         .formats = WM5110_FORMATS,
2153                 },
2154         },
2155 };
2156 
2157 static int wm5110_open(struct snd_compr_stream *stream)
2158 {
2159         struct snd_soc_pcm_runtime *rtd = stream->private_data;
2160         struct wm5110_priv *priv = snd_soc_codec_get_drvdata(rtd->codec);
2161         struct arizona *arizona = priv->core.arizona;
2162         int n_adsp;
2163 
2164         if (strcmp(rtd->codec_dai->name, "wm5110-dsp-voicectrl") == 0) {
2165                 n_adsp = 2;
2166         } else {
2167                 dev_err(arizona->dev,
2168                         "No suitable compressed stream for DAI '%s'\n",
2169                         rtd->codec_dai->name);
2170                 return -EINVAL;
2171         }
2172 
2173         return wm_adsp_compr_open(&priv->core.adsp[n_adsp], stream);
2174 }
2175 
2176 static irqreturn_t wm5110_adsp2_irq(int irq, void *data)
2177 {
2178         struct wm5110_priv *florida = data;
2179         int ret;
2180 
2181         ret = wm_adsp_compr_handle_irq(&florida->core.adsp[2]);
2182         if (ret == -ENODEV)
2183                 return IRQ_NONE;
2184 
2185         return IRQ_HANDLED;
2186 }
2187 
2188 static int wm5110_codec_probe(struct snd_soc_codec *codec)
2189 {
2190         struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
2191         struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);
2192         struct arizona *arizona = priv->core.arizona;
2193         int i, ret;
2194 
2195         priv->core.arizona->dapm = dapm;
2196 
2197         arizona_init_spk(codec);
2198         arizona_init_gpio(codec);
2199         arizona_init_mono(codec);
2200 
2201         ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1,
2202                                   "ADSP2 Compressed IRQ", wm5110_adsp2_irq,
2203                                   priv);
2204         if (ret != 0) {
2205                 dev_err(codec->dev, "Failed to request DSP IRQ: %d\n", ret);
2206                 return ret;
2207         }
2208 
2209         for (i = 0; i < WM5110_NUM_ADSP; ++i) {
2210                 ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec);
2211                 if (ret)
2212                         goto err_adsp2_codec_probe;
2213         }
2214 
2215         ret = snd_soc_add_codec_controls(codec,
2216                                          arizona_adsp2_rate_controls,
2217                                          WM5110_NUM_ADSP);
2218         if (ret)
2219                 goto err_adsp2_codec_probe;
2220 
2221         snd_soc_dapm_disable_pin(dapm, "HAPTICS");
2222 
2223         return 0;
2224 
2225 err_adsp2_codec_probe:
2226         for (--i; i >= 0; --i)
2227                 wm_adsp2_codec_remove(&priv->core.adsp[i], codec);
2228 
2229         arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv);
2230 
2231         return ret;
2232 }
2233 
2234 static int wm5110_codec_remove(struct snd_soc_codec *codec)
2235 {
2236         struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);
2237         struct arizona *arizona = priv->core.arizona;
2238         int i;
2239 
2240         for (i = 0; i < WM5110_NUM_ADSP; ++i)
2241                 wm_adsp2_codec_remove(&priv->core.adsp[i], codec);
2242 
2243         priv->core.arizona->dapm = NULL;
2244 
2245         arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv);
2246 
2247         return 0;
2248 }
2249 
2250 #define WM5110_DIG_VU 0x0200
2251 
2252 static unsigned int wm5110_digital_vu[] = {
2253         ARIZONA_DAC_DIGITAL_VOLUME_1L,
2254         ARIZONA_DAC_DIGITAL_VOLUME_1R,
2255         ARIZONA_DAC_DIGITAL_VOLUME_2L,
2256         ARIZONA_DAC_DIGITAL_VOLUME_2R,
2257         ARIZONA_DAC_DIGITAL_VOLUME_3L,
2258         ARIZONA_DAC_DIGITAL_VOLUME_3R,
2259         ARIZONA_DAC_DIGITAL_VOLUME_4L,
2260         ARIZONA_DAC_DIGITAL_VOLUME_4R,
2261         ARIZONA_DAC_DIGITAL_VOLUME_5L,
2262         ARIZONA_DAC_DIGITAL_VOLUME_5R,
2263         ARIZONA_DAC_DIGITAL_VOLUME_6L,
2264         ARIZONA_DAC_DIGITAL_VOLUME_6R,
2265 };
2266 
2267 static struct regmap *wm5110_get_regmap(struct device *dev)
2268 {
2269         struct wm5110_priv *priv = dev_get_drvdata(dev);
2270 
2271         return priv->core.arizona->regmap;
2272 }
2273 
2274 static struct snd_soc_codec_driver soc_codec_dev_wm5110 = {
2275         .probe = wm5110_codec_probe,
2276         .remove = wm5110_codec_remove,
2277         .get_regmap = wm5110_get_regmap,
2278 
2279         .idle_bias_off = true,
2280 
2281         .set_sysclk = arizona_set_sysclk,
2282         .set_pll = wm5110_set_fll,
2283 
2284         .controls = wm5110_snd_controls,
2285         .num_controls = ARRAY_SIZE(wm5110_snd_controls),
2286         .dapm_widgets = wm5110_dapm_widgets,
2287         .num_dapm_widgets = ARRAY_SIZE(wm5110_dapm_widgets),
2288         .dapm_routes = wm5110_dapm_routes,
2289         .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes),
2290 };
2291 
2292 static struct snd_compr_ops wm5110_compr_ops = {
2293         .open = wm5110_open,
2294         .free = wm_adsp_compr_free,
2295         .set_params = wm_adsp_compr_set_params,
2296         .get_caps = wm_adsp_compr_get_caps,
2297         .trigger = wm_adsp_compr_trigger,
2298         .pointer = wm_adsp_compr_pointer,
2299         .copy = wm_adsp_compr_copy,
2300 };
2301 
2302 static struct snd_soc_platform_driver wm5110_compr_platform = {
2303         .compr_ops = &wm5110_compr_ops,
2304 };
2305 
2306 static int wm5110_probe(struct platform_device *pdev)
2307 {
2308         struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
2309         struct wm5110_priv *wm5110;
2310         int i, ret;
2311 
2312         wm5110 = devm_kzalloc(&pdev->dev, sizeof(struct wm5110_priv),
2313                               GFP_KERNEL);
2314         if (wm5110 == NULL)
2315                 return -ENOMEM;
2316         platform_set_drvdata(pdev, wm5110);
2317 
2318         wm5110->core.arizona = arizona;
2319         wm5110->core.num_inputs = 8;
2320 
2321         for (i = 0; i < WM5110_NUM_ADSP; i++) {
2322                 wm5110->core.adsp[i].part = "wm5110";
2323                 wm5110->core.adsp[i].num = i + 1;
2324                 wm5110->core.adsp[i].type = WMFW_ADSP2;
2325                 wm5110->core.adsp[i].dev = arizona->dev;
2326                 wm5110->core.adsp[i].regmap = arizona->regmap;
2327 
2328                 wm5110->core.adsp[i].base = ARIZONA_DSP1_CONTROL_1
2329                         + (0x100 * i);
2330                 wm5110->core.adsp[i].mem = wm5110_dsp_regions[i];
2331                 wm5110->core.adsp[i].num_mems
2332                         = ARRAY_SIZE(wm5110_dsp1_regions);
2333 
2334                 ret = wm_adsp2_init(&wm5110->core.adsp[i]);
2335                 if (ret != 0)
2336                         return ret;
2337         }
2338 
2339         for (i = 0; i < ARRAY_SIZE(wm5110->fll); i++)
2340                 wm5110->fll[i].vco_mult = 3;
2341 
2342         arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1,
2343                          ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK,
2344                          &wm5110->fll[0]);
2345         arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1,
2346                          ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK,
2347                          &wm5110->fll[1]);
2348 
2349         /* SR2 fixed at 8kHz, SR3 fixed at 16kHz */
2350         regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2,
2351                            ARIZONA_SAMPLE_RATE_2_MASK, 0x11);
2352         regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3,
2353                            ARIZONA_SAMPLE_RATE_3_MASK, 0x12);
2354 
2355         for (i = 0; i < ARRAY_SIZE(wm5110_dai); i++)
2356                 arizona_init_dai(&wm5110->core, i);
2357 
2358         /* Latch volume update bits */
2359         for (i = 0; i < ARRAY_SIZE(wm5110_digital_vu); i++)
2360                 regmap_update_bits(arizona->regmap, wm5110_digital_vu[i],
2361                                    WM5110_DIG_VU, WM5110_DIG_VU);
2362 
2363         pm_runtime_enable(&pdev->dev);
2364         pm_runtime_idle(&pdev->dev);
2365 
2366         ret = snd_soc_register_platform(&pdev->dev, &wm5110_compr_platform);
2367         if (ret < 0) {
2368                 dev_err(&pdev->dev, "Failed to register platform: %d\n", ret);
2369                 goto error;
2370         }
2371 
2372         ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm5110,
2373                                       wm5110_dai, ARRAY_SIZE(wm5110_dai));
2374         if (ret < 0) {
2375                 dev_err(&pdev->dev, "Failed to register codec: %d\n", ret);
2376                 snd_soc_unregister_platform(&pdev->dev);
2377         }
2378 
2379 error:
2380         return ret;
2381 }
2382 
2383 static int wm5110_remove(struct platform_device *pdev)
2384 {
2385         snd_soc_unregister_platform(&pdev->dev);
2386         snd_soc_unregister_codec(&pdev->dev);
2387         pm_runtime_disable(&pdev->dev);
2388 
2389         return 0;
2390 }
2391 
2392 static struct platform_driver wm5110_codec_driver = {
2393         .driver = {
2394                 .name = "wm5110-codec",
2395         },
2396         .probe = wm5110_probe,
2397         .remove = wm5110_remove,
2398 };
2399 
2400 module_platform_driver(wm5110_codec_driver);
2401 
2402 MODULE_DESCRIPTION("ASoC WM5110 driver");
2403 MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
2404 MODULE_LICENSE("GPL");
2405 MODULE_ALIAS("platform:wm5110-codec");
2406 

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us