xref: /openbmc/linux/sound/soc/codecs/cs47l85.c (revision b8265621)
1 // SPDX-License-Identifier: GPL-2.0-only
2 //
3 // ALSA SoC Audio driver for CS47L85 codec
4 //
5 // Copyright (C) 2015-2019 Cirrus Logic, Inc. and
6 //                         Cirrus Logic International Semiconductor Ltd.
7 //
8 
9 #include <linux/module.h>
10 #include <linux/moduleparam.h>
11 #include <linux/device.h>
12 #include <linux/delay.h>
13 #include <linux/init.h>
14 #include <linux/pm.h>
15 #include <linux/pm_runtime.h>
16 #include <linux/regmap.h>
17 #include <sound/core.h>
18 #include <sound/pcm.h>
19 #include <sound/pcm_params.h>
20 #include <sound/soc.h>
21 #include <sound/tlv.h>
22 
23 #include <linux/irqchip/irq-madera.h>
24 #include <linux/mfd/madera/core.h>
25 #include <linux/mfd/madera/registers.h>
26 
27 #include "madera.h"
28 #include "wm_adsp.h"
29 
30 #define DRV_NAME "cs47l85-codec"
31 
32 #define CS47L85_NUM_ADSP	7
33 #define CS47L85_MONO_OUTPUTS	4
34 
35 struct cs47l85 {
36 	struct madera_priv core;
37 	struct madera_fll fll[3];
38 };
39 
40 static const struct wm_adsp_region cs47l85_dsp1_regions[] = {
41 	{ .type = WMFW_ADSP2_PM, .base = 0x080000 },
42 	{ .type = WMFW_ADSP2_ZM, .base = 0x0e0000 },
43 	{ .type = WMFW_ADSP2_XM, .base = 0x0a0000 },
44 	{ .type = WMFW_ADSP2_YM, .base = 0x0c0000 },
45 };
46 
47 static const struct wm_adsp_region cs47l85_dsp2_regions[] = {
48 	{ .type = WMFW_ADSP2_PM, .base = 0x100000 },
49 	{ .type = WMFW_ADSP2_ZM, .base = 0x160000 },
50 	{ .type = WMFW_ADSP2_XM, .base = 0x120000 },
51 	{ .type = WMFW_ADSP2_YM, .base = 0x140000 },
52 };
53 
54 static const struct wm_adsp_region cs47l85_dsp3_regions[] = {
55 	{ .type = WMFW_ADSP2_PM, .base = 0x180000 },
56 	{ .type = WMFW_ADSP2_ZM, .base = 0x1e0000 },
57 	{ .type = WMFW_ADSP2_XM, .base = 0x1a0000 },
58 	{ .type = WMFW_ADSP2_YM, .base = 0x1c0000 },
59 };
60 
61 static const struct wm_adsp_region cs47l85_dsp4_regions[] = {
62 	{ .type = WMFW_ADSP2_PM, .base = 0x200000 },
63 	{ .type = WMFW_ADSP2_ZM, .base = 0x260000 },
64 	{ .type = WMFW_ADSP2_XM, .base = 0x220000 },
65 	{ .type = WMFW_ADSP2_YM, .base = 0x240000 },
66 };
67 
68 static const struct wm_adsp_region cs47l85_dsp5_regions[] = {
69 	{ .type = WMFW_ADSP2_PM, .base = 0x280000 },
70 	{ .type = WMFW_ADSP2_ZM, .base = 0x2e0000 },
71 	{ .type = WMFW_ADSP2_XM, .base = 0x2a0000 },
72 	{ .type = WMFW_ADSP2_YM, .base = 0x2c0000 },
73 };
74 
75 static const struct wm_adsp_region cs47l85_dsp6_regions[] = {
76 	{ .type = WMFW_ADSP2_PM, .base = 0x300000 },
77 	{ .type = WMFW_ADSP2_ZM, .base = 0x360000 },
78 	{ .type = WMFW_ADSP2_XM, .base = 0x320000 },
79 	{ .type = WMFW_ADSP2_YM, .base = 0x340000 },
80 };
81 
82 static const struct wm_adsp_region cs47l85_dsp7_regions[] = {
83 	{ .type = WMFW_ADSP2_PM, .base = 0x380000 },
84 	{ .type = WMFW_ADSP2_ZM, .base = 0x3e0000 },
85 	{ .type = WMFW_ADSP2_XM, .base = 0x3a0000 },
86 	{ .type = WMFW_ADSP2_YM, .base = 0x3c0000 },
87 };
88 
89 static const struct wm_adsp_region *cs47l85_dsp_regions[] = {
90 	cs47l85_dsp1_regions,
91 	cs47l85_dsp2_regions,
92 	cs47l85_dsp3_regions,
93 	cs47l85_dsp4_regions,
94 	cs47l85_dsp5_regions,
95 	cs47l85_dsp6_regions,
96 	cs47l85_dsp7_regions,
97 };
98 
99 static const unsigned int wm_adsp2_control_bases[] = {
100 	MADERA_DSP1_CONFIG_1,
101 	MADERA_DSP2_CONFIG_1,
102 	MADERA_DSP3_CONFIG_1,
103 	MADERA_DSP4_CONFIG_1,
104 	MADERA_DSP5_CONFIG_1,
105 	MADERA_DSP6_CONFIG_1,
106 	MADERA_DSP7_CONFIG_1,
107 };
108 
109 static int cs47l85_adsp_power_ev(struct snd_soc_dapm_widget *w,
110 				 struct snd_kcontrol *kcontrol,
111 				 int event)
112 {
113 	struct snd_soc_component *component =
114 		snd_soc_dapm_to_component(w->dapm);
115 	struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
116 	struct madera_priv *priv = &cs47l85->core;
117 	struct madera *madera = priv->madera;
118 	unsigned int freq;
119 	int ret;
120 
121 	ret = regmap_read(madera->regmap, MADERA_DSP_CLOCK_1, &freq);
122 	if (ret != 0) {
123 		dev_err(madera->dev,
124 			"Failed to read MADERA_DSP_CLOCK_1: %d\n", ret);
125 		return ret;
126 	}
127 
128 	freq &= MADERA_DSP_CLK_FREQ_LEGACY_MASK;
129 	freq >>= MADERA_DSP_CLK_FREQ_LEGACY_SHIFT;
130 
131 	switch (event) {
132 	case SND_SOC_DAPM_PRE_PMU:
133 		ret = madera_set_adsp_clk(&cs47l85->core, w->shift, freq);
134 		if (ret)
135 			return ret;
136 		break;
137 	default:
138 		break;
139 	}
140 
141 	return wm_adsp_early_event(w, kcontrol, event);
142 }
143 
144 #define CS47L85_NG_SRC(name, base) \
145 	SOC_SINGLE(name " NG HPOUT1L Switch",  base,  0, 1, 0), \
146 	SOC_SINGLE(name " NG HPOUT1R Switch",  base,  1, 1, 0), \
147 	SOC_SINGLE(name " NG HPOUT2L Switch",  base,  2, 1, 0), \
148 	SOC_SINGLE(name " NG HPOUT2R Switch",  base,  3, 1, 0), \
149 	SOC_SINGLE(name " NG HPOUT3L Switch",  base,  4, 1, 0), \
150 	SOC_SINGLE(name " NG HPOUT3R Switch",  base,  5, 1, 0), \
151 	SOC_SINGLE(name " NG SPKOUTL Switch",  base,  6, 1, 0), \
152 	SOC_SINGLE(name " NG SPKOUTR Switch",  base,  7, 1, 0), \
153 	SOC_SINGLE(name " NG SPKDAT1L Switch", base,  8, 1, 0), \
154 	SOC_SINGLE(name " NG SPKDAT1R Switch", base,  9, 1, 0), \
155 	SOC_SINGLE(name " NG SPKDAT2L Switch", base, 10, 1, 0), \
156 	SOC_SINGLE(name " NG SPKDAT2R Switch", base, 11, 1, 0)
157 
158 #define CS47L85_RXANC_INPUT_ROUTES(widget, name) \
159 	{ widget, NULL, name " NG Mux" }, \
160 	{ name " NG Internal", NULL, "RXANC NG Clock" }, \
161 	{ name " NG Internal", NULL, name " Channel" }, \
162 	{ name " NG External", NULL, "RXANC NG External Clock" }, \
163 	{ name " NG External", NULL, name " Channel" }, \
164 	{ name " NG Mux", "None", name " Channel" }, \
165 	{ name " NG Mux", "Internal", name " NG Internal" }, \
166 	{ name " NG Mux", "External", name " NG External" }, \
167 	{ name " Channel", "Left", name " Left Input" }, \
168 	{ name " Channel", "Combine", name " Left Input" }, \
169 	{ name " Channel", "Right", name " Right Input" }, \
170 	{ name " Channel", "Combine", name " Right Input" }, \
171 	{ name " Left Input", "IN1", "IN1L" }, \
172 	{ name " Right Input", "IN1", "IN1R" }, \
173 	{ name " Left Input", "IN2", "IN2L" }, \
174 	{ name " Right Input", "IN2", "IN2R" }, \
175 	{ name " Left Input", "IN3", "IN3L" }, \
176 	{ name " Right Input", "IN3", "IN3R" }, \
177 	{ name " Left Input", "IN4", "IN4L" }, \
178 	{ name " Right Input", "IN4", "IN4R" }, \
179 	{ name " Left Input", "IN5", "IN5L" }, \
180 	{ name " Right Input", "IN5", "IN5R" }, \
181 	{ name " Left Input", "IN6", "IN6L" }, \
182 	{ name " Right Input", "IN6", "IN6R" }
183 
184 #define CS47L85_RXANC_OUTPUT_ROUTES(widget, name) \
185 	{ widget, NULL, name " ANC Source" }, \
186 	{ name " ANC Source", "RXANCL", "RXANCL" }, \
187 	{ name " ANC Source", "RXANCR", "RXANCR" }
188 
189 static void cs47l85_hp_post_enable(struct snd_soc_dapm_widget *w)
190 {
191 	struct snd_soc_component *component =
192 		snd_soc_dapm_to_component(w->dapm);
193 	unsigned int val;
194 	int ret;
195 
196 	switch (w->shift) {
197 	case MADERA_OUT1L_ENA_SHIFT:
198 	case MADERA_OUT1R_ENA_SHIFT:
199 		ret = snd_soc_component_read(component, MADERA_OUTPUT_ENABLES_1,
200 					     &val);
201 		if (ret) {
202 			dev_err(component->dev,
203 				"Failed to check output enables: %d\n", ret);
204 			return;
205 		}
206 
207 		val &= (MADERA_OUT1L_ENA | MADERA_OUT1R_ENA);
208 
209 		if (val != (MADERA_OUT1L_ENA | MADERA_OUT1R_ENA))
210 			break;
211 
212 		snd_soc_component_update_bits(component,
213 					      MADERA_EDRE_HP_STEREO_CONTROL,
214 					      0x0001, 1);
215 		break;
216 	default:
217 		break;
218 	}
219 }
220 
221 static void cs47l85_hp_post_disable(struct snd_soc_dapm_widget *w)
222 {
223 	struct snd_soc_component *component =
224 		snd_soc_dapm_to_component(w->dapm);
225 
226 	switch (w->shift) {
227 	case MADERA_OUT1L_ENA_SHIFT:
228 		snd_soc_component_write(component, MADERA_DCS_HP1L_CONTROL,
229 					0x2006);
230 		break;
231 	case MADERA_OUT1R_ENA_SHIFT:
232 		snd_soc_component_write(component, MADERA_DCS_HP1R_CONTROL,
233 					0x2006);
234 		break;
235 	default:
236 		return;
237 	}
238 
239 	/* Only get to here for OUT1L and OUT1R */
240 	snd_soc_component_update_bits(component,
241 				      MADERA_EDRE_HP_STEREO_CONTROL,
242 				      0x0001, 0);
243 }
244 
245 static int cs47l85_hp_ev(struct snd_soc_dapm_widget *w,
246 			 struct snd_kcontrol *kcontrol, int event)
247 {
248 	int ret;
249 
250 	switch (event) {
251 	case SND_SOC_DAPM_PRE_PMU:
252 	case SND_SOC_DAPM_PRE_PMD:
253 		return madera_hp_ev(w, kcontrol, event);
254 	case SND_SOC_DAPM_POST_PMU:
255 		ret = madera_hp_ev(w, kcontrol, event);
256 		if (ret < 0)
257 			return ret;
258 
259 		cs47l85_hp_post_enable(w);
260 		return 0;
261 	case SND_SOC_DAPM_POST_PMD:
262 		ret = madera_hp_ev(w, kcontrol, event);
263 		cs47l85_hp_post_disable(w);
264 		return ret;
265 	default:
266 		return -EINVAL;
267 	}
268 }
269 
270 static const struct snd_kcontrol_new cs47l85_snd_controls[] = {
271 SOC_ENUM("IN1 OSR", madera_in_dmic_osr[0]),
272 SOC_ENUM("IN2 OSR", madera_in_dmic_osr[1]),
273 SOC_ENUM("IN3 OSR", madera_in_dmic_osr[2]),
274 SOC_ENUM("IN4 OSR", madera_in_dmic_osr[3]),
275 SOC_ENUM("IN5 OSR", madera_in_dmic_osr[4]),
276 SOC_ENUM("IN6 OSR", madera_in_dmic_osr[5]),
277 
278 SOC_SINGLE_RANGE_TLV("IN1L Volume", MADERA_IN1L_CONTROL,
279 		     MADERA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
280 SOC_SINGLE_RANGE_TLV("IN1R Volume", MADERA_IN1R_CONTROL,
281 		     MADERA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
282 SOC_SINGLE_RANGE_TLV("IN2L Volume", MADERA_IN2L_CONTROL,
283 		     MADERA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
284 SOC_SINGLE_RANGE_TLV("IN2R Volume", MADERA_IN2R_CONTROL,
285 		     MADERA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
286 SOC_SINGLE_RANGE_TLV("IN3L Volume", MADERA_IN3L_CONTROL,
287 		     MADERA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
288 SOC_SINGLE_RANGE_TLV("IN3R Volume", MADERA_IN3R_CONTROL,
289 		     MADERA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
290 
291 SOC_ENUM("IN HPF Cutoff Frequency", madera_in_hpf_cut_enum),
292 
293 SOC_SINGLE("IN1L HPF Switch", MADERA_IN1L_CONTROL,
294 	   MADERA_IN1L_HPF_SHIFT, 1, 0),
295 SOC_SINGLE("IN1R HPF Switch", MADERA_IN1R_CONTROL,
296 	   MADERA_IN1R_HPF_SHIFT, 1, 0),
297 SOC_SINGLE("IN2L HPF Switch", MADERA_IN2L_CONTROL,
298 	   MADERA_IN2L_HPF_SHIFT, 1, 0),
299 SOC_SINGLE("IN2R HPF Switch", MADERA_IN2R_CONTROL,
300 	   MADERA_IN2R_HPF_SHIFT, 1, 0),
301 SOC_SINGLE("IN3L HPF Switch", MADERA_IN3L_CONTROL,
302 	   MADERA_IN3L_HPF_SHIFT, 1, 0),
303 SOC_SINGLE("IN3R HPF Switch", MADERA_IN3R_CONTROL,
304 	   MADERA_IN3R_HPF_SHIFT, 1, 0),
305 SOC_SINGLE("IN4L HPF Switch", MADERA_IN4L_CONTROL,
306 	   MADERA_IN4L_HPF_SHIFT, 1, 0),
307 SOC_SINGLE("IN4R HPF Switch", MADERA_IN4R_CONTROL,
308 	   MADERA_IN4R_HPF_SHIFT, 1, 0),
309 SOC_SINGLE("IN5L HPF Switch", MADERA_IN5L_CONTROL,
310 	   MADERA_IN5L_HPF_SHIFT, 1, 0),
311 SOC_SINGLE("IN5R HPF Switch", MADERA_IN5R_CONTROL,
312 	   MADERA_IN5R_HPF_SHIFT, 1, 0),
313 SOC_SINGLE("IN6L HPF Switch", MADERA_IN6L_CONTROL,
314 	   MADERA_IN6L_HPF_SHIFT, 1, 0),
315 SOC_SINGLE("IN6R HPF Switch", MADERA_IN6R_CONTROL,
316 	   MADERA_IN6R_HPF_SHIFT, 1, 0),
317 
318 SOC_SINGLE_TLV("IN1L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_1L,
319 	       MADERA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
320 SOC_SINGLE_TLV("IN1R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_1R,
321 	       MADERA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
322 SOC_SINGLE_TLV("IN2L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_2L,
323 	       MADERA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
324 SOC_SINGLE_TLV("IN2R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_2R,
325 	       MADERA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
326 SOC_SINGLE_TLV("IN3L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_3L,
327 	       MADERA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
328 SOC_SINGLE_TLV("IN3R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_3R,
329 	       MADERA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
330 SOC_SINGLE_TLV("IN4L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_4L,
331 	       MADERA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
332 SOC_SINGLE_TLV("IN4R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_4R,
333 	       MADERA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
334 SOC_SINGLE_TLV("IN5L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_5L,
335 	       MADERA_IN5L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
336 SOC_SINGLE_TLV("IN5R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_5R,
337 	       MADERA_IN5R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
338 SOC_SINGLE_TLV("IN6L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_6L,
339 	       MADERA_IN6L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
340 SOC_SINGLE_TLV("IN6R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_6R,
341 	       MADERA_IN6R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
342 
343 SOC_ENUM("Input Ramp Up", madera_in_vi_ramp),
344 SOC_ENUM("Input Ramp Down", madera_in_vd_ramp),
345 
346 SND_SOC_BYTES("RXANC Coefficients", MADERA_ANC_COEFF_START,
347 	      MADERA_ANC_COEFF_END - MADERA_ANC_COEFF_START + 1),
348 SND_SOC_BYTES("RXANCL Config", MADERA_FCL_FILTER_CONTROL, 1),
349 SND_SOC_BYTES("RXANCL Coefficients", MADERA_FCL_COEFF_START,
350 	      MADERA_FCL_COEFF_END - MADERA_FCL_COEFF_START + 1),
351 SND_SOC_BYTES("RXANCR Config", MADERA_FCR_FILTER_CONTROL, 1),
352 SND_SOC_BYTES("RXANCR Coefficients", MADERA_FCR_COEFF_START,
353 	      MADERA_FCR_COEFF_END - MADERA_FCR_COEFF_START + 1),
354 
355 MADERA_MIXER_CONTROLS("EQ1", MADERA_EQ1MIX_INPUT_1_SOURCE),
356 MADERA_MIXER_CONTROLS("EQ2", MADERA_EQ2MIX_INPUT_1_SOURCE),
357 MADERA_MIXER_CONTROLS("EQ3", MADERA_EQ3MIX_INPUT_1_SOURCE),
358 MADERA_MIXER_CONTROLS("EQ4", MADERA_EQ4MIX_INPUT_1_SOURCE),
359 
360 MADERA_EQ_CONTROL("EQ1 Coefficients", MADERA_EQ1_2),
361 SOC_SINGLE_TLV("EQ1 B1 Volume", MADERA_EQ1_1, MADERA_EQ1_B1_GAIN_SHIFT,
362 	       24, 0, madera_eq_tlv),
363 SOC_SINGLE_TLV("EQ1 B2 Volume", MADERA_EQ1_1, MADERA_EQ1_B2_GAIN_SHIFT,
364 	       24, 0, madera_eq_tlv),
365 SOC_SINGLE_TLV("EQ1 B3 Volume", MADERA_EQ1_1, MADERA_EQ1_B3_GAIN_SHIFT,
366 	       24, 0, madera_eq_tlv),
367 SOC_SINGLE_TLV("EQ1 B4 Volume", MADERA_EQ1_2, MADERA_EQ1_B4_GAIN_SHIFT,
368 	       24, 0, madera_eq_tlv),
369 SOC_SINGLE_TLV("EQ1 B5 Volume", MADERA_EQ1_2, MADERA_EQ1_B5_GAIN_SHIFT,
370 	       24, 0, madera_eq_tlv),
371 
372 MADERA_EQ_CONTROL("EQ2 Coefficients", MADERA_EQ2_2),
373 SOC_SINGLE_TLV("EQ2 B1 Volume", MADERA_EQ2_1, MADERA_EQ2_B1_GAIN_SHIFT,
374 	       24, 0, madera_eq_tlv),
375 SOC_SINGLE_TLV("EQ2 B2 Volume", MADERA_EQ2_1, MADERA_EQ2_B2_GAIN_SHIFT,
376 	       24, 0, madera_eq_tlv),
377 SOC_SINGLE_TLV("EQ2 B3 Volume", MADERA_EQ2_1, MADERA_EQ2_B3_GAIN_SHIFT,
378 	       24, 0, madera_eq_tlv),
379 SOC_SINGLE_TLV("EQ2 B4 Volume", MADERA_EQ2_2, MADERA_EQ2_B4_GAIN_SHIFT,
380 	       24, 0, madera_eq_tlv),
381 SOC_SINGLE_TLV("EQ2 B5 Volume", MADERA_EQ2_2, MADERA_EQ2_B5_GAIN_SHIFT,
382 	       24, 0, madera_eq_tlv),
383 
384 MADERA_EQ_CONTROL("EQ3 Coefficients", MADERA_EQ3_2),
385 SOC_SINGLE_TLV("EQ3 B1 Volume", MADERA_EQ3_1, MADERA_EQ3_B1_GAIN_SHIFT,
386 	       24, 0, madera_eq_tlv),
387 SOC_SINGLE_TLV("EQ3 B2 Volume", MADERA_EQ3_1, MADERA_EQ3_B2_GAIN_SHIFT,
388 	       24, 0, madera_eq_tlv),
389 SOC_SINGLE_TLV("EQ3 B3 Volume", MADERA_EQ3_1, MADERA_EQ3_B3_GAIN_SHIFT,
390 	       24, 0, madera_eq_tlv),
391 SOC_SINGLE_TLV("EQ3 B4 Volume", MADERA_EQ3_2, MADERA_EQ3_B4_GAIN_SHIFT,
392 	       24, 0, madera_eq_tlv),
393 SOC_SINGLE_TLV("EQ3 B5 Volume", MADERA_EQ3_2, MADERA_EQ3_B5_GAIN_SHIFT,
394 	       24, 0, madera_eq_tlv),
395 
396 MADERA_EQ_CONTROL("EQ4 Coefficients", MADERA_EQ4_2),
397 SOC_SINGLE_TLV("EQ4 B1 Volume", MADERA_EQ4_1, MADERA_EQ4_B1_GAIN_SHIFT,
398 	       24, 0, madera_eq_tlv),
399 SOC_SINGLE_TLV("EQ4 B2 Volume", MADERA_EQ4_1, MADERA_EQ4_B2_GAIN_SHIFT,
400 	       24, 0, madera_eq_tlv),
401 SOC_SINGLE_TLV("EQ4 B3 Volume", MADERA_EQ4_1, MADERA_EQ4_B3_GAIN_SHIFT,
402 	       24, 0, madera_eq_tlv),
403 SOC_SINGLE_TLV("EQ4 B4 Volume", MADERA_EQ4_2, MADERA_EQ4_B4_GAIN_SHIFT,
404 	       24, 0, madera_eq_tlv),
405 SOC_SINGLE_TLV("EQ4 B5 Volume", MADERA_EQ4_2, MADERA_EQ4_B5_GAIN_SHIFT,
406 	       24, 0, madera_eq_tlv),
407 
408 MADERA_MIXER_CONTROLS("DRC1L", MADERA_DRC1LMIX_INPUT_1_SOURCE),
409 MADERA_MIXER_CONTROLS("DRC1R", MADERA_DRC1RMIX_INPUT_1_SOURCE),
410 MADERA_MIXER_CONTROLS("DRC2L", MADERA_DRC2LMIX_INPUT_1_SOURCE),
411 MADERA_MIXER_CONTROLS("DRC2R", MADERA_DRC2RMIX_INPUT_1_SOURCE),
412 
413 SND_SOC_BYTES_MASK("DRC1", MADERA_DRC1_CTRL1, 5,
414 		   MADERA_DRC1R_ENA | MADERA_DRC1L_ENA),
415 SND_SOC_BYTES_MASK("DRC2", MADERA_DRC2_CTRL1, 5,
416 		   MADERA_DRC2R_ENA | MADERA_DRC2L_ENA),
417 
418 MADERA_MIXER_CONTROLS("LHPF1", MADERA_HPLP1MIX_INPUT_1_SOURCE),
419 MADERA_MIXER_CONTROLS("LHPF2", MADERA_HPLP2MIX_INPUT_1_SOURCE),
420 MADERA_MIXER_CONTROLS("LHPF3", MADERA_HPLP3MIX_INPUT_1_SOURCE),
421 MADERA_MIXER_CONTROLS("LHPF4", MADERA_HPLP4MIX_INPUT_1_SOURCE),
422 
423 MADERA_LHPF_CONTROL("LHPF1 Coefficients", MADERA_HPLPF1_2),
424 MADERA_LHPF_CONTROL("LHPF2 Coefficients", MADERA_HPLPF2_2),
425 MADERA_LHPF_CONTROL("LHPF3 Coefficients", MADERA_HPLPF3_2),
426 MADERA_LHPF_CONTROL("LHPF4 Coefficients", MADERA_HPLPF4_2),
427 
428 SOC_ENUM("LHPF1 Mode", madera_lhpf1_mode),
429 SOC_ENUM("LHPF2 Mode", madera_lhpf2_mode),
430 SOC_ENUM("LHPF3 Mode", madera_lhpf3_mode),
431 SOC_ENUM("LHPF4 Mode", madera_lhpf4_mode),
432 
433 MADERA_RATE_ENUM("ISRC1 FSL", madera_isrc_fsl[0]),
434 MADERA_RATE_ENUM("ISRC2 FSL", madera_isrc_fsl[1]),
435 MADERA_RATE_ENUM("ISRC3 FSL", madera_isrc_fsl[2]),
436 MADERA_RATE_ENUM("ISRC4 FSL", madera_isrc_fsl[3]),
437 MADERA_RATE_ENUM("ISRC1 FSH", madera_isrc_fsh[0]),
438 MADERA_RATE_ENUM("ISRC2 FSH", madera_isrc_fsh[1]),
439 MADERA_RATE_ENUM("ISRC3 FSH", madera_isrc_fsh[2]),
440 MADERA_RATE_ENUM("ISRC4 FSH", madera_isrc_fsh[3]),
441 MADERA_RATE_ENUM("ASRC1 Rate 1", madera_asrc1_rate[0]),
442 MADERA_RATE_ENUM("ASRC1 Rate 2", madera_asrc1_rate[1]),
443 MADERA_RATE_ENUM("ASRC2 Rate 1", madera_asrc2_rate[0]),
444 MADERA_RATE_ENUM("ASRC2 Rate 2", madera_asrc2_rate[1]),
445 
446 WM_ADSP2_PRELOAD_SWITCH("DSP1", 1),
447 WM_ADSP2_PRELOAD_SWITCH("DSP2", 2),
448 WM_ADSP2_PRELOAD_SWITCH("DSP3", 3),
449 WM_ADSP2_PRELOAD_SWITCH("DSP4", 4),
450 WM_ADSP2_PRELOAD_SWITCH("DSP5", 5),
451 WM_ADSP2_PRELOAD_SWITCH("DSP6", 6),
452 WM_ADSP2_PRELOAD_SWITCH("DSP7", 7),
453 
454 MADERA_MIXER_CONTROLS("DSP1L", MADERA_DSP1LMIX_INPUT_1_SOURCE),
455 MADERA_MIXER_CONTROLS("DSP1R", MADERA_DSP1RMIX_INPUT_1_SOURCE),
456 MADERA_MIXER_CONTROLS("DSP2L", MADERA_DSP2LMIX_INPUT_1_SOURCE),
457 MADERA_MIXER_CONTROLS("DSP2R", MADERA_DSP2RMIX_INPUT_1_SOURCE),
458 MADERA_MIXER_CONTROLS("DSP3L", MADERA_DSP3LMIX_INPUT_1_SOURCE),
459 MADERA_MIXER_CONTROLS("DSP3R", MADERA_DSP3RMIX_INPUT_1_SOURCE),
460 MADERA_MIXER_CONTROLS("DSP4L", MADERA_DSP4LMIX_INPUT_1_SOURCE),
461 MADERA_MIXER_CONTROLS("DSP4R", MADERA_DSP4RMIX_INPUT_1_SOURCE),
462 MADERA_MIXER_CONTROLS("DSP5L", MADERA_DSP5LMIX_INPUT_1_SOURCE),
463 MADERA_MIXER_CONTROLS("DSP5R", MADERA_DSP5RMIX_INPUT_1_SOURCE),
464 MADERA_MIXER_CONTROLS("DSP6L", MADERA_DSP6LMIX_INPUT_1_SOURCE),
465 MADERA_MIXER_CONTROLS("DSP6R", MADERA_DSP6RMIX_INPUT_1_SOURCE),
466 MADERA_MIXER_CONTROLS("DSP7L", MADERA_DSP7LMIX_INPUT_1_SOURCE),
467 MADERA_MIXER_CONTROLS("DSP7R", MADERA_DSP7RMIX_INPUT_1_SOURCE),
468 
469 SOC_SINGLE_TLV("Noise Generator Volume", MADERA_COMFORT_NOISE_GENERATOR,
470 	       MADERA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, madera_noise_tlv),
471 
472 MADERA_MIXER_CONTROLS("HPOUT1L", MADERA_OUT1LMIX_INPUT_1_SOURCE),
473 MADERA_MIXER_CONTROLS("HPOUT1R", MADERA_OUT1RMIX_INPUT_1_SOURCE),
474 MADERA_MIXER_CONTROLS("HPOUT2L", MADERA_OUT2LMIX_INPUT_1_SOURCE),
475 MADERA_MIXER_CONTROLS("HPOUT2R", MADERA_OUT2RMIX_INPUT_1_SOURCE),
476 MADERA_MIXER_CONTROLS("HPOUT3L", MADERA_OUT3LMIX_INPUT_1_SOURCE),
477 MADERA_MIXER_CONTROLS("HPOUT3R", MADERA_OUT3RMIX_INPUT_1_SOURCE),
478 MADERA_MIXER_CONTROLS("SPKOUTL", MADERA_OUT4LMIX_INPUT_1_SOURCE),
479 MADERA_MIXER_CONTROLS("SPKOUTR", MADERA_OUT4RMIX_INPUT_1_SOURCE),
480 MADERA_MIXER_CONTROLS("SPKDAT1L", MADERA_OUT5LMIX_INPUT_1_SOURCE),
481 MADERA_MIXER_CONTROLS("SPKDAT1R", MADERA_OUT5RMIX_INPUT_1_SOURCE),
482 MADERA_MIXER_CONTROLS("SPKDAT2L", MADERA_OUT6LMIX_INPUT_1_SOURCE),
483 MADERA_MIXER_CONTROLS("SPKDAT2R", MADERA_OUT6RMIX_INPUT_1_SOURCE),
484 
485 SOC_SINGLE("HPOUT1 SC Protect Switch", MADERA_HP1_SHORT_CIRCUIT_CTRL,
486 	   MADERA_HP1_SC_ENA_SHIFT, 1, 0),
487 SOC_SINGLE("HPOUT2 SC Protect Switch", MADERA_HP2_SHORT_CIRCUIT_CTRL,
488 	   MADERA_HP2_SC_ENA_SHIFT, 1, 0),
489 SOC_SINGLE("HPOUT3 SC Protect Switch", MADERA_HP3_SHORT_CIRCUIT_CTRL,
490 	   MADERA_HP3_SC_ENA_SHIFT, 1, 0),
491 
492 SOC_SINGLE("SPKDAT1 High Performance Switch", MADERA_OUTPUT_PATH_CONFIG_5L,
493 	   MADERA_OUT5_OSR_SHIFT, 1, 0),
494 SOC_SINGLE("SPKDAT2 High Performance Switch", MADERA_OUTPUT_PATH_CONFIG_6L,
495 	   MADERA_OUT6_OSR_SHIFT, 1, 0),
496 
497 SOC_DOUBLE_R("HPOUT1 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_1L,
498 	     MADERA_DAC_DIGITAL_VOLUME_1R, MADERA_OUT1L_MUTE_SHIFT, 1, 1),
499 SOC_DOUBLE_R("HPOUT2 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_2L,
500 	     MADERA_DAC_DIGITAL_VOLUME_2R, MADERA_OUT2L_MUTE_SHIFT, 1, 1),
501 SOC_DOUBLE_R("HPOUT3 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_3L,
502 	     MADERA_DAC_DIGITAL_VOLUME_3R, MADERA_OUT3L_MUTE_SHIFT, 1, 1),
503 SOC_DOUBLE_R("Speaker Digital Switch", MADERA_DAC_DIGITAL_VOLUME_4L,
504 	     MADERA_DAC_DIGITAL_VOLUME_4R, MADERA_OUT4L_MUTE_SHIFT, 1, 1),
505 SOC_DOUBLE_R("SPKDAT1 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_5L,
506 	     MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_OUT5L_MUTE_SHIFT, 1, 1),
507 SOC_DOUBLE_R("SPKDAT2 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_6L,
508 	     MADERA_DAC_DIGITAL_VOLUME_6R, MADERA_OUT6L_MUTE_SHIFT, 1, 1),
509 
510 SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_1L,
511 		 MADERA_DAC_DIGITAL_VOLUME_1R, MADERA_OUT1L_VOL_SHIFT,
512 		 0xbf, 0, madera_digital_tlv),
513 SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_2L,
514 		 MADERA_DAC_DIGITAL_VOLUME_2R, MADERA_OUT2L_VOL_SHIFT,
515 		 0xbf, 0, madera_digital_tlv),
516 SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_3L,
517 		 MADERA_DAC_DIGITAL_VOLUME_3R, MADERA_OUT3L_VOL_SHIFT,
518 		 0xbf, 0, madera_digital_tlv),
519 SOC_DOUBLE_R_TLV("Speaker Digital Volume", MADERA_DAC_DIGITAL_VOLUME_4L,
520 		 MADERA_DAC_DIGITAL_VOLUME_4R, MADERA_OUT4L_VOL_SHIFT,
521 		 0xbf, 0, madera_digital_tlv),
522 SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_5L,
523 		 MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_OUT5L_VOL_SHIFT,
524 		 0xbf, 0, madera_digital_tlv),
525 SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_6L,
526 		 MADERA_DAC_DIGITAL_VOLUME_6R, MADERA_OUT6L_VOL_SHIFT,
527 		 0xbf, 0, madera_digital_tlv),
528 
529 SOC_DOUBLE("SPKDAT1 Switch", MADERA_PDM_SPK1_CTRL_1, MADERA_SPK1L_MUTE_SHIFT,
530 	   MADERA_SPK1R_MUTE_SHIFT, 1, 1),
531 SOC_DOUBLE("SPKDAT2 Switch", MADERA_PDM_SPK2_CTRL_1, MADERA_SPK2L_MUTE_SHIFT,
532 	   MADERA_SPK2R_MUTE_SHIFT, 1, 1),
533 
534 SOC_ENUM("Output Ramp Up", madera_out_vi_ramp),
535 SOC_ENUM("Output Ramp Down", madera_out_vd_ramp),
536 
537 SOC_SINGLE("Noise Gate Switch", MADERA_NOISE_GATE_CONTROL,
538 	   MADERA_NGATE_ENA_SHIFT, 1, 0),
539 SOC_SINGLE_TLV("Noise Gate Threshold Volume", MADERA_NOISE_GATE_CONTROL,
540 	       MADERA_NGATE_THR_SHIFT, 7, 1, madera_ng_tlv),
541 SOC_ENUM("Noise Gate Hold", madera_ng_hold),
542 
543 CS47L85_NG_SRC("HPOUT1L", MADERA_NOISE_GATE_SELECT_1L),
544 CS47L85_NG_SRC("HPOUT1R", MADERA_NOISE_GATE_SELECT_1R),
545 CS47L85_NG_SRC("HPOUT2L", MADERA_NOISE_GATE_SELECT_2L),
546 CS47L85_NG_SRC("HPOUT2R", MADERA_NOISE_GATE_SELECT_2R),
547 CS47L85_NG_SRC("HPOUT3L", MADERA_NOISE_GATE_SELECT_3L),
548 CS47L85_NG_SRC("HPOUT3R", MADERA_NOISE_GATE_SELECT_3R),
549 CS47L85_NG_SRC("SPKOUTL", MADERA_NOISE_GATE_SELECT_4L),
550 CS47L85_NG_SRC("SPKOUTR", MADERA_NOISE_GATE_SELECT_4R),
551 CS47L85_NG_SRC("SPKDAT1L", MADERA_NOISE_GATE_SELECT_5L),
552 CS47L85_NG_SRC("SPKDAT1R", MADERA_NOISE_GATE_SELECT_5R),
553 CS47L85_NG_SRC("SPKDAT2L", MADERA_NOISE_GATE_SELECT_6L),
554 CS47L85_NG_SRC("SPKDAT2R", MADERA_NOISE_GATE_SELECT_6R),
555 
556 MADERA_MIXER_CONTROLS("AIF1TX1", MADERA_AIF1TX1MIX_INPUT_1_SOURCE),
557 MADERA_MIXER_CONTROLS("AIF1TX2", MADERA_AIF1TX2MIX_INPUT_1_SOURCE),
558 MADERA_MIXER_CONTROLS("AIF1TX3", MADERA_AIF1TX3MIX_INPUT_1_SOURCE),
559 MADERA_MIXER_CONTROLS("AIF1TX4", MADERA_AIF1TX4MIX_INPUT_1_SOURCE),
560 MADERA_MIXER_CONTROLS("AIF1TX5", MADERA_AIF1TX5MIX_INPUT_1_SOURCE),
561 MADERA_MIXER_CONTROLS("AIF1TX6", MADERA_AIF1TX6MIX_INPUT_1_SOURCE),
562 MADERA_MIXER_CONTROLS("AIF1TX7", MADERA_AIF1TX7MIX_INPUT_1_SOURCE),
563 MADERA_MIXER_CONTROLS("AIF1TX8", MADERA_AIF1TX8MIX_INPUT_1_SOURCE),
564 
565 MADERA_MIXER_CONTROLS("AIF2TX1", MADERA_AIF2TX1MIX_INPUT_1_SOURCE),
566 MADERA_MIXER_CONTROLS("AIF2TX2", MADERA_AIF2TX2MIX_INPUT_1_SOURCE),
567 MADERA_MIXER_CONTROLS("AIF2TX3", MADERA_AIF2TX3MIX_INPUT_1_SOURCE),
568 MADERA_MIXER_CONTROLS("AIF2TX4", MADERA_AIF2TX4MIX_INPUT_1_SOURCE),
569 MADERA_MIXER_CONTROLS("AIF2TX5", MADERA_AIF2TX5MIX_INPUT_1_SOURCE),
570 MADERA_MIXER_CONTROLS("AIF2TX6", MADERA_AIF2TX6MIX_INPUT_1_SOURCE),
571 MADERA_MIXER_CONTROLS("AIF2TX7", MADERA_AIF2TX7MIX_INPUT_1_SOURCE),
572 MADERA_MIXER_CONTROLS("AIF2TX8", MADERA_AIF2TX8MIX_INPUT_1_SOURCE),
573 
574 MADERA_MIXER_CONTROLS("AIF3TX1", MADERA_AIF3TX1MIX_INPUT_1_SOURCE),
575 MADERA_MIXER_CONTROLS("AIF3TX2", MADERA_AIF3TX2MIX_INPUT_1_SOURCE),
576 
577 MADERA_MIXER_CONTROLS("AIF4TX1", MADERA_AIF4TX1MIX_INPUT_1_SOURCE),
578 MADERA_MIXER_CONTROLS("AIF4TX2", MADERA_AIF4TX2MIX_INPUT_1_SOURCE),
579 
580 MADERA_MIXER_CONTROLS("SLIMTX1", MADERA_SLIMTX1MIX_INPUT_1_SOURCE),
581 MADERA_MIXER_CONTROLS("SLIMTX2", MADERA_SLIMTX2MIX_INPUT_1_SOURCE),
582 MADERA_MIXER_CONTROLS("SLIMTX3", MADERA_SLIMTX3MIX_INPUT_1_SOURCE),
583 MADERA_MIXER_CONTROLS("SLIMTX4", MADERA_SLIMTX4MIX_INPUT_1_SOURCE),
584 MADERA_MIXER_CONTROLS("SLIMTX5", MADERA_SLIMTX5MIX_INPUT_1_SOURCE),
585 MADERA_MIXER_CONTROLS("SLIMTX6", MADERA_SLIMTX6MIX_INPUT_1_SOURCE),
586 MADERA_MIXER_CONTROLS("SLIMTX7", MADERA_SLIMTX7MIX_INPUT_1_SOURCE),
587 MADERA_MIXER_CONTROLS("SLIMTX8", MADERA_SLIMTX8MIX_INPUT_1_SOURCE),
588 
589 MADERA_GAINMUX_CONTROLS("SPDIF1TX1", MADERA_SPDIF1TX1MIX_INPUT_1_SOURCE),
590 MADERA_GAINMUX_CONTROLS("SPDIF1TX2", MADERA_SPDIF1TX2MIX_INPUT_1_SOURCE),
591 
592 WM_ADSP_FW_CONTROL("DSP1", 0),
593 WM_ADSP_FW_CONTROL("DSP2", 1),
594 WM_ADSP_FW_CONTROL("DSP3", 2),
595 WM_ADSP_FW_CONTROL("DSP4", 3),
596 WM_ADSP_FW_CONTROL("DSP5", 4),
597 WM_ADSP_FW_CONTROL("DSP6", 5),
598 WM_ADSP_FW_CONTROL("DSP7", 6),
599 };
600 
601 MADERA_MIXER_ENUMS(EQ1, MADERA_EQ1MIX_INPUT_1_SOURCE);
602 MADERA_MIXER_ENUMS(EQ2, MADERA_EQ2MIX_INPUT_1_SOURCE);
603 MADERA_MIXER_ENUMS(EQ3, MADERA_EQ3MIX_INPUT_1_SOURCE);
604 MADERA_MIXER_ENUMS(EQ4, MADERA_EQ4MIX_INPUT_1_SOURCE);
605 
606 MADERA_MIXER_ENUMS(DRC1L, MADERA_DRC1LMIX_INPUT_1_SOURCE);
607 MADERA_MIXER_ENUMS(DRC1R, MADERA_DRC1RMIX_INPUT_1_SOURCE);
608 MADERA_MIXER_ENUMS(DRC2L, MADERA_DRC2LMIX_INPUT_1_SOURCE);
609 MADERA_MIXER_ENUMS(DRC2R, MADERA_DRC2RMIX_INPUT_1_SOURCE);
610 
611 MADERA_MIXER_ENUMS(LHPF1, MADERA_HPLP1MIX_INPUT_1_SOURCE);
612 MADERA_MIXER_ENUMS(LHPF2, MADERA_HPLP2MIX_INPUT_1_SOURCE);
613 MADERA_MIXER_ENUMS(LHPF3, MADERA_HPLP3MIX_INPUT_1_SOURCE);
614 MADERA_MIXER_ENUMS(LHPF4, MADERA_HPLP4MIX_INPUT_1_SOURCE);
615 
616 MADERA_MIXER_ENUMS(DSP1L, MADERA_DSP1LMIX_INPUT_1_SOURCE);
617 MADERA_MIXER_ENUMS(DSP1R, MADERA_DSP1RMIX_INPUT_1_SOURCE);
618 MADERA_DSP_AUX_ENUMS(DSP1, MADERA_DSP1AUX1MIX_INPUT_1_SOURCE);
619 
620 MADERA_MIXER_ENUMS(DSP2L, MADERA_DSP2LMIX_INPUT_1_SOURCE);
621 MADERA_MIXER_ENUMS(DSP2R, MADERA_DSP2RMIX_INPUT_1_SOURCE);
622 MADERA_DSP_AUX_ENUMS(DSP2, MADERA_DSP2AUX1MIX_INPUT_1_SOURCE);
623 
624 MADERA_MIXER_ENUMS(DSP3L, MADERA_DSP3LMIX_INPUT_1_SOURCE);
625 MADERA_MIXER_ENUMS(DSP3R, MADERA_DSP3RMIX_INPUT_1_SOURCE);
626 MADERA_DSP_AUX_ENUMS(DSP3, MADERA_DSP3AUX1MIX_INPUT_1_SOURCE);
627 
628 MADERA_MIXER_ENUMS(DSP4L, MADERA_DSP4LMIX_INPUT_1_SOURCE);
629 MADERA_MIXER_ENUMS(DSP4R, MADERA_DSP4RMIX_INPUT_1_SOURCE);
630 MADERA_DSP_AUX_ENUMS(DSP4, MADERA_DSP4AUX1MIX_INPUT_1_SOURCE);
631 
632 MADERA_MIXER_ENUMS(DSP5L, MADERA_DSP5LMIX_INPUT_1_SOURCE);
633 MADERA_MIXER_ENUMS(DSP5R, MADERA_DSP5RMIX_INPUT_1_SOURCE);
634 MADERA_DSP_AUX_ENUMS(DSP5, MADERA_DSP5AUX1MIX_INPUT_1_SOURCE);
635 
636 MADERA_MIXER_ENUMS(DSP6L, MADERA_DSP6LMIX_INPUT_1_SOURCE);
637 MADERA_MIXER_ENUMS(DSP6R, MADERA_DSP6RMIX_INPUT_1_SOURCE);
638 MADERA_DSP_AUX_ENUMS(DSP6, MADERA_DSP6AUX1MIX_INPUT_1_SOURCE);
639 
640 MADERA_MIXER_ENUMS(DSP7L, MADERA_DSP7LMIX_INPUT_1_SOURCE);
641 MADERA_MIXER_ENUMS(DSP7R, MADERA_DSP7RMIX_INPUT_1_SOURCE);
642 MADERA_DSP_AUX_ENUMS(DSP7, MADERA_DSP7AUX1MIX_INPUT_1_SOURCE);
643 
644 MADERA_MIXER_ENUMS(PWM1, MADERA_PWM1MIX_INPUT_1_SOURCE);
645 MADERA_MIXER_ENUMS(PWM2, MADERA_PWM2MIX_INPUT_1_SOURCE);
646 
647 MADERA_MIXER_ENUMS(OUT1L, MADERA_OUT1LMIX_INPUT_1_SOURCE);
648 MADERA_MIXER_ENUMS(OUT1R, MADERA_OUT1RMIX_INPUT_1_SOURCE);
649 MADERA_MIXER_ENUMS(OUT2L, MADERA_OUT2LMIX_INPUT_1_SOURCE);
650 MADERA_MIXER_ENUMS(OUT2R, MADERA_OUT2RMIX_INPUT_1_SOURCE);
651 MADERA_MIXER_ENUMS(OUT3L, MADERA_OUT3LMIX_INPUT_1_SOURCE);
652 MADERA_MIXER_ENUMS(OUT3R, MADERA_OUT3RMIX_INPUT_1_SOURCE);
653 MADERA_MIXER_ENUMS(SPKOUTL, MADERA_OUT4LMIX_INPUT_1_SOURCE);
654 MADERA_MIXER_ENUMS(SPKOUTR, MADERA_OUT4RMIX_INPUT_1_SOURCE);
655 MADERA_MIXER_ENUMS(SPKDAT1L, MADERA_OUT5LMIX_INPUT_1_SOURCE);
656 MADERA_MIXER_ENUMS(SPKDAT1R, MADERA_OUT5RMIX_INPUT_1_SOURCE);
657 MADERA_MIXER_ENUMS(SPKDAT2L, MADERA_OUT6LMIX_INPUT_1_SOURCE);
658 MADERA_MIXER_ENUMS(SPKDAT2R, MADERA_OUT6RMIX_INPUT_1_SOURCE);
659 
660 MADERA_MIXER_ENUMS(AIF1TX1, MADERA_AIF1TX1MIX_INPUT_1_SOURCE);
661 MADERA_MIXER_ENUMS(AIF1TX2, MADERA_AIF1TX2MIX_INPUT_1_SOURCE);
662 MADERA_MIXER_ENUMS(AIF1TX3, MADERA_AIF1TX3MIX_INPUT_1_SOURCE);
663 MADERA_MIXER_ENUMS(AIF1TX4, MADERA_AIF1TX4MIX_INPUT_1_SOURCE);
664 MADERA_MIXER_ENUMS(AIF1TX5, MADERA_AIF1TX5MIX_INPUT_1_SOURCE);
665 MADERA_MIXER_ENUMS(AIF1TX6, MADERA_AIF1TX6MIX_INPUT_1_SOURCE);
666 MADERA_MIXER_ENUMS(AIF1TX7, MADERA_AIF1TX7MIX_INPUT_1_SOURCE);
667 MADERA_MIXER_ENUMS(AIF1TX8, MADERA_AIF1TX8MIX_INPUT_1_SOURCE);
668 
669 MADERA_MIXER_ENUMS(AIF2TX1, MADERA_AIF2TX1MIX_INPUT_1_SOURCE);
670 MADERA_MIXER_ENUMS(AIF2TX2, MADERA_AIF2TX2MIX_INPUT_1_SOURCE);
671 MADERA_MIXER_ENUMS(AIF2TX3, MADERA_AIF2TX3MIX_INPUT_1_SOURCE);
672 MADERA_MIXER_ENUMS(AIF2TX4, MADERA_AIF2TX4MIX_INPUT_1_SOURCE);
673 MADERA_MIXER_ENUMS(AIF2TX5, MADERA_AIF2TX5MIX_INPUT_1_SOURCE);
674 MADERA_MIXER_ENUMS(AIF2TX6, MADERA_AIF2TX6MIX_INPUT_1_SOURCE);
675 MADERA_MIXER_ENUMS(AIF2TX7, MADERA_AIF2TX7MIX_INPUT_1_SOURCE);
676 MADERA_MIXER_ENUMS(AIF2TX8, MADERA_AIF2TX8MIX_INPUT_1_SOURCE);
677 
678 MADERA_MIXER_ENUMS(AIF3TX1, MADERA_AIF3TX1MIX_INPUT_1_SOURCE);
679 MADERA_MIXER_ENUMS(AIF3TX2, MADERA_AIF3TX2MIX_INPUT_1_SOURCE);
680 
681 MADERA_MIXER_ENUMS(AIF4TX1, MADERA_AIF4TX1MIX_INPUT_1_SOURCE);
682 MADERA_MIXER_ENUMS(AIF4TX2, MADERA_AIF4TX2MIX_INPUT_1_SOURCE);
683 
684 MADERA_MIXER_ENUMS(SLIMTX1, MADERA_SLIMTX1MIX_INPUT_1_SOURCE);
685 MADERA_MIXER_ENUMS(SLIMTX2, MADERA_SLIMTX2MIX_INPUT_1_SOURCE);
686 MADERA_MIXER_ENUMS(SLIMTX3, MADERA_SLIMTX3MIX_INPUT_1_SOURCE);
687 MADERA_MIXER_ENUMS(SLIMTX4, MADERA_SLIMTX4MIX_INPUT_1_SOURCE);
688 MADERA_MIXER_ENUMS(SLIMTX5, MADERA_SLIMTX5MIX_INPUT_1_SOURCE);
689 MADERA_MIXER_ENUMS(SLIMTX6, MADERA_SLIMTX6MIX_INPUT_1_SOURCE);
690 MADERA_MIXER_ENUMS(SLIMTX7, MADERA_SLIMTX7MIX_INPUT_1_SOURCE);
691 MADERA_MIXER_ENUMS(SLIMTX8, MADERA_SLIMTX8MIX_INPUT_1_SOURCE);
692 
693 MADERA_MUX_ENUMS(SPD1TX1, MADERA_SPDIF1TX1MIX_INPUT_1_SOURCE);
694 MADERA_MUX_ENUMS(SPD1TX2, MADERA_SPDIF1TX2MIX_INPUT_1_SOURCE);
695 
696 MADERA_MUX_ENUMS(ASRC1IN1L, MADERA_ASRC1_1LMIX_INPUT_1_SOURCE);
697 MADERA_MUX_ENUMS(ASRC1IN1R, MADERA_ASRC1_1RMIX_INPUT_1_SOURCE);
698 MADERA_MUX_ENUMS(ASRC1IN2L, MADERA_ASRC1_2LMIX_INPUT_1_SOURCE);
699 MADERA_MUX_ENUMS(ASRC1IN2R, MADERA_ASRC1_2RMIX_INPUT_1_SOURCE);
700 MADERA_MUX_ENUMS(ASRC2IN1L, MADERA_ASRC2_1LMIX_INPUT_1_SOURCE);
701 MADERA_MUX_ENUMS(ASRC2IN1R, MADERA_ASRC2_1RMIX_INPUT_1_SOURCE);
702 MADERA_MUX_ENUMS(ASRC2IN2L, MADERA_ASRC2_2LMIX_INPUT_1_SOURCE);
703 MADERA_MUX_ENUMS(ASRC2IN2R, MADERA_ASRC2_2RMIX_INPUT_1_SOURCE);
704 
705 MADERA_MUX_ENUMS(ISRC1INT1, MADERA_ISRC1INT1MIX_INPUT_1_SOURCE);
706 MADERA_MUX_ENUMS(ISRC1INT2, MADERA_ISRC1INT2MIX_INPUT_1_SOURCE);
707 MADERA_MUX_ENUMS(ISRC1INT3, MADERA_ISRC1INT3MIX_INPUT_1_SOURCE);
708 MADERA_MUX_ENUMS(ISRC1INT4, MADERA_ISRC1INT4MIX_INPUT_1_SOURCE);
709 
710 MADERA_MUX_ENUMS(ISRC1DEC1, MADERA_ISRC1DEC1MIX_INPUT_1_SOURCE);
711 MADERA_MUX_ENUMS(ISRC1DEC2, MADERA_ISRC1DEC2MIX_INPUT_1_SOURCE);
712 MADERA_MUX_ENUMS(ISRC1DEC3, MADERA_ISRC1DEC3MIX_INPUT_1_SOURCE);
713 MADERA_MUX_ENUMS(ISRC1DEC4, MADERA_ISRC1DEC4MIX_INPUT_1_SOURCE);
714 
715 MADERA_MUX_ENUMS(ISRC2INT1, MADERA_ISRC2INT1MIX_INPUT_1_SOURCE);
716 MADERA_MUX_ENUMS(ISRC2INT2, MADERA_ISRC2INT2MIX_INPUT_1_SOURCE);
717 MADERA_MUX_ENUMS(ISRC2INT3, MADERA_ISRC2INT3MIX_INPUT_1_SOURCE);
718 MADERA_MUX_ENUMS(ISRC2INT4, MADERA_ISRC2INT4MIX_INPUT_1_SOURCE);
719 
720 MADERA_MUX_ENUMS(ISRC2DEC1, MADERA_ISRC2DEC1MIX_INPUT_1_SOURCE);
721 MADERA_MUX_ENUMS(ISRC2DEC2, MADERA_ISRC2DEC2MIX_INPUT_1_SOURCE);
722 MADERA_MUX_ENUMS(ISRC2DEC3, MADERA_ISRC2DEC3MIX_INPUT_1_SOURCE);
723 MADERA_MUX_ENUMS(ISRC2DEC4, MADERA_ISRC2DEC4MIX_INPUT_1_SOURCE);
724 
725 MADERA_MUX_ENUMS(ISRC3INT1, MADERA_ISRC3INT1MIX_INPUT_1_SOURCE);
726 MADERA_MUX_ENUMS(ISRC3INT2, MADERA_ISRC3INT2MIX_INPUT_1_SOURCE);
727 
728 MADERA_MUX_ENUMS(ISRC3DEC1, MADERA_ISRC3DEC1MIX_INPUT_1_SOURCE);
729 MADERA_MUX_ENUMS(ISRC3DEC2, MADERA_ISRC3DEC2MIX_INPUT_1_SOURCE);
730 
731 MADERA_MUX_ENUMS(ISRC4INT1, MADERA_ISRC4INT1MIX_INPUT_1_SOURCE);
732 MADERA_MUX_ENUMS(ISRC4INT2, MADERA_ISRC4INT2MIX_INPUT_1_SOURCE);
733 
734 MADERA_MUX_ENUMS(ISRC4DEC1, MADERA_ISRC4DEC1MIX_INPUT_1_SOURCE);
735 MADERA_MUX_ENUMS(ISRC4DEC2, MADERA_ISRC4DEC2MIX_INPUT_1_SOURCE);
736 
737 static const char * const cs47l85_aec_loopback_texts[] = {
738 	"HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R",
739 	"SPKOUTL", "SPKOUTR", "SPKDAT1L", "SPKDAT1R", "SPKDAT2L", "SPKDAT2R",
740 };
741 
742 static const unsigned int cs47l85_aec_loopback_values[] = {
743 	0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
744 };
745 
746 static const struct soc_enum cs47l85_aec1_loopback =
747 	SOC_VALUE_ENUM_SINGLE(MADERA_DAC_AEC_CONTROL_1,
748 			      MADERA_AEC1_LOOPBACK_SRC_SHIFT, 0xf,
749 			      ARRAY_SIZE(cs47l85_aec_loopback_texts),
750 			      cs47l85_aec_loopback_texts,
751 			      cs47l85_aec_loopback_values);
752 
753 static const struct soc_enum cs47l85_aec2_loopback =
754 	SOC_VALUE_ENUM_SINGLE(MADERA_DAC_AEC_CONTROL_2,
755 			      MADERA_AEC2_LOOPBACK_SRC_SHIFT, 0xf,
756 			      ARRAY_SIZE(cs47l85_aec_loopback_texts),
757 			      cs47l85_aec_loopback_texts,
758 			      cs47l85_aec_loopback_values);
759 
760 static const struct snd_kcontrol_new cs47l85_aec_loopback_mux[] = {
761 	SOC_DAPM_ENUM("AEC1 Loopback", cs47l85_aec1_loopback),
762 	SOC_DAPM_ENUM("AEC2 Loopback", cs47l85_aec2_loopback),
763 };
764 
765 static const struct snd_kcontrol_new cs47l85_anc_input_mux[] = {
766 	SOC_DAPM_ENUM("RXANCL Input", madera_anc_input_src[0]),
767 	SOC_DAPM_ENUM("RXANCL Channel", madera_anc_input_src[1]),
768 	SOC_DAPM_ENUM("RXANCR Input", madera_anc_input_src[2]),
769 	SOC_DAPM_ENUM("RXANCR Channel", madera_anc_input_src[3]),
770 };
771 
772 static const struct snd_kcontrol_new cs47l85_anc_ng_mux =
773 	SOC_DAPM_ENUM("RXANC NG Source", madera_anc_ng_enum);
774 
775 static const struct snd_kcontrol_new cs47l85_output_anc_src[] = {
776 	SOC_DAPM_ENUM("HPOUT1L ANC Source", madera_output_anc_src[0]),
777 	SOC_DAPM_ENUM("HPOUT1R ANC Source", madera_output_anc_src[1]),
778 	SOC_DAPM_ENUM("HPOUT2L ANC Source", madera_output_anc_src[2]),
779 	SOC_DAPM_ENUM("HPOUT2R ANC Source", madera_output_anc_src[3]),
780 	SOC_DAPM_ENUM("HPOUT3L ANC Source", madera_output_anc_src[4]),
781 	SOC_DAPM_ENUM("HPOUT3R ANC Source", madera_output_anc_src[5]),
782 	SOC_DAPM_ENUM("SPKOUTL ANC Source", madera_output_anc_src[6]),
783 	SOC_DAPM_ENUM("SPKOUTR ANC Source", madera_output_anc_src[7]),
784 	SOC_DAPM_ENUM("SPKDAT1L ANC Source", madera_output_anc_src[8]),
785 	SOC_DAPM_ENUM("SPKDAT1R ANC Source", madera_output_anc_src[9]),
786 	SOC_DAPM_ENUM("SPKDAT2L ANC Source", madera_output_anc_src[10]),
787 	SOC_DAPM_ENUM("SPKDAT2R ANC Source", madera_output_anc_src[11]),
788 };
789 
790 static const struct snd_soc_dapm_widget cs47l85_dapm_widgets[] = {
791 SND_SOC_DAPM_SUPPLY("SYSCLK", MADERA_SYSTEM_CLOCK_1, MADERA_SYSCLK_ENA_SHIFT,
792 		    0, madera_sysclk_ev,
793 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU |
794 		    SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD),
795 SND_SOC_DAPM_SUPPLY("ASYNCCLK", MADERA_ASYNC_CLOCK_1,
796 		    MADERA_ASYNC_CLK_ENA_SHIFT, 0, madera_clk_ev,
797 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
798 SND_SOC_DAPM_SUPPLY("OPCLK", MADERA_OUTPUT_SYSTEM_CLOCK,
799 		    MADERA_OPCLK_ENA_SHIFT, 0, NULL, 0),
800 SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", MADERA_OUTPUT_ASYNC_CLOCK,
801 		    MADERA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0),
802 SND_SOC_DAPM_SUPPLY("DSPCLK", MADERA_DSP_CLOCK_1, MADERA_DSP_CLK_ENA_SHIFT,
803 		    0, madera_clk_ev,
804 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
805 
806 SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0),
807 SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD3", 0, 0),
808 SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD4", 0, 0),
809 SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD1", 20, 0),
810 SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD2", 20, 0),
811 SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS),
812 SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDL", 0, 0),
813 SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0),
814 
815 SND_SOC_DAPM_SUPPLY("MICBIAS1", MADERA_MIC_BIAS_CTRL_1,
816 		    MADERA_MICB1_ENA_SHIFT, 0, NULL, 0),
817 SND_SOC_DAPM_SUPPLY("MICBIAS2", MADERA_MIC_BIAS_CTRL_2,
818 		    MADERA_MICB1_ENA_SHIFT, 0, NULL, 0),
819 SND_SOC_DAPM_SUPPLY("MICBIAS3", MADERA_MIC_BIAS_CTRL_3,
820 		    MADERA_MICB1_ENA_SHIFT, 0, NULL, 0),
821 SND_SOC_DAPM_SUPPLY("MICBIAS4", MADERA_MIC_BIAS_CTRL_4,
822 		    MADERA_MICB1_ENA_SHIFT, 0, NULL, 0),
823 
824 SND_SOC_DAPM_SUPPLY("FXCLK", SND_SOC_NOPM,
825 		    MADERA_DOM_GRP_FX, 0,
826 		    madera_domain_clk_ev,
827 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
828 SND_SOC_DAPM_SUPPLY("ASRC1CLK", SND_SOC_NOPM,
829 		    MADERA_DOM_GRP_ASRC1, 0,
830 		    madera_domain_clk_ev,
831 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
832 SND_SOC_DAPM_SUPPLY("ASRC2CLK", SND_SOC_NOPM,
833 		    MADERA_DOM_GRP_ASRC2, 0,
834 		    madera_domain_clk_ev,
835 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
836 SND_SOC_DAPM_SUPPLY("ISRC1CLK", SND_SOC_NOPM,
837 		    MADERA_DOM_GRP_ISRC1, 0,
838 		    madera_domain_clk_ev,
839 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
840 SND_SOC_DAPM_SUPPLY("ISRC2CLK", SND_SOC_NOPM,
841 		    MADERA_DOM_GRP_ISRC2, 0,
842 		    madera_domain_clk_ev,
843 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
844 SND_SOC_DAPM_SUPPLY("ISRC3CLK", SND_SOC_NOPM,
845 		    MADERA_DOM_GRP_ISRC3, 0,
846 		    madera_domain_clk_ev,
847 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
848 SND_SOC_DAPM_SUPPLY("ISRC4CLK", SND_SOC_NOPM,
849 		    MADERA_DOM_GRP_ISRC4, 0,
850 		    madera_domain_clk_ev,
851 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
852 SND_SOC_DAPM_SUPPLY("OUTCLK", SND_SOC_NOPM,
853 		    MADERA_DOM_GRP_OUT, 0,
854 		    madera_domain_clk_ev,
855 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
856 SND_SOC_DAPM_SUPPLY("SPDCLK", SND_SOC_NOPM,
857 		    MADERA_DOM_GRP_SPD, 0,
858 		    madera_domain_clk_ev,
859 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
860 SND_SOC_DAPM_SUPPLY("DSP1CLK", SND_SOC_NOPM,
861 		    MADERA_DOM_GRP_DSP1, 0,
862 		    madera_domain_clk_ev,
863 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
864 SND_SOC_DAPM_SUPPLY("DSP2CLK", SND_SOC_NOPM,
865 		    MADERA_DOM_GRP_DSP2, 0,
866 		    madera_domain_clk_ev,
867 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
868 SND_SOC_DAPM_SUPPLY("DSP3CLK", SND_SOC_NOPM,
869 		    MADERA_DOM_GRP_DSP3, 0,
870 		    madera_domain_clk_ev,
871 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
872 SND_SOC_DAPM_SUPPLY("DSP4CLK", SND_SOC_NOPM,
873 		    MADERA_DOM_GRP_DSP4, 0,
874 		    madera_domain_clk_ev,
875 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
876 SND_SOC_DAPM_SUPPLY("DSP5CLK", SND_SOC_NOPM,
877 		    MADERA_DOM_GRP_DSP5, 0,
878 		    madera_domain_clk_ev,
879 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
880 SND_SOC_DAPM_SUPPLY("DSP6CLK", SND_SOC_NOPM,
881 		    MADERA_DOM_GRP_DSP6, 0,
882 		    madera_domain_clk_ev,
883 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
884 SND_SOC_DAPM_SUPPLY("DSP7CLK", SND_SOC_NOPM,
885 		    MADERA_DOM_GRP_DSP7, 0,
886 		    madera_domain_clk_ev,
887 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
888 SND_SOC_DAPM_SUPPLY("AIF1TXCLK", SND_SOC_NOPM,
889 		    MADERA_DOM_GRP_AIF1, 0,
890 		    madera_domain_clk_ev,
891 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
892 SND_SOC_DAPM_SUPPLY("AIF2TXCLK", SND_SOC_NOPM,
893 		    MADERA_DOM_GRP_AIF2, 0,
894 		    madera_domain_clk_ev,
895 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
896 SND_SOC_DAPM_SUPPLY("AIF3TXCLK", SND_SOC_NOPM,
897 		    MADERA_DOM_GRP_AIF3, 0,
898 		    madera_domain_clk_ev,
899 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
900 SND_SOC_DAPM_SUPPLY("AIF4TXCLK", SND_SOC_NOPM,
901 		    MADERA_DOM_GRP_AIF4, 0,
902 		    madera_domain_clk_ev,
903 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
904 SND_SOC_DAPM_SUPPLY("SLIMBUSCLK", SND_SOC_NOPM,
905 		    MADERA_DOM_GRP_SLIMBUS, 0,
906 		    madera_domain_clk_ev,
907 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
908 SND_SOC_DAPM_SUPPLY("PWMCLK", SND_SOC_NOPM,
909 		    MADERA_DOM_GRP_PWM, 0,
910 		    madera_domain_clk_ev,
911 		    SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
912 
913 SND_SOC_DAPM_SUPPLY("RXANC NG External Clock", SND_SOC_NOPM,
914 		    MADERA_EXT_NG_SEL_SET_SHIFT, 0, madera_anc_ev,
915 		    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
916 
917 SND_SOC_DAPM_SUPPLY("RXANC NG Clock", SND_SOC_NOPM,
918 		    MADERA_CLK_NG_ENA_SET_SHIFT, 0, madera_anc_ev,
919 		    SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
920 
921 SND_SOC_DAPM_SIGGEN("TONE"),
922 SND_SOC_DAPM_SIGGEN("NOISE"),
923 
924 SND_SOC_DAPM_INPUT("IN1ALN"),
925 SND_SOC_DAPM_INPUT("IN1ALP"),
926 SND_SOC_DAPM_INPUT("IN1BN"),
927 SND_SOC_DAPM_INPUT("IN1BP"),
928 SND_SOC_DAPM_INPUT("IN1RN"),
929 SND_SOC_DAPM_INPUT("IN1RP"),
930 SND_SOC_DAPM_INPUT("IN2ALN"),
931 SND_SOC_DAPM_INPUT("IN2ALP"),
932 SND_SOC_DAPM_INPUT("IN2ARN"),
933 SND_SOC_DAPM_INPUT("IN2ARP"),
934 SND_SOC_DAPM_INPUT("IN2BLN"),
935 SND_SOC_DAPM_INPUT("IN2BLP"),
936 SND_SOC_DAPM_INPUT("IN2BRN"),
937 SND_SOC_DAPM_INPUT("IN2BRP"),
938 SND_SOC_DAPM_INPUT("IN3LN"),
939 SND_SOC_DAPM_INPUT("IN3LP"),
940 SND_SOC_DAPM_INPUT("IN3RN"),
941 SND_SOC_DAPM_INPUT("IN3RP"),
942 SND_SOC_DAPM_INPUT("DMICCLK4"),
943 SND_SOC_DAPM_INPUT("DMICDAT4"),
944 SND_SOC_DAPM_INPUT("DMICCLK5"),
945 SND_SOC_DAPM_INPUT("DMICDAT5"),
946 SND_SOC_DAPM_INPUT("DMICCLK6"),
947 SND_SOC_DAPM_INPUT("DMICDAT6"),
948 
949 SND_SOC_DAPM_MUX("IN1L Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[0]),
950 SND_SOC_DAPM_MUX("IN2L Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[2]),
951 SND_SOC_DAPM_MUX("IN2R Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[3]),
952 
953 SND_SOC_DAPM_MUX("IN1L Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[0]),
954 SND_SOC_DAPM_MUX("IN1R Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[0]),
955 
956 SND_SOC_DAPM_MUX("IN2L Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[1]),
957 SND_SOC_DAPM_MUX("IN2R Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[1]),
958 
959 SND_SOC_DAPM_MUX("IN3L Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[2]),
960 SND_SOC_DAPM_MUX("IN3R Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[2]),
961 
962 SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"),
963 SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"),
964 
965 SND_SOC_DAPM_OUTPUT("DSP Trigger Out"),
966 
967 SND_SOC_DAPM_PGA("PWM1 Driver", MADERA_PWM_DRIVE_1, MADERA_PWM1_ENA_SHIFT,
968 		 0, NULL, 0),
969 SND_SOC_DAPM_PGA("PWM2 Driver", MADERA_PWM_DRIVE_1, MADERA_PWM2_ENA_SHIFT,
970 		 0, NULL, 0),
971 
972 SND_SOC_DAPM_PGA("RXANCL NG External", SND_SOC_NOPM, 0, 0, NULL, 0),
973 SND_SOC_DAPM_PGA("RXANCR NG External", SND_SOC_NOPM, 0, 0, NULL, 0),
974 
975 SND_SOC_DAPM_PGA("RXANCL NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0),
976 SND_SOC_DAPM_PGA("RXANCR NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0),
977 
978 SND_SOC_DAPM_MUX("RXANCL Left Input", SND_SOC_NOPM, 0, 0,
979 		 &cs47l85_anc_input_mux[0]),
980 SND_SOC_DAPM_MUX("RXANCL Right Input", SND_SOC_NOPM, 0, 0,
981 		 &cs47l85_anc_input_mux[0]),
982 SND_SOC_DAPM_MUX("RXANCL Channel", SND_SOC_NOPM, 0, 0,
983 		 &cs47l85_anc_input_mux[1]),
984 SND_SOC_DAPM_MUX("RXANCL NG Mux", SND_SOC_NOPM, 0, 0, &cs47l85_anc_ng_mux),
985 SND_SOC_DAPM_MUX("RXANCR Left Input", SND_SOC_NOPM, 0, 0,
986 		 &cs47l85_anc_input_mux[2]),
987 SND_SOC_DAPM_MUX("RXANCR Right Input", SND_SOC_NOPM, 0, 0,
988 		 &cs47l85_anc_input_mux[2]),
989 SND_SOC_DAPM_MUX("RXANCR Channel", SND_SOC_NOPM, 0, 0,
990 		 &cs47l85_anc_input_mux[3]),
991 SND_SOC_DAPM_MUX("RXANCR NG Mux", SND_SOC_NOPM, 0, 0, &cs47l85_anc_ng_mux),
992 
993 SND_SOC_DAPM_PGA_E("RXANCL", SND_SOC_NOPM, MADERA_CLK_L_ENA_SET_SHIFT,
994 		   0, NULL, 0, madera_anc_ev,
995 		   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
996 SND_SOC_DAPM_PGA_E("RXANCR", SND_SOC_NOPM, MADERA_CLK_R_ENA_SET_SHIFT,
997 		   0, NULL, 0, madera_anc_ev,
998 		   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
999 
1000 SND_SOC_DAPM_MUX("HPOUT1L ANC Source", SND_SOC_NOPM, 0, 0,
1001 		 &cs47l85_output_anc_src[0]),
1002 SND_SOC_DAPM_MUX("HPOUT1R ANC Source", SND_SOC_NOPM, 0, 0,
1003 		 &cs47l85_output_anc_src[1]),
1004 SND_SOC_DAPM_MUX("HPOUT2L ANC Source", SND_SOC_NOPM, 0, 0,
1005 		 &cs47l85_output_anc_src[2]),
1006 SND_SOC_DAPM_MUX("HPOUT2R ANC Source", SND_SOC_NOPM, 0, 0,
1007 		 &cs47l85_output_anc_src[3]),
1008 SND_SOC_DAPM_MUX("HPOUT3L ANC Source", SND_SOC_NOPM, 0, 0,
1009 		 &cs47l85_output_anc_src[4]),
1010 SND_SOC_DAPM_MUX("HPOUT3R ANC Source", SND_SOC_NOPM, 0, 0,
1011 		 &cs47l85_output_anc_src[5]),
1012 SND_SOC_DAPM_MUX("SPKOUTL ANC Source", SND_SOC_NOPM, 0, 0,
1013 		 &cs47l85_output_anc_src[6]),
1014 SND_SOC_DAPM_MUX("SPKOUTR ANC Source", SND_SOC_NOPM, 0, 0,
1015 		 &cs47l85_output_anc_src[7]),
1016 SND_SOC_DAPM_MUX("SPKDAT1L ANC Source", SND_SOC_NOPM, 0, 0,
1017 		 &cs47l85_output_anc_src[8]),
1018 SND_SOC_DAPM_MUX("SPKDAT1R ANC Source", SND_SOC_NOPM, 0, 0,
1019 		 &cs47l85_output_anc_src[9]),
1020 SND_SOC_DAPM_MUX("SPKDAT2L ANC Source", SND_SOC_NOPM, 0, 0,
1021 		 &cs47l85_output_anc_src[10]),
1022 SND_SOC_DAPM_MUX("SPKDAT2R ANC Source", SND_SOC_NOPM, 0, 0,
1023 		 &cs47l85_output_anc_src[11]),
1024 
1025 SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0,
1026 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX1_ENA_SHIFT, 0),
1027 SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0,
1028 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX2_ENA_SHIFT, 0),
1029 SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0,
1030 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX3_ENA_SHIFT, 0),
1031 SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0,
1032 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX4_ENA_SHIFT, 0),
1033 SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0,
1034 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX5_ENA_SHIFT, 0),
1035 SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0,
1036 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX6_ENA_SHIFT, 0),
1037 SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0,
1038 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX7_ENA_SHIFT, 0),
1039 SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0,
1040 		     MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX8_ENA_SHIFT, 0),
1041 
1042 SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0,
1043 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX1_ENA_SHIFT, 0),
1044 SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0,
1045 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX2_ENA_SHIFT, 0),
1046 SND_SOC_DAPM_AIF_OUT("AIF2TX3", NULL, 0,
1047 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX3_ENA_SHIFT, 0),
1048 SND_SOC_DAPM_AIF_OUT("AIF2TX4", NULL, 0,
1049 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX4_ENA_SHIFT, 0),
1050 SND_SOC_DAPM_AIF_OUT("AIF2TX5", NULL, 0,
1051 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX5_ENA_SHIFT, 0),
1052 SND_SOC_DAPM_AIF_OUT("AIF2TX6", NULL, 0,
1053 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX6_ENA_SHIFT, 0),
1054 SND_SOC_DAPM_AIF_OUT("AIF2TX7", NULL, 0,
1055 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX7_ENA_SHIFT, 0),
1056 SND_SOC_DAPM_AIF_OUT("AIF2TX8", NULL, 0,
1057 		     MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX8_ENA_SHIFT, 0),
1058 
1059 SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0,
1060 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1061 		     MADERA_SLIMTX1_ENA_SHIFT, 0),
1062 SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0,
1063 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1064 		     MADERA_SLIMTX2_ENA_SHIFT, 0),
1065 SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0,
1066 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1067 		     MADERA_SLIMTX3_ENA_SHIFT, 0),
1068 SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0,
1069 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1070 		     MADERA_SLIMTX4_ENA_SHIFT, 0),
1071 SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0,
1072 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1073 		     MADERA_SLIMTX5_ENA_SHIFT, 0),
1074 SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0,
1075 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1076 		     MADERA_SLIMTX6_ENA_SHIFT, 0),
1077 SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0,
1078 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1079 		     MADERA_SLIMTX7_ENA_SHIFT, 0),
1080 SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0,
1081 		     MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
1082 		     MADERA_SLIMTX8_ENA_SHIFT, 0),
1083 
1084 SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0,
1085 		     MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX1_ENA_SHIFT, 0),
1086 SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 0,
1087 		     MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX2_ENA_SHIFT, 0),
1088 
1089 SND_SOC_DAPM_AIF_OUT("AIF4TX1", NULL, 0,
1090 		     MADERA_AIF4_TX_ENABLES, MADERA_AIF4TX1_ENA_SHIFT, 0),
1091 SND_SOC_DAPM_AIF_OUT("AIF4TX2", NULL, 0,
1092 		     MADERA_AIF4_TX_ENABLES, MADERA_AIF4TX2_ENA_SHIFT, 0),
1093 
1094 SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
1095 		   MADERA_OUT1L_ENA_SHIFT, 0, NULL, 0, cs47l85_hp_ev,
1096 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1097 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1098 SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM,
1099 		   MADERA_OUT1R_ENA_SHIFT, 0, NULL, 0, cs47l85_hp_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_PGA_E("OUT2L", MADERA_OUTPUT_ENABLES_1,
1103 		   MADERA_OUT2L_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1104 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1105 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1106 SND_SOC_DAPM_PGA_E("OUT2R", MADERA_OUTPUT_ENABLES_1,
1107 		   MADERA_OUT2R_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1108 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1109 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1110 SND_SOC_DAPM_PGA_E("OUT3L", MADERA_OUTPUT_ENABLES_1,
1111 		   MADERA_OUT3L_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1112 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1113 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1114 SND_SOC_DAPM_PGA_E("OUT3R", MADERA_OUTPUT_ENABLES_1,
1115 		   MADERA_OUT3R_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1116 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1117 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1118 SND_SOC_DAPM_PGA_E("OUT4L", SND_SOC_NOPM,
1119 		   MADERA_OUT4L_ENA_SHIFT, 0, NULL, 0, madera_spk_ev,
1120 		   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1121 SND_SOC_DAPM_PGA_E("OUT4R", SND_SOC_NOPM,
1122 		   MADERA_OUT4R_ENA_SHIFT, 0, NULL, 0, madera_spk_ev,
1123 		   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
1124 SND_SOC_DAPM_PGA_E("OUT5L", MADERA_OUTPUT_ENABLES_1,
1125 		   MADERA_OUT5L_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1126 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1127 SND_SOC_DAPM_PGA_E("OUT5R", MADERA_OUTPUT_ENABLES_1,
1128 		   MADERA_OUT5R_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1129 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1130 SND_SOC_DAPM_PGA_E("OUT6L", MADERA_OUTPUT_ENABLES_1,
1131 		   MADERA_OUT6L_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1132 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1133 SND_SOC_DAPM_PGA_E("OUT6R", MADERA_OUTPUT_ENABLES_1,
1134 		   MADERA_OUT6R_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
1135 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
1136 
1137 SND_SOC_DAPM_PGA("SPD1TX1", MADERA_SPD1_TX_CONTROL,
1138 		 MADERA_SPD1_VAL1_SHIFT, 0, NULL, 0),
1139 SND_SOC_DAPM_PGA("SPD1TX2", MADERA_SPD1_TX_CONTROL,
1140 		 MADERA_SPD1_VAL2_SHIFT, 0, NULL, 0),
1141 SND_SOC_DAPM_OUT_DRV("SPD1", MADERA_SPD1_TX_CONTROL,
1142 		     MADERA_SPD1_ENA_SHIFT, 0, NULL, 0),
1143 
1144 /*
1145  * Input mux widgets arranged in order of sources in MADERA_MIXER_INPUT_ROUTES
1146  * to take advantage of cache lookup in DAPM
1147  */
1148 SND_SOC_DAPM_PGA("Noise Generator", MADERA_COMFORT_NOISE_GENERATOR,
1149 		 MADERA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0),
1150 
1151 SND_SOC_DAPM_PGA("Tone Generator 1", MADERA_TONE_GENERATOR_1,
1152 		 MADERA_TONE1_ENA_SHIFT, 0, NULL, 0),
1153 SND_SOC_DAPM_PGA("Tone Generator 2", MADERA_TONE_GENERATOR_1,
1154 		 MADERA_TONE2_ENA_SHIFT, 0, NULL, 0),
1155 
1156 SND_SOC_DAPM_SIGGEN("HAPTICS"),
1157 
1158 SND_SOC_DAPM_MUX("AEC1 Loopback", MADERA_DAC_AEC_CONTROL_1,
1159 		 MADERA_AEC1_LOOPBACK_ENA_SHIFT, 0,
1160 		 &cs47l85_aec_loopback_mux[0]),
1161 SND_SOC_DAPM_MUX("AEC2 Loopback", MADERA_DAC_AEC_CONTROL_2,
1162 		 MADERA_AEC2_LOOPBACK_ENA_SHIFT, 0,
1163 		 &cs47l85_aec_loopback_mux[1]),
1164 
1165 SND_SOC_DAPM_PGA_E("IN1L", MADERA_INPUT_ENABLES, MADERA_IN1L_ENA_SHIFT,
1166 		   0, NULL, 0, madera_in_ev,
1167 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1168 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1169 SND_SOC_DAPM_PGA_E("IN1R", MADERA_INPUT_ENABLES, MADERA_IN1R_ENA_SHIFT,
1170 		   0, NULL, 0, madera_in_ev,
1171 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1172 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1173 SND_SOC_DAPM_PGA_E("IN2L", MADERA_INPUT_ENABLES, MADERA_IN2L_ENA_SHIFT,
1174 		   0, NULL, 0, madera_in_ev,
1175 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1176 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1177 SND_SOC_DAPM_PGA_E("IN2R", MADERA_INPUT_ENABLES, MADERA_IN2R_ENA_SHIFT,
1178 		   0, NULL, 0, madera_in_ev,
1179 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1180 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1181 SND_SOC_DAPM_PGA_E("IN3L", MADERA_INPUT_ENABLES, MADERA_IN3L_ENA_SHIFT,
1182 		   0, NULL, 0, madera_in_ev,
1183 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1184 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1185 SND_SOC_DAPM_PGA_E("IN3R", MADERA_INPUT_ENABLES, MADERA_IN3R_ENA_SHIFT,
1186 		   0, NULL, 0, madera_in_ev,
1187 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1188 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1189 SND_SOC_DAPM_PGA_E("IN4L", MADERA_INPUT_ENABLES, MADERA_IN4L_ENA_SHIFT,
1190 		   0, NULL, 0, madera_in_ev,
1191 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1192 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1193 SND_SOC_DAPM_PGA_E("IN4R", MADERA_INPUT_ENABLES, MADERA_IN4R_ENA_SHIFT,
1194 		   0, NULL, 0, madera_in_ev,
1195 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1196 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1197 SND_SOC_DAPM_PGA_E("IN5L", MADERA_INPUT_ENABLES, MADERA_IN5L_ENA_SHIFT,
1198 		   0, NULL, 0, madera_in_ev,
1199 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1200 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1201 SND_SOC_DAPM_PGA_E("IN5R", MADERA_INPUT_ENABLES, MADERA_IN5R_ENA_SHIFT,
1202 		   0, NULL, 0, madera_in_ev,
1203 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1204 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1205 SND_SOC_DAPM_PGA_E("IN6L", MADERA_INPUT_ENABLES, MADERA_IN6L_ENA_SHIFT,
1206 		   0, NULL, 0, madera_in_ev,
1207 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1208 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1209 SND_SOC_DAPM_PGA_E("IN6R", MADERA_INPUT_ENABLES, MADERA_IN6R_ENA_SHIFT,
1210 		   0, NULL, 0, madera_in_ev,
1211 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
1212 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
1213 
1214 SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0,
1215 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX1_ENA_SHIFT, 0),
1216 SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0,
1217 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX2_ENA_SHIFT, 0),
1218 SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0,
1219 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX3_ENA_SHIFT, 0),
1220 SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0,
1221 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX4_ENA_SHIFT, 0),
1222 SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0,
1223 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX5_ENA_SHIFT, 0),
1224 SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0,
1225 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX6_ENA_SHIFT, 0),
1226 SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0,
1227 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX7_ENA_SHIFT, 0),
1228 SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0,
1229 		    MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX8_ENA_SHIFT, 0),
1230 
1231 SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0,
1232 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX1_ENA_SHIFT, 0),
1233 SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0,
1234 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX2_ENA_SHIFT, 0),
1235 SND_SOC_DAPM_AIF_IN("AIF2RX3", NULL, 0,
1236 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX3_ENA_SHIFT, 0),
1237 SND_SOC_DAPM_AIF_IN("AIF2RX4", NULL, 0,
1238 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX4_ENA_SHIFT, 0),
1239 SND_SOC_DAPM_AIF_IN("AIF2RX5", NULL, 0,
1240 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX5_ENA_SHIFT, 0),
1241 SND_SOC_DAPM_AIF_IN("AIF2RX6", NULL, 0,
1242 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX6_ENA_SHIFT, 0),
1243 SND_SOC_DAPM_AIF_IN("AIF2RX7", NULL, 0,
1244 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX7_ENA_SHIFT, 0),
1245 SND_SOC_DAPM_AIF_IN("AIF2RX8", NULL, 0,
1246 		    MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX8_ENA_SHIFT, 0),
1247 
1248 SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0,
1249 		    MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX1_ENA_SHIFT, 0),
1250 SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0,
1251 		    MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX2_ENA_SHIFT, 0),
1252 
1253 SND_SOC_DAPM_AIF_IN("AIF4RX1", NULL, 0,
1254 		    MADERA_AIF4_RX_ENABLES, MADERA_AIF4RX1_ENA_SHIFT, 0),
1255 SND_SOC_DAPM_AIF_IN("AIF4RX2", NULL, 0,
1256 		    MADERA_AIF4_RX_ENABLES, MADERA_AIF4RX2_ENA_SHIFT, 0),
1257 
1258 SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0,
1259 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1260 		    MADERA_SLIMRX1_ENA_SHIFT, 0),
1261 SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0,
1262 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1263 		    MADERA_SLIMRX2_ENA_SHIFT, 0),
1264 SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0,
1265 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1266 		    MADERA_SLIMRX3_ENA_SHIFT, 0),
1267 SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0,
1268 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1269 		    MADERA_SLIMRX4_ENA_SHIFT, 0),
1270 SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0,
1271 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1272 		    MADERA_SLIMRX5_ENA_SHIFT, 0),
1273 SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0,
1274 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1275 		    MADERA_SLIMRX6_ENA_SHIFT, 0),
1276 SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0,
1277 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1278 		    MADERA_SLIMRX7_ENA_SHIFT, 0),
1279 SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0,
1280 		    MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
1281 		    MADERA_SLIMRX8_ENA_SHIFT, 0),
1282 
1283 SND_SOC_DAPM_PGA("EQ1", MADERA_EQ1_1, MADERA_EQ1_ENA_SHIFT, 0, NULL, 0),
1284 SND_SOC_DAPM_PGA("EQ2", MADERA_EQ2_1, MADERA_EQ2_ENA_SHIFT, 0, NULL, 0),
1285 SND_SOC_DAPM_PGA("EQ3", MADERA_EQ3_1, MADERA_EQ3_ENA_SHIFT, 0, NULL, 0),
1286 SND_SOC_DAPM_PGA("EQ4", MADERA_EQ4_1, MADERA_EQ4_ENA_SHIFT, 0, NULL, 0),
1287 
1288 SND_SOC_DAPM_PGA("DRC1L", MADERA_DRC1_CTRL1, MADERA_DRC1L_ENA_SHIFT, 0,
1289 		 NULL, 0),
1290 SND_SOC_DAPM_PGA("DRC1R", MADERA_DRC1_CTRL1, MADERA_DRC1R_ENA_SHIFT, 0,
1291 		 NULL, 0),
1292 SND_SOC_DAPM_PGA("DRC2L", MADERA_DRC2_CTRL1, MADERA_DRC2L_ENA_SHIFT, 0,
1293 		 NULL, 0),
1294 SND_SOC_DAPM_PGA("DRC2R", MADERA_DRC2_CTRL1, MADERA_DRC2R_ENA_SHIFT, 0,
1295 		 NULL, 0),
1296 
1297 SND_SOC_DAPM_PGA("LHPF1", MADERA_HPLPF1_1, MADERA_LHPF1_ENA_SHIFT, 0,
1298 		 NULL, 0),
1299 SND_SOC_DAPM_PGA("LHPF2", MADERA_HPLPF2_1, MADERA_LHPF2_ENA_SHIFT, 0,
1300 		 NULL, 0),
1301 SND_SOC_DAPM_PGA("LHPF3", MADERA_HPLPF3_1, MADERA_LHPF3_ENA_SHIFT, 0,
1302 		 NULL, 0),
1303 SND_SOC_DAPM_PGA("LHPF4", MADERA_HPLPF4_1, MADERA_LHPF4_ENA_SHIFT, 0,
1304 		 NULL, 0),
1305 
1306 SND_SOC_DAPM_PGA("ASRC1IN1L", MADERA_ASRC1_ENABLE, MADERA_ASRC1_IN1L_ENA_SHIFT,
1307 		 0, NULL, 0),
1308 SND_SOC_DAPM_PGA("ASRC1IN1R", MADERA_ASRC1_ENABLE, MADERA_ASRC1_IN1R_ENA_SHIFT,
1309 		 0, NULL, 0),
1310 SND_SOC_DAPM_PGA("ASRC1IN2L", MADERA_ASRC1_ENABLE, MADERA_ASRC1_IN2L_ENA_SHIFT,
1311 		 0, NULL, 0),
1312 SND_SOC_DAPM_PGA("ASRC1IN2R", MADERA_ASRC1_ENABLE, MADERA_ASRC1_IN2R_ENA_SHIFT,
1313 		 0, NULL, 0),
1314 
1315 SND_SOC_DAPM_PGA("ASRC2IN1L", MADERA_ASRC2_ENABLE, MADERA_ASRC2_IN1L_ENA_SHIFT,
1316 		 0, NULL, 0),
1317 SND_SOC_DAPM_PGA("ASRC2IN1R", MADERA_ASRC2_ENABLE, MADERA_ASRC2_IN1R_ENA_SHIFT,
1318 		 0, NULL, 0),
1319 SND_SOC_DAPM_PGA("ASRC2IN2L", MADERA_ASRC2_ENABLE, MADERA_ASRC2_IN2L_ENA_SHIFT,
1320 		 0, NULL, 0),
1321 SND_SOC_DAPM_PGA("ASRC2IN2R", MADERA_ASRC2_ENABLE, MADERA_ASRC2_IN2R_ENA_SHIFT,
1322 		 0, NULL, 0),
1323 
1324 SND_SOC_DAPM_PGA("ISRC1DEC1", MADERA_ISRC_1_CTRL_3,
1325 		 MADERA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0),
1326 SND_SOC_DAPM_PGA("ISRC1DEC2", MADERA_ISRC_1_CTRL_3,
1327 		 MADERA_ISRC1_DEC2_ENA_SHIFT, 0, NULL, 0),
1328 SND_SOC_DAPM_PGA("ISRC1DEC3", MADERA_ISRC_1_CTRL_3,
1329 		 MADERA_ISRC1_DEC3_ENA_SHIFT, 0, NULL, 0),
1330 SND_SOC_DAPM_PGA("ISRC1DEC4", MADERA_ISRC_1_CTRL_3,
1331 		 MADERA_ISRC1_DEC4_ENA_SHIFT, 0, NULL, 0),
1332 
1333 SND_SOC_DAPM_PGA("ISRC1INT1", MADERA_ISRC_1_CTRL_3,
1334 		 MADERA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0),
1335 SND_SOC_DAPM_PGA("ISRC1INT2", MADERA_ISRC_1_CTRL_3,
1336 		 MADERA_ISRC1_INT2_ENA_SHIFT, 0, NULL, 0),
1337 SND_SOC_DAPM_PGA("ISRC1INT3", MADERA_ISRC_1_CTRL_3,
1338 		 MADERA_ISRC1_INT3_ENA_SHIFT, 0, NULL, 0),
1339 SND_SOC_DAPM_PGA("ISRC1INT4", MADERA_ISRC_1_CTRL_3,
1340 		 MADERA_ISRC1_INT4_ENA_SHIFT, 0, NULL, 0),
1341 
1342 SND_SOC_DAPM_PGA("ISRC2DEC1", MADERA_ISRC_2_CTRL_3,
1343 		 MADERA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0),
1344 SND_SOC_DAPM_PGA("ISRC2DEC2", MADERA_ISRC_2_CTRL_3,
1345 		 MADERA_ISRC2_DEC2_ENA_SHIFT, 0, NULL, 0),
1346 SND_SOC_DAPM_PGA("ISRC2DEC3", MADERA_ISRC_2_CTRL_3,
1347 		 MADERA_ISRC2_DEC3_ENA_SHIFT, 0, NULL, 0),
1348 SND_SOC_DAPM_PGA("ISRC2DEC4", MADERA_ISRC_2_CTRL_3,
1349 		 MADERA_ISRC2_DEC4_ENA_SHIFT, 0, NULL, 0),
1350 
1351 SND_SOC_DAPM_PGA("ISRC2INT1", MADERA_ISRC_2_CTRL_3,
1352 		 MADERA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0),
1353 SND_SOC_DAPM_PGA("ISRC2INT2", MADERA_ISRC_2_CTRL_3,
1354 		 MADERA_ISRC2_INT2_ENA_SHIFT, 0, NULL, 0),
1355 SND_SOC_DAPM_PGA("ISRC2INT3", MADERA_ISRC_2_CTRL_3,
1356 		 MADERA_ISRC2_INT3_ENA_SHIFT, 0, NULL, 0),
1357 SND_SOC_DAPM_PGA("ISRC2INT4", MADERA_ISRC_2_CTRL_3,
1358 		 MADERA_ISRC2_INT4_ENA_SHIFT, 0, NULL, 0),
1359 
1360 SND_SOC_DAPM_PGA("ISRC3DEC1", MADERA_ISRC_3_CTRL_3,
1361 		 MADERA_ISRC3_DEC1_ENA_SHIFT, 0, NULL, 0),
1362 SND_SOC_DAPM_PGA("ISRC3DEC2", MADERA_ISRC_3_CTRL_3,
1363 		 MADERA_ISRC3_DEC2_ENA_SHIFT, 0, NULL, 0),
1364 
1365 SND_SOC_DAPM_PGA("ISRC3INT1", MADERA_ISRC_3_CTRL_3,
1366 		 MADERA_ISRC3_INT1_ENA_SHIFT, 0, NULL, 0),
1367 SND_SOC_DAPM_PGA("ISRC3INT2", MADERA_ISRC_3_CTRL_3,
1368 		 MADERA_ISRC3_INT2_ENA_SHIFT, 0, NULL, 0),
1369 
1370 SND_SOC_DAPM_PGA("ISRC4DEC1", MADERA_ISRC_4_CTRL_3,
1371 		 MADERA_ISRC4_DEC1_ENA_SHIFT, 0, NULL, 0),
1372 SND_SOC_DAPM_PGA("ISRC4DEC2", MADERA_ISRC_4_CTRL_3,
1373 		 MADERA_ISRC4_DEC2_ENA_SHIFT, 0, NULL, 0),
1374 
1375 SND_SOC_DAPM_PGA("ISRC4INT1", MADERA_ISRC_4_CTRL_3,
1376 		 MADERA_ISRC4_INT1_ENA_SHIFT, 0, NULL, 0),
1377 SND_SOC_DAPM_PGA("ISRC4INT2", MADERA_ISRC_4_CTRL_3,
1378 		 MADERA_ISRC4_INT2_ENA_SHIFT, 0, NULL, 0),
1379 
1380 WM_ADSP2("DSP1", 0, cs47l85_adsp_power_ev),
1381 WM_ADSP2("DSP2", 1, cs47l85_adsp_power_ev),
1382 WM_ADSP2("DSP3", 2, cs47l85_adsp_power_ev),
1383 WM_ADSP2("DSP4", 3, cs47l85_adsp_power_ev),
1384 WM_ADSP2("DSP5", 4, cs47l85_adsp_power_ev),
1385 WM_ADSP2("DSP6", 5, cs47l85_adsp_power_ev),
1386 WM_ADSP2("DSP7", 6, cs47l85_adsp_power_ev),
1387 
1388 /* End of ordered input mux widgets */
1389 
1390 MADERA_MIXER_WIDGETS(EQ1, "EQ1"),
1391 MADERA_MIXER_WIDGETS(EQ2, "EQ2"),
1392 MADERA_MIXER_WIDGETS(EQ3, "EQ3"),
1393 MADERA_MIXER_WIDGETS(EQ4, "EQ4"),
1394 
1395 MADERA_MIXER_WIDGETS(DRC1L, "DRC1L"),
1396 MADERA_MIXER_WIDGETS(DRC1R, "DRC1R"),
1397 MADERA_MIXER_WIDGETS(DRC2L, "DRC2L"),
1398 MADERA_MIXER_WIDGETS(DRC2R, "DRC2R"),
1399 
1400 SND_SOC_DAPM_SWITCH("DRC1 Activity Output", SND_SOC_NOPM, 0, 0,
1401 		    &madera_drc_activity_output_mux[0]),
1402 SND_SOC_DAPM_SWITCH("DRC2 Activity Output", SND_SOC_NOPM, 0, 0,
1403 		    &madera_drc_activity_output_mux[1]),
1404 
1405 MADERA_MIXER_WIDGETS(LHPF1, "LHPF1"),
1406 MADERA_MIXER_WIDGETS(LHPF2, "LHPF2"),
1407 MADERA_MIXER_WIDGETS(LHPF3, "LHPF3"),
1408 MADERA_MIXER_WIDGETS(LHPF4, "LHPF4"),
1409 
1410 MADERA_MIXER_WIDGETS(PWM1, "PWM1"),
1411 MADERA_MIXER_WIDGETS(PWM2, "PWM2"),
1412 
1413 MADERA_MIXER_WIDGETS(OUT1L, "HPOUT1L"),
1414 MADERA_MIXER_WIDGETS(OUT1R, "HPOUT1R"),
1415 MADERA_MIXER_WIDGETS(OUT2L, "HPOUT2L"),
1416 MADERA_MIXER_WIDGETS(OUT2R, "HPOUT2R"),
1417 MADERA_MIXER_WIDGETS(OUT3L, "HPOUT3L"),
1418 MADERA_MIXER_WIDGETS(OUT3R, "HPOUT3R"),
1419 MADERA_MIXER_WIDGETS(SPKOUTL, "SPKOUTL"),
1420 MADERA_MIXER_WIDGETS(SPKOUTR, "SPKOUTR"),
1421 MADERA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"),
1422 MADERA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"),
1423 MADERA_MIXER_WIDGETS(SPKDAT2L, "SPKDAT2L"),
1424 MADERA_MIXER_WIDGETS(SPKDAT2R, "SPKDAT2R"),
1425 
1426 MADERA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"),
1427 MADERA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"),
1428 MADERA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"),
1429 MADERA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"),
1430 MADERA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"),
1431 MADERA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"),
1432 MADERA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"),
1433 MADERA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"),
1434 
1435 MADERA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"),
1436 MADERA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"),
1437 MADERA_MIXER_WIDGETS(AIF2TX3, "AIF2TX3"),
1438 MADERA_MIXER_WIDGETS(AIF2TX4, "AIF2TX4"),
1439 MADERA_MIXER_WIDGETS(AIF2TX5, "AIF2TX5"),
1440 MADERA_MIXER_WIDGETS(AIF2TX6, "AIF2TX6"),
1441 MADERA_MIXER_WIDGETS(AIF2TX7, "AIF2TX7"),
1442 MADERA_MIXER_WIDGETS(AIF2TX8, "AIF2TX8"),
1443 
1444 MADERA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"),
1445 MADERA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"),
1446 
1447 MADERA_MIXER_WIDGETS(AIF4TX1, "AIF4TX1"),
1448 MADERA_MIXER_WIDGETS(AIF4TX2, "AIF4TX2"),
1449 
1450 MADERA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"),
1451 MADERA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"),
1452 MADERA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"),
1453 MADERA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"),
1454 MADERA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"),
1455 MADERA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"),
1456 MADERA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"),
1457 MADERA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"),
1458 
1459 MADERA_MUX_WIDGETS(SPD1TX1, "SPDIF1TX1"),
1460 MADERA_MUX_WIDGETS(SPD1TX2, "SPDIF1TX2"),
1461 
1462 MADERA_MUX_WIDGETS(ASRC1IN1L, "ASRC1IN1L"),
1463 MADERA_MUX_WIDGETS(ASRC1IN1R, "ASRC1IN1R"),
1464 MADERA_MUX_WIDGETS(ASRC1IN2L, "ASRC1IN2L"),
1465 MADERA_MUX_WIDGETS(ASRC1IN2R, "ASRC1IN2R"),
1466 MADERA_MUX_WIDGETS(ASRC2IN1L, "ASRC2IN1L"),
1467 MADERA_MUX_WIDGETS(ASRC2IN1R, "ASRC2IN1R"),
1468 MADERA_MUX_WIDGETS(ASRC2IN2L, "ASRC2IN2L"),
1469 MADERA_MUX_WIDGETS(ASRC2IN2R, "ASRC2IN2R"),
1470 
1471 MADERA_DSP_WIDGETS(DSP1, "DSP1"),
1472 MADERA_DSP_WIDGETS(DSP2, "DSP2"),
1473 MADERA_DSP_WIDGETS(DSP3, "DSP3"),
1474 MADERA_DSP_WIDGETS(DSP4, "DSP4"),
1475 MADERA_DSP_WIDGETS(DSP5, "DSP5"),
1476 MADERA_DSP_WIDGETS(DSP6, "DSP6"),
1477 MADERA_DSP_WIDGETS(DSP7, "DSP7"),
1478 
1479 SND_SOC_DAPM_SWITCH("DSP1 Trigger Output", SND_SOC_NOPM, 0, 0,
1480 		    &madera_dsp_trigger_output_mux[0]),
1481 SND_SOC_DAPM_SWITCH("DSP2 Trigger Output", SND_SOC_NOPM, 0, 0,
1482 		    &madera_dsp_trigger_output_mux[1]),
1483 SND_SOC_DAPM_SWITCH("DSP3 Trigger Output", SND_SOC_NOPM, 0, 0,
1484 		    &madera_dsp_trigger_output_mux[2]),
1485 SND_SOC_DAPM_SWITCH("DSP4 Trigger Output", SND_SOC_NOPM, 0, 0,
1486 		    &madera_dsp_trigger_output_mux[3]),
1487 SND_SOC_DAPM_SWITCH("DSP5 Trigger Output", SND_SOC_NOPM, 0, 0,
1488 		    &madera_dsp_trigger_output_mux[4]),
1489 SND_SOC_DAPM_SWITCH("DSP6 Trigger Output", SND_SOC_NOPM, 0, 0,
1490 		    &madera_dsp_trigger_output_mux[5]),
1491 SND_SOC_DAPM_SWITCH("DSP7 Trigger Output", SND_SOC_NOPM, 0, 0,
1492 		    &madera_dsp_trigger_output_mux[6]),
1493 
1494 MADERA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"),
1495 MADERA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"),
1496 MADERA_MUX_WIDGETS(ISRC1DEC3, "ISRC1DEC3"),
1497 MADERA_MUX_WIDGETS(ISRC1DEC4, "ISRC1DEC4"),
1498 
1499 MADERA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"),
1500 MADERA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"),
1501 MADERA_MUX_WIDGETS(ISRC1INT3, "ISRC1INT3"),
1502 MADERA_MUX_WIDGETS(ISRC1INT4, "ISRC1INT4"),
1503 
1504 MADERA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"),
1505 MADERA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"),
1506 MADERA_MUX_WIDGETS(ISRC2DEC3, "ISRC2DEC3"),
1507 MADERA_MUX_WIDGETS(ISRC2DEC4, "ISRC2DEC4"),
1508 
1509 MADERA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"),
1510 MADERA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"),
1511 MADERA_MUX_WIDGETS(ISRC2INT3, "ISRC2INT3"),
1512 MADERA_MUX_WIDGETS(ISRC2INT4, "ISRC2INT4"),
1513 
1514 MADERA_MUX_WIDGETS(ISRC3DEC1, "ISRC3DEC1"),
1515 MADERA_MUX_WIDGETS(ISRC3DEC2, "ISRC3DEC2"),
1516 
1517 MADERA_MUX_WIDGETS(ISRC3INT1, "ISRC3INT1"),
1518 MADERA_MUX_WIDGETS(ISRC3INT2, "ISRC3INT2"),
1519 
1520 MADERA_MUX_WIDGETS(ISRC4DEC1, "ISRC4DEC1"),
1521 MADERA_MUX_WIDGETS(ISRC4DEC2, "ISRC4DEC2"),
1522 
1523 MADERA_MUX_WIDGETS(ISRC4INT1, "ISRC4INT1"),
1524 MADERA_MUX_WIDGETS(ISRC4INT2, "ISRC4INT2"),
1525 
1526 SND_SOC_DAPM_OUTPUT("HPOUT1L"),
1527 SND_SOC_DAPM_OUTPUT("HPOUT1R"),
1528 SND_SOC_DAPM_OUTPUT("HPOUT2L"),
1529 SND_SOC_DAPM_OUTPUT("HPOUT2R"),
1530 SND_SOC_DAPM_OUTPUT("HPOUT3L"),
1531 SND_SOC_DAPM_OUTPUT("HPOUT3R"),
1532 SND_SOC_DAPM_OUTPUT("SPKOUTLN"),
1533 SND_SOC_DAPM_OUTPUT("SPKOUTLP"),
1534 SND_SOC_DAPM_OUTPUT("SPKOUTRN"),
1535 SND_SOC_DAPM_OUTPUT("SPKOUTRP"),
1536 SND_SOC_DAPM_OUTPUT("SPKDAT1L"),
1537 SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
1538 SND_SOC_DAPM_OUTPUT("SPKDAT2L"),
1539 SND_SOC_DAPM_OUTPUT("SPKDAT2R"),
1540 SND_SOC_DAPM_OUTPUT("SPDIF1"),
1541 
1542 SND_SOC_DAPM_OUTPUT("MICSUPP"),
1543 };
1544 
1545 #define MADERA_MIXER_INPUT_ROUTES(name)	\
1546 	{ name, "Noise Generator", "Noise Generator" }, \
1547 	{ name, "Tone Generator 1", "Tone Generator 1" }, \
1548 	{ name, "Tone Generator 2", "Tone Generator 2" }, \
1549 	{ name, "Haptics", "HAPTICS" }, \
1550 	{ name, "AEC1", "AEC1 Loopback" }, \
1551 	{ name, "AEC2", "AEC2 Loopback" }, \
1552 	{ name, "IN1L", "IN1L" }, \
1553 	{ name, "IN1R", "IN1R" }, \
1554 	{ name, "IN2L", "IN2L" }, \
1555 	{ name, "IN2R", "IN2R" }, \
1556 	{ name, "IN3L", "IN3L" }, \
1557 	{ name, "IN3R", "IN3R" }, \
1558 	{ name, "IN4L", "IN4L" }, \
1559 	{ name, "IN4R", "IN4R" }, \
1560 	{ name, "IN5L", "IN5L" }, \
1561 	{ name, "IN5R", "IN5R" }, \
1562 	{ name, "IN6L", "IN6L" }, \
1563 	{ name, "IN6R", "IN6R" }, \
1564 	{ name, "AIF1RX1", "AIF1RX1" }, \
1565 	{ name, "AIF1RX2", "AIF1RX2" }, \
1566 	{ name, "AIF1RX3", "AIF1RX3" }, \
1567 	{ name, "AIF1RX4", "AIF1RX4" }, \
1568 	{ name, "AIF1RX5", "AIF1RX5" }, \
1569 	{ name, "AIF1RX6", "AIF1RX6" }, \
1570 	{ name, "AIF1RX7", "AIF1RX7" }, \
1571 	{ name, "AIF1RX8", "AIF1RX8" }, \
1572 	{ name, "AIF2RX1", "AIF2RX1" }, \
1573 	{ name, "AIF2RX2", "AIF2RX2" }, \
1574 	{ name, "AIF2RX3", "AIF2RX3" }, \
1575 	{ name, "AIF2RX4", "AIF2RX4" }, \
1576 	{ name, "AIF2RX5", "AIF2RX5" }, \
1577 	{ name, "AIF2RX6", "AIF2RX6" }, \
1578 	{ name, "AIF2RX7", "AIF2RX7" }, \
1579 	{ name, "AIF2RX8", "AIF2RX8" }, \
1580 	{ name, "AIF3RX1", "AIF3RX1" }, \
1581 	{ name, "AIF3RX2", "AIF3RX2" }, \
1582 	{ name, "AIF4RX1", "AIF4RX1" }, \
1583 	{ name, "AIF4RX2", "AIF4RX2" }, \
1584 	{ name, "SLIMRX1", "SLIMRX1" }, \
1585 	{ name, "SLIMRX2", "SLIMRX2" }, \
1586 	{ name, "SLIMRX3", "SLIMRX3" }, \
1587 	{ name, "SLIMRX4", "SLIMRX4" }, \
1588 	{ name, "SLIMRX5", "SLIMRX5" }, \
1589 	{ name, "SLIMRX6", "SLIMRX6" }, \
1590 	{ name, "SLIMRX7", "SLIMRX7" }, \
1591 	{ name, "SLIMRX8", "SLIMRX8" }, \
1592 	{ name, "EQ1", "EQ1" }, \
1593 	{ name, "EQ2", "EQ2" }, \
1594 	{ name, "EQ3", "EQ3" }, \
1595 	{ name, "EQ4", "EQ4" }, \
1596 	{ name, "DRC1L", "DRC1L" }, \
1597 	{ name, "DRC1R", "DRC1R" }, \
1598 	{ name, "DRC2L", "DRC2L" }, \
1599 	{ name, "DRC2R", "DRC2R" }, \
1600 	{ name, "LHPF1", "LHPF1" }, \
1601 	{ name, "LHPF2", "LHPF2" }, \
1602 	{ name, "LHPF3", "LHPF3" }, \
1603 	{ name, "LHPF4", "LHPF4" }, \
1604 	{ name, "ASRC1IN1L", "ASRC1IN1L" }, \
1605 	{ name, "ASRC1IN1R", "ASRC1IN1R" }, \
1606 	{ name, "ASRC1IN2L", "ASRC1IN2L" }, \
1607 	{ name, "ASRC1IN2R", "ASRC1IN2R" }, \
1608 	{ name, "ASRC2IN1L", "ASRC2IN1L" }, \
1609 	{ name, "ASRC2IN1R", "ASRC2IN1R" }, \
1610 	{ name, "ASRC2IN2L", "ASRC2IN2L" }, \
1611 	{ name, "ASRC2IN2R", "ASRC2IN2R" }, \
1612 	{ name, "ISRC1DEC1", "ISRC1DEC1" }, \
1613 	{ name, "ISRC1DEC2", "ISRC1DEC2" }, \
1614 	{ name, "ISRC1DEC3", "ISRC1DEC3" }, \
1615 	{ name, "ISRC1DEC4", "ISRC1DEC4" }, \
1616 	{ name, "ISRC1INT1", "ISRC1INT1" }, \
1617 	{ name, "ISRC1INT2", "ISRC1INT2" }, \
1618 	{ name, "ISRC1INT3", "ISRC1INT3" }, \
1619 	{ name, "ISRC1INT4", "ISRC1INT4" }, \
1620 	{ name, "ISRC2DEC1", "ISRC2DEC1" }, \
1621 	{ name, "ISRC2DEC2", "ISRC2DEC2" }, \
1622 	{ name, "ISRC2DEC3", "ISRC2DEC3" }, \
1623 	{ name, "ISRC2DEC4", "ISRC2DEC4" }, \
1624 	{ name, "ISRC2INT1", "ISRC2INT1" }, \
1625 	{ name, "ISRC2INT2", "ISRC2INT2" }, \
1626 	{ name, "ISRC2INT3", "ISRC2INT3" }, \
1627 	{ name, "ISRC2INT4", "ISRC2INT4" }, \
1628 	{ name, "ISRC3DEC1", "ISRC3DEC1" }, \
1629 	{ name, "ISRC3DEC2", "ISRC3DEC2" }, \
1630 	{ name, "ISRC3INT1", "ISRC3INT1" }, \
1631 	{ name, "ISRC3INT2", "ISRC3INT2" }, \
1632 	{ name, "ISRC4DEC1", "ISRC4DEC1" }, \
1633 	{ name, "ISRC4DEC2", "ISRC4DEC2" }, \
1634 	{ name, "ISRC4INT1", "ISRC4INT1" }, \
1635 	{ name, "ISRC4INT2", "ISRC4INT2" }, \
1636 	{ name, "DSP1.1", "DSP1" }, \
1637 	{ name, "DSP1.2", "DSP1" }, \
1638 	{ name, "DSP1.3", "DSP1" }, \
1639 	{ name, "DSP1.4", "DSP1" }, \
1640 	{ name, "DSP1.5", "DSP1" }, \
1641 	{ name, "DSP1.6", "DSP1" }, \
1642 	{ name, "DSP2.1", "DSP2" }, \
1643 	{ name, "DSP2.2", "DSP2" }, \
1644 	{ name, "DSP2.3", "DSP2" }, \
1645 	{ name, "DSP2.4", "DSP2" }, \
1646 	{ name, "DSP2.5", "DSP2" }, \
1647 	{ name, "DSP2.6", "DSP2" }, \
1648 	{ name, "DSP3.1", "DSP3" }, \
1649 	{ name, "DSP3.2", "DSP3" }, \
1650 	{ name, "DSP3.3", "DSP3" }, \
1651 	{ name, "DSP3.4", "DSP3" }, \
1652 	{ name, "DSP3.5", "DSP3" }, \
1653 	{ name, "DSP3.6", "DSP3" }, \
1654 	{ name, "DSP4.1", "DSP4" }, \
1655 	{ name, "DSP4.2", "DSP4" }, \
1656 	{ name, "DSP4.3", "DSP4" }, \
1657 	{ name, "DSP4.4", "DSP4" }, \
1658 	{ name, "DSP4.5", "DSP4" }, \
1659 	{ name, "DSP4.6", "DSP4" }, \
1660 	{ name, "DSP5.1", "DSP5" }, \
1661 	{ name, "DSP5.2", "DSP5" }, \
1662 	{ name, "DSP5.3", "DSP5" }, \
1663 	{ name, "DSP5.4", "DSP5" }, \
1664 	{ name, "DSP5.5", "DSP5" }, \
1665 	{ name, "DSP5.6", "DSP5" }, \
1666 	{ name, "DSP6.1", "DSP6" }, \
1667 	{ name, "DSP6.2", "DSP6" }, \
1668 	{ name, "DSP6.3", "DSP6" }, \
1669 	{ name, "DSP6.4", "DSP6" }, \
1670 	{ name, "DSP6.5", "DSP6" }, \
1671 	{ name, "DSP6.6", "DSP6" }, \
1672 	{ name, "DSP7.1", "DSP7" }, \
1673 	{ name, "DSP7.2", "DSP7" }, \
1674 	{ name, "DSP7.3", "DSP7" }, \
1675 	{ name, "DSP7.4", "DSP7" }, \
1676 	{ name, "DSP7.5", "DSP7" }, \
1677 	{ name, "DSP7.6", "DSP7" }
1678 
1679 static const struct snd_soc_dapm_route cs47l85_dapm_routes[] = {
1680 	/* Internal clock domains */
1681 	{ "EQ1", NULL, "FXCLK" },
1682 	{ "EQ2", NULL, "FXCLK" },
1683 	{ "EQ3", NULL, "FXCLK" },
1684 	{ "EQ4", NULL, "FXCLK" },
1685 	{ "DRC1L", NULL, "FXCLK" },
1686 	{ "DRC1R", NULL, "FXCLK" },
1687 	{ "DRC2L", NULL, "FXCLK" },
1688 	{ "DRC2R", NULL, "FXCLK" },
1689 	{ "LHPF1", NULL, "FXCLK" },
1690 	{ "LHPF2", NULL, "FXCLK" },
1691 	{ "LHPF3", NULL, "FXCLK" },
1692 	{ "LHPF4", NULL, "FXCLK" },
1693 	{ "PWM1 Mixer", NULL, "PWMCLK" },
1694 	{ "PWM2 Mixer", NULL, "PWMCLK" },
1695 	{ "OUT1L", NULL, "OUTCLK" },
1696 	{ "OUT1R", NULL, "OUTCLK" },
1697 	{ "OUT2L", NULL, "OUTCLK" },
1698 	{ "OUT2R", NULL, "OUTCLK" },
1699 	{ "OUT3L", NULL, "OUTCLK" },
1700 	{ "OUT3R", NULL, "OUTCLK" },
1701 	{ "OUT4L", NULL, "OUTCLK" },
1702 	{ "OUT4R", NULL, "OUTCLK" },
1703 	{ "OUT5L", NULL, "OUTCLK" },
1704 	{ "OUT5R", NULL, "OUTCLK" },
1705 	{ "OUT6L", NULL, "OUTCLK" },
1706 	{ "OUT6R", NULL, "OUTCLK" },
1707 	{ "AIF1TX1", NULL, "AIF1TXCLK" },
1708 	{ "AIF1TX2", NULL, "AIF1TXCLK" },
1709 	{ "AIF1TX3", NULL, "AIF1TXCLK" },
1710 	{ "AIF1TX4", NULL, "AIF1TXCLK" },
1711 	{ "AIF1TX5", NULL, "AIF1TXCLK" },
1712 	{ "AIF1TX6", NULL, "AIF1TXCLK" },
1713 	{ "AIF1TX7", NULL, "AIF1TXCLK" },
1714 	{ "AIF1TX8", NULL, "AIF1TXCLK" },
1715 	{ "AIF2TX1", NULL, "AIF2TXCLK" },
1716 	{ "AIF2TX2", NULL, "AIF2TXCLK" },
1717 	{ "AIF2TX3", NULL, "AIF2TXCLK" },
1718 	{ "AIF2TX4", NULL, "AIF2TXCLK" },
1719 	{ "AIF2TX5", NULL, "AIF2TXCLK" },
1720 	{ "AIF2TX6", NULL, "AIF2TXCLK" },
1721 	{ "AIF2TX7", NULL, "AIF2TXCLK" },
1722 	{ "AIF2TX8", NULL, "AIF2TXCLK" },
1723 	{ "AIF3TX1", NULL, "AIF3TXCLK" },
1724 	{ "AIF3TX2", NULL, "AIF3TXCLK" },
1725 	{ "AIF4TX1", NULL, "AIF4TXCLK" },
1726 	{ "AIF4TX2", NULL, "AIF4TXCLK" },
1727 	{ "SLIMTX1", NULL, "SLIMBUSCLK" },
1728 	{ "SLIMTX2", NULL, "SLIMBUSCLK" },
1729 	{ "SLIMTX3", NULL, "SLIMBUSCLK" },
1730 	{ "SLIMTX4", NULL, "SLIMBUSCLK" },
1731 	{ "SLIMTX5", NULL, "SLIMBUSCLK" },
1732 	{ "SLIMTX6", NULL, "SLIMBUSCLK" },
1733 	{ "SLIMTX7", NULL, "SLIMBUSCLK" },
1734 	{ "SLIMTX8", NULL, "SLIMBUSCLK" },
1735 	{ "SPD1TX1", NULL, "SPDCLK" },
1736 	{ "SPD1TX2", NULL, "SPDCLK" },
1737 	{ "DSP1", NULL, "DSP1CLK" },
1738 	{ "DSP2", NULL, "DSP2CLK" },
1739 	{ "DSP3", NULL, "DSP3CLK" },
1740 	{ "DSP4", NULL, "DSP4CLK" },
1741 	{ "DSP5", NULL, "DSP5CLK" },
1742 	{ "DSP6", NULL, "DSP6CLK" },
1743 	{ "DSP7", NULL, "DSP7CLK" },
1744 	{ "ISRC1DEC1", NULL, "ISRC1CLK" },
1745 	{ "ISRC1DEC2", NULL, "ISRC1CLK" },
1746 	{ "ISRC1DEC3", NULL, "ISRC1CLK" },
1747 	{ "ISRC1DEC4", NULL, "ISRC1CLK" },
1748 	{ "ISRC1INT1", NULL, "ISRC1CLK" },
1749 	{ "ISRC1INT2", NULL, "ISRC1CLK" },
1750 	{ "ISRC1INT3", NULL, "ISRC1CLK" },
1751 	{ "ISRC1INT4", NULL, "ISRC1CLK" },
1752 	{ "ISRC2DEC1", NULL, "ISRC2CLK" },
1753 	{ "ISRC2DEC2", NULL, "ISRC2CLK" },
1754 	{ "ISRC2DEC3", NULL, "ISRC2CLK" },
1755 	{ "ISRC2DEC4", NULL, "ISRC2CLK" },
1756 	{ "ISRC2INT1", NULL, "ISRC2CLK" },
1757 	{ "ISRC2INT2", NULL, "ISRC2CLK" },
1758 	{ "ISRC2INT3", NULL, "ISRC2CLK" },
1759 	{ "ISRC2INT4", NULL, "ISRC2CLK" },
1760 	{ "ISRC3DEC1", NULL, "ISRC3CLK" },
1761 	{ "ISRC3DEC2", NULL, "ISRC3CLK" },
1762 	{ "ISRC3INT1", NULL, "ISRC3CLK" },
1763 	{ "ISRC3INT2", NULL, "ISRC3CLK" },
1764 	{ "ISRC4DEC1", NULL, "ISRC4CLK" },
1765 	{ "ISRC4DEC2", NULL, "ISRC4CLK" },
1766 	{ "ISRC4INT1", NULL, "ISRC4CLK" },
1767 	{ "ISRC4INT2", NULL, "ISRC4CLK" },
1768 	{ "ASRC1IN1L", NULL, "ASRC1CLK" },
1769 	{ "ASRC1IN1R", NULL, "ASRC1CLK" },
1770 	{ "ASRC1IN2L", NULL, "ASRC1CLK" },
1771 	{ "ASRC1IN2R", NULL, "ASRC1CLK" },
1772 	{ "ASRC2IN1L", NULL, "ASRC2CLK" },
1773 	{ "ASRC2IN1R", NULL, "ASRC2CLK" },
1774 	{ "ASRC2IN2L", NULL, "ASRC2CLK" },
1775 	{ "ASRC2IN2R", NULL, "ASRC2CLK" },
1776 
1777 	{ "AIF2 Capture", NULL, "DBVDD2" },
1778 	{ "AIF2 Playback", NULL, "DBVDD2" },
1779 
1780 	{ "AIF3 Capture", NULL, "DBVDD3" },
1781 	{ "AIF3 Playback", NULL, "DBVDD3" },
1782 
1783 	{ "AIF4 Capture", NULL, "DBVDD3" },
1784 	{ "AIF4 Playback", NULL, "DBVDD3" },
1785 
1786 	{ "OUT1L", NULL, "CPVDD1" },
1787 	{ "OUT1L", NULL, "CPVDD2" },
1788 	{ "OUT1R", NULL, "CPVDD1" },
1789 	{ "OUT1R", NULL, "CPVDD2" },
1790 	{ "OUT2L", NULL, "CPVDD1" },
1791 	{ "OUT2L", NULL, "CPVDD2" },
1792 	{ "OUT2R", NULL, "CPVDD1" },
1793 	{ "OUT2R", NULL, "CPVDD2" },
1794 	{ "OUT3L", NULL, "CPVDD1" },
1795 	{ "OUT3L", NULL, "CPVDD2" },
1796 	{ "OUT3R", NULL, "CPVDD1" },
1797 	{ "OUT3R", NULL, "CPVDD2" },
1798 
1799 	{ "OUT4L", NULL, "SPKVDDL" },
1800 	{ "OUT4R", NULL, "SPKVDDR" },
1801 
1802 	{ "OUT1L", NULL, "SYSCLK" },
1803 	{ "OUT1R", NULL, "SYSCLK" },
1804 	{ "OUT2L", NULL, "SYSCLK" },
1805 	{ "OUT2R", NULL, "SYSCLK" },
1806 	{ "OUT3L", NULL, "SYSCLK" },
1807 	{ "OUT3R", NULL, "SYSCLK" },
1808 	{ "OUT4L", NULL, "SYSCLK" },
1809 	{ "OUT4R", NULL, "SYSCLK" },
1810 	{ "OUT5L", NULL, "SYSCLK" },
1811 	{ "OUT5R", NULL, "SYSCLK" },
1812 	{ "OUT6L", NULL, "SYSCLK" },
1813 	{ "OUT6R", NULL, "SYSCLK" },
1814 
1815 	{ "SPD1", NULL, "SYSCLK" },
1816 	{ "SPD1", NULL, "SPD1TX1" },
1817 	{ "SPD1", NULL, "SPD1TX2" },
1818 
1819 	{ "IN1L", NULL, "SYSCLK" },
1820 	{ "IN1R", NULL, "SYSCLK" },
1821 	{ "IN2L", NULL, "SYSCLK" },
1822 	{ "IN2R", NULL, "SYSCLK" },
1823 	{ "IN3L", NULL, "SYSCLK" },
1824 	{ "IN3R", NULL, "SYSCLK" },
1825 	{ "IN4L", NULL, "SYSCLK" },
1826 	{ "IN4R", NULL, "SYSCLK" },
1827 	{ "IN5L", NULL, "SYSCLK" },
1828 	{ "IN5R", NULL, "SYSCLK" },
1829 	{ "IN6L", NULL, "SYSCLK" },
1830 	{ "IN6R", NULL, "SYSCLK" },
1831 
1832 	{ "IN4L", NULL, "DBVDD4" },
1833 	{ "IN4R", NULL, "DBVDD4" },
1834 	{ "IN5L", NULL, "DBVDD4" },
1835 	{ "IN5R", NULL, "DBVDD4" },
1836 	{ "IN6L", NULL, "DBVDD4" },
1837 	{ "IN6R", NULL, "DBVDD4" },
1838 
1839 	{ "ASRC1IN1L", NULL, "SYSCLK" },
1840 	{ "ASRC1IN1R", NULL, "SYSCLK" },
1841 	{ "ASRC1IN2L", NULL, "SYSCLK" },
1842 	{ "ASRC1IN2R", NULL, "SYSCLK" },
1843 	{ "ASRC2IN1L", NULL, "SYSCLK" },
1844 	{ "ASRC2IN1R", NULL, "SYSCLK" },
1845 	{ "ASRC2IN2L", NULL, "SYSCLK" },
1846 	{ "ASRC2IN2R", NULL, "SYSCLK" },
1847 
1848 	{ "ASRC1IN1L", NULL, "ASYNCCLK" },
1849 	{ "ASRC1IN1R", NULL, "ASYNCCLK" },
1850 	{ "ASRC1IN2L", NULL, "ASYNCCLK" },
1851 	{ "ASRC1IN2R", NULL, "ASYNCCLK" },
1852 	{ "ASRC2IN1L", NULL, "ASYNCCLK" },
1853 	{ "ASRC2IN1R", NULL, "ASYNCCLK" },
1854 	{ "ASRC2IN2L", NULL, "ASYNCCLK" },
1855 	{ "ASRC2IN2R", NULL, "ASYNCCLK" },
1856 
1857 	{ "MICBIAS1", NULL, "MICVDD" },
1858 	{ "MICBIAS2", NULL, "MICVDD" },
1859 	{ "MICBIAS3", NULL, "MICVDD" },
1860 	{ "MICBIAS4", NULL, "MICVDD" },
1861 
1862 	{ "Noise Generator", NULL, "SYSCLK" },
1863 	{ "Tone Generator 1", NULL, "SYSCLK" },
1864 	{ "Tone Generator 2", NULL, "SYSCLK" },
1865 
1866 	{ "Noise Generator", NULL, "NOISE" },
1867 	{ "Tone Generator 1", NULL, "TONE" },
1868 	{ "Tone Generator 2", NULL, "TONE" },
1869 
1870 	{ "AIF1 Capture", NULL, "AIF1TX1" },
1871 	{ "AIF1 Capture", NULL, "AIF1TX2" },
1872 	{ "AIF1 Capture", NULL, "AIF1TX3" },
1873 	{ "AIF1 Capture", NULL, "AIF1TX4" },
1874 	{ "AIF1 Capture", NULL, "AIF1TX5" },
1875 	{ "AIF1 Capture", NULL, "AIF1TX6" },
1876 	{ "AIF1 Capture", NULL, "AIF1TX7" },
1877 	{ "AIF1 Capture", NULL, "AIF1TX8" },
1878 
1879 	{ "AIF1RX1", NULL, "AIF1 Playback" },
1880 	{ "AIF1RX2", NULL, "AIF1 Playback" },
1881 	{ "AIF1RX3", NULL, "AIF1 Playback" },
1882 	{ "AIF1RX4", NULL, "AIF1 Playback" },
1883 	{ "AIF1RX5", NULL, "AIF1 Playback" },
1884 	{ "AIF1RX6", NULL, "AIF1 Playback" },
1885 	{ "AIF1RX7", NULL, "AIF1 Playback" },
1886 	{ "AIF1RX8", NULL, "AIF1 Playback" },
1887 
1888 	{ "AIF2 Capture", NULL, "AIF2TX1" },
1889 	{ "AIF2 Capture", NULL, "AIF2TX2" },
1890 	{ "AIF2 Capture", NULL, "AIF2TX3" },
1891 	{ "AIF2 Capture", NULL, "AIF2TX4" },
1892 	{ "AIF2 Capture", NULL, "AIF2TX5" },
1893 	{ "AIF2 Capture", NULL, "AIF2TX6" },
1894 	{ "AIF2 Capture", NULL, "AIF2TX7" },
1895 	{ "AIF2 Capture", NULL, "AIF2TX8" },
1896 
1897 	{ "AIF2RX1", NULL, "AIF2 Playback" },
1898 	{ "AIF2RX2", NULL, "AIF2 Playback" },
1899 	{ "AIF2RX3", NULL, "AIF2 Playback" },
1900 	{ "AIF2RX4", NULL, "AIF2 Playback" },
1901 	{ "AIF2RX5", NULL, "AIF2 Playback" },
1902 	{ "AIF2RX6", NULL, "AIF2 Playback" },
1903 	{ "AIF2RX7", NULL, "AIF2 Playback" },
1904 	{ "AIF2RX8", NULL, "AIF2 Playback" },
1905 
1906 	{ "AIF3 Capture", NULL, "AIF3TX1" },
1907 	{ "AIF3 Capture", NULL, "AIF3TX2" },
1908 
1909 	{ "AIF3RX1", NULL, "AIF3 Playback" },
1910 	{ "AIF3RX2", NULL, "AIF3 Playback" },
1911 
1912 	{ "AIF4 Capture", NULL, "AIF4TX1" },
1913 	{ "AIF4 Capture", NULL, "AIF4TX2" },
1914 
1915 	{ "AIF4RX1", NULL, "AIF4 Playback" },
1916 	{ "AIF4RX2", NULL, "AIF4 Playback" },
1917 
1918 	{ "Slim1 Capture", NULL, "SLIMTX1" },
1919 	{ "Slim1 Capture", NULL, "SLIMTX2" },
1920 	{ "Slim1 Capture", NULL, "SLIMTX3" },
1921 	{ "Slim1 Capture", NULL, "SLIMTX4" },
1922 
1923 	{ "SLIMRX1", NULL, "Slim1 Playback" },
1924 	{ "SLIMRX2", NULL, "Slim1 Playback" },
1925 	{ "SLIMRX3", NULL, "Slim1 Playback" },
1926 	{ "SLIMRX4", NULL, "Slim1 Playback" },
1927 
1928 	{ "Slim2 Capture", NULL, "SLIMTX5" },
1929 	{ "Slim2 Capture", NULL, "SLIMTX6" },
1930 
1931 	{ "SLIMRX5", NULL, "Slim2 Playback" },
1932 	{ "SLIMRX6", NULL, "Slim2 Playback" },
1933 
1934 	{ "Slim3 Capture", NULL, "SLIMTX7" },
1935 	{ "Slim3 Capture", NULL, "SLIMTX8" },
1936 
1937 	{ "SLIMRX7", NULL, "Slim3 Playback" },
1938 	{ "SLIMRX8", NULL, "Slim3 Playback" },
1939 
1940 	{ "AIF1 Playback", NULL, "SYSCLK" },
1941 	{ "AIF2 Playback", NULL, "SYSCLK" },
1942 	{ "AIF3 Playback", NULL, "SYSCLK" },
1943 	{ "AIF4 Playback", NULL, "SYSCLK" },
1944 	{ "Slim1 Playback", NULL, "SYSCLK" },
1945 	{ "Slim2 Playback", NULL, "SYSCLK" },
1946 	{ "Slim3 Playback", NULL, "SYSCLK" },
1947 
1948 	{ "AIF1 Capture", NULL, "SYSCLK" },
1949 	{ "AIF2 Capture", NULL, "SYSCLK" },
1950 	{ "AIF3 Capture", NULL, "SYSCLK" },
1951 	{ "AIF4 Capture", NULL, "SYSCLK" },
1952 	{ "Slim1 Capture", NULL, "SYSCLK" },
1953 	{ "Slim2 Capture", NULL, "SYSCLK" },
1954 	{ "Slim3 Capture", NULL, "SYSCLK" },
1955 
1956 	{ "Voice Control DSP", NULL, "DSP6" },
1957 
1958 	{ "Audio Trace DSP", NULL, "DSP1" },
1959 
1960 	{ "IN1L Analog Mux", "A", "IN1ALN" },
1961 	{ "IN1L Analog Mux", "A", "IN1ALP" },
1962 	{ "IN1L Analog Mux", "B", "IN1BN" },
1963 	{ "IN1L Analog Mux", "B", "IN1BP" },
1964 
1965 	{ "IN1L Mode", "Analog", "IN1L Analog Mux" },
1966 	{ "IN1R Mode", "Analog", "IN1RN" },
1967 	{ "IN1R Mode", "Analog", "IN1RP" },
1968 
1969 	{ "IN1L Mode", "Digital", "IN1ALN" },
1970 	{ "IN1L Mode", "Digital", "IN1RN" },
1971 	{ "IN1R Mode", "Digital", "IN1ALN" },
1972 	{ "IN1R Mode", "Digital", "IN1RN" },
1973 
1974 	{ "IN1L", NULL, "IN1L Mode" },
1975 	{ "IN1R", NULL, "IN1R Mode" },
1976 
1977 	{ "IN2L Analog Mux", "A", "IN2ALN" },
1978 	{ "IN2L Analog Mux", "A", "IN2ALP" },
1979 	{ "IN2L Analog Mux", "B", "IN2BLN" },
1980 	{ "IN2L Analog Mux", "B", "IN2BLP" },
1981 	{ "IN2R Analog Mux", "A", "IN2ARN" },
1982 	{ "IN2R Analog Mux", "A", "IN2ARP" },
1983 	{ "IN2R Analog Mux", "B", "IN2BRN" },
1984 	{ "IN2R Analog Mux", "B", "IN2BRP" },
1985 
1986 	{ "IN2L Mode", "Analog", "IN2L Analog Mux" },
1987 	{ "IN2R Mode", "Analog", "IN2R Analog Mux" },
1988 
1989 	{ "IN2L Mode", "Digital", "IN2ALN" },
1990 	{ "IN2L Mode", "Digital", "IN2ARN" },
1991 	{ "IN2R Mode", "Digital", "IN2ALN" },
1992 	{ "IN2R Mode", "Digital", "IN2ARN" },
1993 
1994 	{ "IN2L", NULL, "IN2L Mode" },
1995 	{ "IN2R", NULL, "IN2R Mode" },
1996 
1997 	{ "IN3L Mode", "Analog", "IN3LN" },
1998 	{ "IN3L Mode", "Analog", "IN3LP" },
1999 	{ "IN3R Mode", "Analog", "IN3RN" },
2000 	{ "IN3R Mode", "Analog", "IN3RP" },
2001 
2002 	{ "IN3L Mode", "Digital", "IN3LN" },
2003 	{ "IN3L Mode", "Digital", "IN3RN" },
2004 	{ "IN3R Mode", "Digital", "IN3LN" },
2005 	{ "IN3R Mode", "Digital", "IN3RN" },
2006 
2007 	{ "IN3L", NULL, "IN3L Mode" },
2008 	{ "IN3R", NULL, "IN3R Mode" },
2009 
2010 	{ "IN4L", NULL, "DMICCLK4" },
2011 	{ "IN4L", NULL, "DMICDAT4" },
2012 	{ "IN4R", NULL, "DMICCLK4" },
2013 	{ "IN4R", NULL, "DMICDAT4" },
2014 
2015 	{ "IN5L", NULL, "DMICCLK5" },
2016 	{ "IN5L", NULL, "DMICDAT5" },
2017 	{ "IN5R", NULL, "DMICCLK5" },
2018 	{ "IN5R", NULL, "DMICDAT5" },
2019 
2020 	{ "IN6L", NULL, "DMICCLK6" },
2021 	{ "IN6L", NULL, "DMICDAT6" },
2022 	{ "IN6R", NULL, "DMICCLK6" },
2023 	{ "IN6R", NULL, "DMICDAT6" },
2024 
2025 	MADERA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
2026 	MADERA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
2027 	MADERA_MIXER_ROUTES("OUT2L", "HPOUT2L"),
2028 	MADERA_MIXER_ROUTES("OUT2R", "HPOUT2R"),
2029 	MADERA_MIXER_ROUTES("OUT3L", "HPOUT3L"),
2030 	MADERA_MIXER_ROUTES("OUT3R", "HPOUT3R"),
2031 
2032 	MADERA_MIXER_ROUTES("OUT4L", "SPKOUTL"),
2033 	MADERA_MIXER_ROUTES("OUT4R", "SPKOUTR"),
2034 	MADERA_MIXER_ROUTES("OUT5L", "SPKDAT1L"),
2035 	MADERA_MIXER_ROUTES("OUT5R", "SPKDAT1R"),
2036 	MADERA_MIXER_ROUTES("OUT6L", "SPKDAT2L"),
2037 	MADERA_MIXER_ROUTES("OUT6R", "SPKDAT2R"),
2038 
2039 	MADERA_MIXER_ROUTES("PWM1 Driver", "PWM1"),
2040 	MADERA_MIXER_ROUTES("PWM2 Driver", "PWM2"),
2041 
2042 	MADERA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"),
2043 	MADERA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"),
2044 	MADERA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"),
2045 	MADERA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"),
2046 	MADERA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"),
2047 	MADERA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"),
2048 	MADERA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"),
2049 	MADERA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"),
2050 
2051 	MADERA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"),
2052 	MADERA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"),
2053 	MADERA_MIXER_ROUTES("AIF2TX3", "AIF2TX3"),
2054 	MADERA_MIXER_ROUTES("AIF2TX4", "AIF2TX4"),
2055 	MADERA_MIXER_ROUTES("AIF2TX5", "AIF2TX5"),
2056 	MADERA_MIXER_ROUTES("AIF2TX6", "AIF2TX6"),
2057 	MADERA_MIXER_ROUTES("AIF2TX7", "AIF2TX7"),
2058 	MADERA_MIXER_ROUTES("AIF2TX8", "AIF2TX8"),
2059 
2060 	MADERA_MIXER_ROUTES("AIF3TX1", "AIF3TX1"),
2061 	MADERA_MIXER_ROUTES("AIF3TX2", "AIF3TX2"),
2062 
2063 	MADERA_MIXER_ROUTES("AIF4TX1", "AIF4TX1"),
2064 	MADERA_MIXER_ROUTES("AIF4TX2", "AIF4TX2"),
2065 
2066 	MADERA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"),
2067 	MADERA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"),
2068 	MADERA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"),
2069 	MADERA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"),
2070 	MADERA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"),
2071 	MADERA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"),
2072 	MADERA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"),
2073 	MADERA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"),
2074 
2075 	MADERA_MUX_ROUTES("SPD1TX1", "SPDIF1TX1"),
2076 	MADERA_MUX_ROUTES("SPD1TX2", "SPDIF1TX2"),
2077 
2078 	MADERA_MIXER_ROUTES("EQ1", "EQ1"),
2079 	MADERA_MIXER_ROUTES("EQ2", "EQ2"),
2080 	MADERA_MIXER_ROUTES("EQ3", "EQ3"),
2081 	MADERA_MIXER_ROUTES("EQ4", "EQ4"),
2082 
2083 	MADERA_MIXER_ROUTES("DRC1L", "DRC1L"),
2084 	MADERA_MIXER_ROUTES("DRC1R", "DRC1R"),
2085 	MADERA_MIXER_ROUTES("DRC2L", "DRC2L"),
2086 	MADERA_MIXER_ROUTES("DRC2R", "DRC2R"),
2087 
2088 	MADERA_MIXER_ROUTES("LHPF1", "LHPF1"),
2089 	MADERA_MIXER_ROUTES("LHPF2", "LHPF2"),
2090 	MADERA_MIXER_ROUTES("LHPF3", "LHPF3"),
2091 	MADERA_MIXER_ROUTES("LHPF4", "LHPF4"),
2092 
2093 	MADERA_MUX_ROUTES("ASRC1IN1L", "ASRC1IN1L"),
2094 	MADERA_MUX_ROUTES("ASRC1IN1R", "ASRC1IN1R"),
2095 	MADERA_MUX_ROUTES("ASRC1IN2L", "ASRC1IN2L"),
2096 	MADERA_MUX_ROUTES("ASRC1IN2R", "ASRC1IN2R"),
2097 	MADERA_MUX_ROUTES("ASRC2IN1L", "ASRC2IN1L"),
2098 	MADERA_MUX_ROUTES("ASRC2IN1R", "ASRC2IN1R"),
2099 	MADERA_MUX_ROUTES("ASRC2IN2L", "ASRC2IN2L"),
2100 	MADERA_MUX_ROUTES("ASRC2IN2R", "ASRC2IN2R"),
2101 
2102 	MADERA_DSP_ROUTES("DSP1"),
2103 	MADERA_DSP_ROUTES("DSP2"),
2104 	MADERA_DSP_ROUTES("DSP3"),
2105 	MADERA_DSP_ROUTES("DSP4"),
2106 	MADERA_DSP_ROUTES("DSP5"),
2107 	MADERA_DSP_ROUTES("DSP6"),
2108 	MADERA_DSP_ROUTES("DSP7"),
2109 
2110 	{ "DSP Trigger Out", NULL, "DSP1 Trigger Output" },
2111 	{ "DSP Trigger Out", NULL, "DSP2 Trigger Output" },
2112 	{ "DSP Trigger Out", NULL, "DSP3 Trigger Output" },
2113 	{ "DSP Trigger Out", NULL, "DSP4 Trigger Output" },
2114 	{ "DSP Trigger Out", NULL, "DSP5 Trigger Output" },
2115 	{ "DSP Trigger Out", NULL, "DSP6 Trigger Output" },
2116 	{ "DSP Trigger Out", NULL, "DSP7 Trigger Output" },
2117 
2118 	{ "DSP1 Trigger Output", "Switch", "DSP1" },
2119 	{ "DSP2 Trigger Output", "Switch", "DSP2" },
2120 	{ "DSP3 Trigger Output", "Switch", "DSP3" },
2121 	{ "DSP4 Trigger Output", "Switch", "DSP4" },
2122 	{ "DSP5 Trigger Output", "Switch", "DSP5" },
2123 	{ "DSP6 Trigger Output", "Switch", "DSP6" },
2124 	{ "DSP7 Trigger Output", "Switch", "DSP7" },
2125 
2126 	MADERA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"),
2127 	MADERA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"),
2128 	MADERA_MUX_ROUTES("ISRC1INT3", "ISRC1INT3"),
2129 	MADERA_MUX_ROUTES("ISRC1INT4", "ISRC1INT4"),
2130 
2131 	MADERA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"),
2132 	MADERA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"),
2133 	MADERA_MUX_ROUTES("ISRC1DEC3", "ISRC1DEC3"),
2134 	MADERA_MUX_ROUTES("ISRC1DEC4", "ISRC1DEC4"),
2135 
2136 	MADERA_MUX_ROUTES("ISRC2INT1", "ISRC2INT1"),
2137 	MADERA_MUX_ROUTES("ISRC2INT2", "ISRC2INT2"),
2138 	MADERA_MUX_ROUTES("ISRC2INT3", "ISRC2INT3"),
2139 	MADERA_MUX_ROUTES("ISRC2INT4", "ISRC2INT4"),
2140 
2141 	MADERA_MUX_ROUTES("ISRC2DEC1", "ISRC2DEC1"),
2142 	MADERA_MUX_ROUTES("ISRC2DEC2", "ISRC2DEC2"),
2143 	MADERA_MUX_ROUTES("ISRC2DEC3", "ISRC2DEC3"),
2144 	MADERA_MUX_ROUTES("ISRC2DEC4", "ISRC2DEC4"),
2145 
2146 	MADERA_MUX_ROUTES("ISRC3INT1", "ISRC3INT1"),
2147 	MADERA_MUX_ROUTES("ISRC3INT2", "ISRC3INT2"),
2148 
2149 	MADERA_MUX_ROUTES("ISRC3DEC1", "ISRC3DEC1"),
2150 	MADERA_MUX_ROUTES("ISRC3DEC2", "ISRC3DEC2"),
2151 
2152 	MADERA_MUX_ROUTES("ISRC4INT1", "ISRC4INT1"),
2153 	MADERA_MUX_ROUTES("ISRC4INT2", "ISRC4INT2"),
2154 
2155 	MADERA_MUX_ROUTES("ISRC4DEC1", "ISRC4DEC1"),
2156 	MADERA_MUX_ROUTES("ISRC4DEC2", "ISRC4DEC2"),
2157 
2158 	{ "AEC1 Loopback", "HPOUT1L", "OUT1L" },
2159 	{ "AEC1 Loopback", "HPOUT1R", "OUT1R" },
2160 	{ "AEC2 Loopback", "HPOUT1L", "OUT1L" },
2161 	{ "AEC2 Loopback", "HPOUT1R", "OUT1R" },
2162 	{ "HPOUT1L", NULL, "OUT1L" },
2163 	{ "HPOUT1R", NULL, "OUT1R" },
2164 
2165 	{ "AEC1 Loopback", "HPOUT2L", "OUT2L" },
2166 	{ "AEC1 Loopback", "HPOUT2R", "OUT2R" },
2167 	{ "AEC2 Loopback", "HPOUT2L", "OUT2L" },
2168 	{ "AEC2 Loopback", "HPOUT2R", "OUT2R" },
2169 	{ "HPOUT2L", NULL, "OUT2L" },
2170 	{ "HPOUT2R", NULL, "OUT2R" },
2171 
2172 	{ "AEC1 Loopback", "HPOUT3L", "OUT3L" },
2173 	{ "AEC1 Loopback", "HPOUT3R", "OUT3R" },
2174 	{ "AEC2 Loopback", "HPOUT3L", "OUT3L" },
2175 	{ "AEC2 Loopback", "HPOUT3R", "OUT3R" },
2176 	{ "HPOUT3L", NULL, "OUT3L" },
2177 	{ "HPOUT3R", NULL, "OUT3R" },
2178 
2179 	{ "AEC1 Loopback", "SPKOUTL", "OUT4L" },
2180 	{ "AEC2 Loopback", "SPKOUTL", "OUT4L" },
2181 	{ "SPKOUTLN", NULL, "OUT4L" },
2182 	{ "SPKOUTLP", NULL, "OUT4L" },
2183 
2184 	{ "AEC1 Loopback", "SPKOUTR", "OUT4R" },
2185 	{ "AEC2 Loopback", "SPKOUTR", "OUT4R" },
2186 	{ "SPKOUTRN", NULL, "OUT4R" },
2187 	{ "SPKOUTRP", NULL, "OUT4R" },
2188 
2189 	{ "AEC1 Loopback", "SPKDAT1L", "OUT5L" },
2190 	{ "AEC1 Loopback", "SPKDAT1R", "OUT5R" },
2191 	{ "AEC2 Loopback", "SPKDAT1L", "OUT5L" },
2192 	{ "AEC2 Loopback", "SPKDAT1R", "OUT5R" },
2193 	{ "SPKDAT1L", NULL, "OUT5L" },
2194 	{ "SPKDAT1R", NULL, "OUT5R" },
2195 
2196 	{ "AEC1 Loopback", "SPKDAT2L", "OUT6L" },
2197 	{ "AEC1 Loopback", "SPKDAT2R", "OUT6R" },
2198 	{ "AEC2 Loopback", "SPKDAT2L", "OUT6L" },
2199 	{ "AEC2 Loopback", "SPKDAT2R", "OUT6R" },
2200 	{ "SPKDAT2L", NULL, "OUT6L" },
2201 	{ "SPKDAT2R", NULL, "OUT6R" },
2202 
2203 	CS47L85_RXANC_INPUT_ROUTES("RXANCL", "RXANCL"),
2204 	CS47L85_RXANC_INPUT_ROUTES("RXANCR", "RXANCR"),
2205 
2206 	CS47L85_RXANC_OUTPUT_ROUTES("OUT1L", "HPOUT1L"),
2207 	CS47L85_RXANC_OUTPUT_ROUTES("OUT1R", "HPOUT1R"),
2208 	CS47L85_RXANC_OUTPUT_ROUTES("OUT2L", "HPOUT2L"),
2209 	CS47L85_RXANC_OUTPUT_ROUTES("OUT2R", "HPOUT2R"),
2210 	CS47L85_RXANC_OUTPUT_ROUTES("OUT3L", "HPOUT3L"),
2211 	CS47L85_RXANC_OUTPUT_ROUTES("OUT3R", "HPOUT3R"),
2212 	CS47L85_RXANC_OUTPUT_ROUTES("OUT4L", "SPKOUTL"),
2213 	CS47L85_RXANC_OUTPUT_ROUTES("OUT4R", "SPKOUTR"),
2214 	CS47L85_RXANC_OUTPUT_ROUTES("OUT5L", "SPKDAT1L"),
2215 	CS47L85_RXANC_OUTPUT_ROUTES("OUT5R", "SPKDAT1R"),
2216 	CS47L85_RXANC_OUTPUT_ROUTES("OUT6L", "SPKDAT2L"),
2217 	CS47L85_RXANC_OUTPUT_ROUTES("OUT6R", "SPKDAT2R"),
2218 
2219 	{ "SPDIF1", NULL, "SPD1" },
2220 
2221 	{ "MICSUPP", NULL, "SYSCLK" },
2222 
2223 	{ "DRC1 Signal Activity", NULL, "DRC1 Activity Output" },
2224 	{ "DRC2 Signal Activity", NULL, "DRC2 Activity Output" },
2225 	{ "DRC1 Activity Output", "Switch", "DRC1L" },
2226 	{ "DRC1 Activity Output", "Switch", "DRC1R" },
2227 	{ "DRC2 Activity Output", "Switch", "DRC2L" },
2228 	{ "DRC2 Activity Output", "Switch", "DRC2R" },
2229 };
2230 
2231 static int cs47l85_set_fll(struct snd_soc_component *component, int fll_id,
2232 			   int source, unsigned int fref, unsigned int fout)
2233 {
2234 	struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
2235 
2236 	switch (fll_id) {
2237 	case MADERA_FLL1_REFCLK:
2238 		return madera_set_fll_refclk(&cs47l85->fll[0], source, fref,
2239 					     fout);
2240 	case MADERA_FLL2_REFCLK:
2241 		return madera_set_fll_refclk(&cs47l85->fll[1], source, fref,
2242 					     fout);
2243 	case MADERA_FLL3_REFCLK:
2244 		return madera_set_fll_refclk(&cs47l85->fll[2], source, fref,
2245 					     fout);
2246 	case MADERA_FLL1_SYNCCLK:
2247 		return madera_set_fll_syncclk(&cs47l85->fll[0], source, fref,
2248 					      fout);
2249 	case MADERA_FLL2_SYNCCLK:
2250 		return madera_set_fll_syncclk(&cs47l85->fll[1], source, fref,
2251 					      fout);
2252 	case MADERA_FLL3_SYNCCLK:
2253 		return madera_set_fll_syncclk(&cs47l85->fll[2], source, fref,
2254 					      fout);
2255 	default:
2256 		return -EINVAL;
2257 	}
2258 }
2259 
2260 static struct snd_soc_dai_driver cs47l85_dai[] = {
2261 	{
2262 		.name = "cs47l85-aif1",
2263 		.id = 1,
2264 		.base = MADERA_AIF1_BCLK_CTRL,
2265 		.playback = {
2266 			.stream_name = "AIF1 Playback",
2267 			.channels_min = 1,
2268 			.channels_max = 8,
2269 			.rates = MADERA_RATES,
2270 			.formats = MADERA_FORMATS,
2271 		},
2272 		.capture = {
2273 			.stream_name = "AIF1 Capture",
2274 			.channels_min = 1,
2275 			.channels_max = 8,
2276 			.rates = MADERA_RATES,
2277 			.formats = MADERA_FORMATS,
2278 		 },
2279 		.ops = &madera_dai_ops,
2280 		.symmetric_rates = 1,
2281 		.symmetric_samplebits = 1,
2282 	},
2283 	{
2284 		.name = "cs47l85-aif2",
2285 		.id = 2,
2286 		.base = MADERA_AIF2_BCLK_CTRL,
2287 		.playback = {
2288 			.stream_name = "AIF2 Playback",
2289 			.channels_min = 1,
2290 			.channels_max = 8,
2291 			.rates = MADERA_RATES,
2292 			.formats = MADERA_FORMATS,
2293 		},
2294 		.capture = {
2295 			.stream_name = "AIF2 Capture",
2296 			.channels_min = 1,
2297 			.channels_max = 8,
2298 			.rates = MADERA_RATES,
2299 			.formats = MADERA_FORMATS,
2300 		 },
2301 		.ops = &madera_dai_ops,
2302 		.symmetric_rates = 1,
2303 		.symmetric_samplebits = 1,
2304 	},
2305 	{
2306 		.name = "cs47l85-aif3",
2307 		.id = 3,
2308 		.base = MADERA_AIF3_BCLK_CTRL,
2309 		.playback = {
2310 			.stream_name = "AIF3 Playback",
2311 			.channels_min = 1,
2312 			.channels_max = 2,
2313 			.rates = MADERA_RATES,
2314 			.formats = MADERA_FORMATS,
2315 		},
2316 		.capture = {
2317 			.stream_name = "AIF3 Capture",
2318 			.channels_min = 1,
2319 			.channels_max = 2,
2320 			.rates = MADERA_RATES,
2321 			.formats = MADERA_FORMATS,
2322 		 },
2323 		.ops = &madera_dai_ops,
2324 		.symmetric_rates = 1,
2325 		.symmetric_samplebits = 1,
2326 	},
2327 	{
2328 		.name = "cs47l85-aif4",
2329 		.id = 4,
2330 		.base = MADERA_AIF4_BCLK_CTRL,
2331 		.playback = {
2332 			.stream_name = "AIF4 Playback",
2333 			.channels_min = 1,
2334 			.channels_max = 2,
2335 			.rates = MADERA_RATES,
2336 			.formats = MADERA_FORMATS,
2337 		},
2338 		.capture = {
2339 			.stream_name = "AIF4 Capture",
2340 			.channels_min = 1,
2341 			.channels_max = 2,
2342 			.rates = MADERA_RATES,
2343 			.formats = MADERA_FORMATS,
2344 		 },
2345 		.ops = &madera_dai_ops,
2346 		.symmetric_rates = 1,
2347 		.symmetric_samplebits = 1,
2348 	},
2349 	{
2350 		.name = "cs47l85-slim1",
2351 		.id = 5,
2352 		.playback = {
2353 			.stream_name = "Slim1 Playback",
2354 			.channels_min = 1,
2355 			.channels_max = 4,
2356 			.rates = MADERA_RATES,
2357 			.formats = MADERA_FORMATS,
2358 		},
2359 		.capture = {
2360 			.stream_name = "Slim1 Capture",
2361 			.channels_min = 1,
2362 			.channels_max = 4,
2363 			.rates = MADERA_RATES,
2364 			.formats = MADERA_FORMATS,
2365 		 },
2366 		.ops = &madera_simple_dai_ops,
2367 	},
2368 	{
2369 		.name = "cs47l85-slim2",
2370 		.id = 6,
2371 		.playback = {
2372 			.stream_name = "Slim2 Playback",
2373 			.channels_min = 1,
2374 			.channels_max = 2,
2375 			.rates = MADERA_RATES,
2376 			.formats = MADERA_FORMATS,
2377 		},
2378 		.capture = {
2379 			.stream_name = "Slim2 Capture",
2380 			.channels_min = 1,
2381 			.channels_max = 2,
2382 			.rates = MADERA_RATES,
2383 			.formats = MADERA_FORMATS,
2384 		 },
2385 		.ops = &madera_simple_dai_ops,
2386 	},
2387 	{
2388 		.name = "cs47l85-slim3",
2389 		.id = 7,
2390 		.playback = {
2391 			.stream_name = "Slim3 Playback",
2392 			.channels_min = 1,
2393 			.channels_max = 2,
2394 			.rates = MADERA_RATES,
2395 			.formats = MADERA_FORMATS,
2396 		},
2397 		.capture = {
2398 			.stream_name = "Slim3 Capture",
2399 			.channels_min = 1,
2400 			.channels_max = 2,
2401 			.rates = MADERA_RATES,
2402 			.formats = MADERA_FORMATS,
2403 		 },
2404 		.ops = &madera_simple_dai_ops,
2405 	},
2406 	{
2407 		.name = "cs47l85-cpu-voicectrl",
2408 		.capture = {
2409 			.stream_name = "Voice Control CPU",
2410 			.channels_min = 1,
2411 			.channels_max = 1,
2412 			.rates = MADERA_RATES,
2413 			.formats = MADERA_FORMATS,
2414 		},
2415 		.compress_new = &snd_soc_new_compress,
2416 	},
2417 	{
2418 		.name = "cs47l85-dsp-voicectrl",
2419 		.capture = {
2420 			.stream_name = "Voice Control DSP",
2421 			.channels_min = 1,
2422 			.channels_max = 1,
2423 			.rates = MADERA_RATES,
2424 			.formats = MADERA_FORMATS,
2425 		},
2426 	},
2427 	{
2428 		.name = "cs47l85-cpu-trace",
2429 		.capture = {
2430 			.stream_name = "Audio Trace CPU",
2431 			.channels_min = 1,
2432 			.channels_max = 6,
2433 			.rates = MADERA_RATES,
2434 			.formats = MADERA_FORMATS,
2435 		},
2436 		.compress_new = &snd_soc_new_compress,
2437 	},
2438 	{
2439 		.name = "cs47l85-dsp-trace",
2440 		.capture = {
2441 			.stream_name = "Audio Trace DSP",
2442 			.channels_min = 1,
2443 			.channels_max = 6,
2444 			.rates = MADERA_RATES,
2445 			.formats = MADERA_FORMATS,
2446 		},
2447 	},
2448 };
2449 
2450 static int cs47l85_open(struct snd_soc_component *component,
2451 			struct snd_compr_stream *stream)
2452 {
2453 	struct snd_soc_pcm_runtime *rtd = stream->private_data;
2454 	struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
2455 	struct madera_priv *priv = &cs47l85->core;
2456 	struct madera *madera = priv->madera;
2457 	int n_adsp;
2458 
2459 	if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-voicectrl") == 0) {
2460 		n_adsp = 5;
2461 	} else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-trace") == 0) {
2462 		n_adsp = 0;
2463 	} else {
2464 		dev_err(madera->dev,
2465 			"No suitable compressed stream for DAI '%s'\n",
2466 			asoc_rtd_to_codec(rtd, 0)->name);
2467 		return -EINVAL;
2468 	}
2469 
2470 	return wm_adsp_compr_open(&priv->adsp[n_adsp], stream);
2471 }
2472 
2473 static irqreturn_t cs47l85_adsp2_irq(int irq, void *data)
2474 {
2475 	struct cs47l85 *cs47l85 = data;
2476 	struct madera_priv *priv = &cs47l85->core;
2477 	struct madera *madera = priv->madera;
2478 	struct madera_voice_trigger_info trig_info;
2479 	int serviced = 0;
2480 	int i, ret;
2481 
2482 	for (i = 0; i < CS47L85_NUM_ADSP; ++i) {
2483 		ret = wm_adsp_compr_handle_irq(&priv->adsp[i]);
2484 		if (ret != -ENODEV)
2485 			serviced++;
2486 		if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) {
2487 			trig_info.core_num = i + 1;
2488 			blocking_notifier_call_chain(&madera->notifier,
2489 						MADERA_NOTIFY_VOICE_TRIGGER,
2490 						&trig_info);
2491 		}
2492 	}
2493 
2494 	if (!serviced) {
2495 		dev_err(madera->dev, "Spurious compressed data IRQ\n");
2496 		return IRQ_NONE;
2497 	}
2498 
2499 	return IRQ_HANDLED;
2500 }
2501 
2502 static int cs47l85_component_probe(struct snd_soc_component *component)
2503 {
2504 	struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
2505 	struct madera *madera = cs47l85->core.madera;
2506 	int i, ret;
2507 
2508 	snd_soc_component_init_regmap(component, madera->regmap);
2509 
2510 	mutex_lock(&madera->dapm_ptr_lock);
2511 	madera->dapm = snd_soc_component_get_dapm(component);
2512 	mutex_unlock(&madera->dapm_ptr_lock);
2513 
2514 	ret = madera_init_inputs(component);
2515 	if (ret)
2516 		return ret;
2517 
2518 	ret = madera_init_outputs(component, NULL, CS47L85_MONO_OUTPUTS,
2519 				  CS47L85_MONO_OUTPUTS);
2520 	if (ret)
2521 		return ret;
2522 
2523 	snd_soc_component_disable_pin(component, "HAPTICS");
2524 
2525 	ret = snd_soc_add_component_controls(component,
2526 					     madera_adsp_rate_controls,
2527 					     CS47L85_NUM_ADSP);
2528 	if (ret)
2529 		return ret;
2530 
2531 	for (i = 0; i < CS47L85_NUM_ADSP; i++)
2532 		wm_adsp2_component_probe(&cs47l85->core.adsp[i], component);
2533 
2534 	return 0;
2535 }
2536 
2537 static void cs47l85_component_remove(struct snd_soc_component *component)
2538 {
2539 	struct cs47l85 *cs47l85 = snd_soc_component_get_drvdata(component);
2540 	struct madera *madera = cs47l85->core.madera;
2541 	int i;
2542 
2543 	mutex_lock(&madera->dapm_ptr_lock);
2544 	madera->dapm = NULL;
2545 	mutex_unlock(&madera->dapm_ptr_lock);
2546 
2547 	for (i = 0; i < CS47L85_NUM_ADSP; i++)
2548 		wm_adsp2_component_remove(&cs47l85->core.adsp[i], component);
2549 }
2550 
2551 #define MADERA_DIG_VU 0x0200
2552 
2553 static const unsigned int cs47l85_digital_vu[] = {
2554 	MADERA_DAC_DIGITAL_VOLUME_1L,
2555 	MADERA_DAC_DIGITAL_VOLUME_1R,
2556 	MADERA_DAC_DIGITAL_VOLUME_2L,
2557 	MADERA_DAC_DIGITAL_VOLUME_2R,
2558 	MADERA_DAC_DIGITAL_VOLUME_3L,
2559 	MADERA_DAC_DIGITAL_VOLUME_3R,
2560 	MADERA_DAC_DIGITAL_VOLUME_4L,
2561 	MADERA_DAC_DIGITAL_VOLUME_4R,
2562 	MADERA_DAC_DIGITAL_VOLUME_5L,
2563 	MADERA_DAC_DIGITAL_VOLUME_5R,
2564 	MADERA_DAC_DIGITAL_VOLUME_6L,
2565 	MADERA_DAC_DIGITAL_VOLUME_6R,
2566 };
2567 
2568 static const struct snd_compress_ops cs47l85_compress_ops = {
2569 	.open = &cs47l85_open,
2570 	.free = &wm_adsp_compr_free,
2571 	.set_params = &wm_adsp_compr_set_params,
2572 	.get_caps = &wm_adsp_compr_get_caps,
2573 	.trigger = &wm_adsp_compr_trigger,
2574 	.pointer = &wm_adsp_compr_pointer,
2575 	.copy = &wm_adsp_compr_copy,
2576 };
2577 
2578 static const struct snd_soc_component_driver soc_component_dev_cs47l85 = {
2579 	.probe			= &cs47l85_component_probe,
2580 	.remove			= &cs47l85_component_remove,
2581 	.set_sysclk		= &madera_set_sysclk,
2582 	.set_pll		= &cs47l85_set_fll,
2583 	.name			= DRV_NAME,
2584 	.compress_ops		= &cs47l85_compress_ops,
2585 	.controls		= cs47l85_snd_controls,
2586 	.num_controls		= ARRAY_SIZE(cs47l85_snd_controls),
2587 	.dapm_widgets		= cs47l85_dapm_widgets,
2588 	.num_dapm_widgets	= ARRAY_SIZE(cs47l85_dapm_widgets),
2589 	.dapm_routes		= cs47l85_dapm_routes,
2590 	.num_dapm_routes	= ARRAY_SIZE(cs47l85_dapm_routes),
2591 	.use_pmdown_time	= 1,
2592 	.endianness		= 1,
2593 	.non_legacy_dai_naming	= 1,
2594 };
2595 
2596 static int cs47l85_probe(struct platform_device *pdev)
2597 {
2598 	struct madera *madera = dev_get_drvdata(pdev->dev.parent);
2599 	struct cs47l85 *cs47l85;
2600 	int i, ret;
2601 
2602 	BUILD_BUG_ON(ARRAY_SIZE(cs47l85_dai) > MADERA_MAX_DAI);
2603 
2604 	/* quick exit if Madera irqchip driver hasn't completed probe */
2605 	if (!madera->irq_dev) {
2606 		dev_dbg(&pdev->dev, "irqchip driver not ready\n");
2607 		return -EPROBE_DEFER;
2608 	}
2609 
2610 	cs47l85 = devm_kzalloc(&pdev->dev, sizeof(struct cs47l85),
2611 			       GFP_KERNEL);
2612 	if (!cs47l85)
2613 		return -ENOMEM;
2614 
2615 	platform_set_drvdata(pdev, cs47l85);
2616 
2617 	cs47l85->core.madera = madera;
2618 	cs47l85->core.dev = &pdev->dev;
2619 	cs47l85->core.num_inputs = 12;
2620 
2621 	ret = madera_core_init(&cs47l85->core);
2622 	if (ret)
2623 		return ret;
2624 
2625 	ret = madera_init_overheat(&cs47l85->core);
2626 	if (ret)
2627 		goto error_core;
2628 
2629 	ret = madera_request_irq(madera, MADERA_IRQ_DSP_IRQ1,
2630 				 "ADSP2 Compressed IRQ", cs47l85_adsp2_irq,
2631 				 cs47l85);
2632 	if (ret) {
2633 		dev_err(&pdev->dev, "Failed to request DSP IRQ: %d\n", ret);
2634 		goto error_overheat;
2635 	}
2636 
2637 	ret = madera_set_irq_wake(madera, MADERA_IRQ_DSP_IRQ1, 1);
2638 	if (ret)
2639 		dev_warn(&pdev->dev, "Failed to set DSP IRQ wake: %d\n", ret);
2640 
2641 	for (i = 0; i < CS47L85_NUM_ADSP; i++) {
2642 		cs47l85->core.adsp[i].part = "cs47l85";
2643 		cs47l85->core.adsp[i].num = i + 1;
2644 		cs47l85->core.adsp[i].type = WMFW_ADSP2;
2645 		cs47l85->core.adsp[i].rev = 1;
2646 		cs47l85->core.adsp[i].dev = madera->dev;
2647 		cs47l85->core.adsp[i].regmap = madera->regmap_32bit;
2648 
2649 		cs47l85->core.adsp[i].base = wm_adsp2_control_bases[i];
2650 		cs47l85->core.adsp[i].mem = cs47l85_dsp_regions[i];
2651 		cs47l85->core.adsp[i].num_mems =
2652 			ARRAY_SIZE(cs47l85_dsp1_regions);
2653 
2654 		ret = wm_adsp2_init(&cs47l85->core.adsp[i]);
2655 		if (ret) {
2656 			for (--i; i >= 0; --i)
2657 				wm_adsp2_remove(&cs47l85->core.adsp[i]);
2658 			goto error_dsp_irq;
2659 		}
2660 	}
2661 
2662 	madera_init_fll(madera, 1, MADERA_FLL1_CONTROL_1 - 1,
2663 			&cs47l85->fll[0]);
2664 	madera_init_fll(madera, 2, MADERA_FLL2_CONTROL_1 - 1,
2665 			&cs47l85->fll[1]);
2666 	madera_init_fll(madera, 3, MADERA_FLL3_CONTROL_1 - 1,
2667 			&cs47l85->fll[2]);
2668 
2669 	for (i = 0; i < ARRAY_SIZE(cs47l85_dai); i++)
2670 		madera_init_dai(&cs47l85->core, i);
2671 
2672 	/* Latch volume update bits */
2673 	for (i = 0; i < ARRAY_SIZE(cs47l85_digital_vu); i++)
2674 		regmap_update_bits(madera->regmap, cs47l85_digital_vu[i],
2675 				   MADERA_DIG_VU, MADERA_DIG_VU);
2676 
2677 	pm_runtime_enable(&pdev->dev);
2678 	pm_runtime_idle(&pdev->dev);
2679 
2680 	ret = devm_snd_soc_register_component(&pdev->dev,
2681 					      &soc_component_dev_cs47l85,
2682 					      cs47l85_dai,
2683 					      ARRAY_SIZE(cs47l85_dai));
2684 	if (ret < 0) {
2685 		dev_err(&pdev->dev, "Failed to register component: %d\n", ret);
2686 		goto error_pm_runtime;
2687 	}
2688 
2689 	return ret;
2690 
2691 error_pm_runtime:
2692 	pm_runtime_disable(&pdev->dev);
2693 
2694 	for (i = 0; i < CS47L85_NUM_ADSP; i++)
2695 		wm_adsp2_remove(&cs47l85->core.adsp[i]);
2696 error_dsp_irq:
2697 	madera_set_irq_wake(madera, MADERA_IRQ_DSP_IRQ1, 0);
2698 	madera_free_irq(madera, MADERA_IRQ_DSP_IRQ1, cs47l85);
2699 error_overheat:
2700 	madera_free_overheat(&cs47l85->core);
2701 error_core:
2702 	madera_core_free(&cs47l85->core);
2703 
2704 	return ret;
2705 }
2706 
2707 static int cs47l85_remove(struct platform_device *pdev)
2708 {
2709 	struct cs47l85 *cs47l85 = platform_get_drvdata(pdev);
2710 	int i;
2711 
2712 	pm_runtime_disable(&pdev->dev);
2713 
2714 	for (i = 0; i < CS47L85_NUM_ADSP; i++)
2715 		wm_adsp2_remove(&cs47l85->core.adsp[i]);
2716 
2717 	madera_set_irq_wake(cs47l85->core.madera, MADERA_IRQ_DSP_IRQ1, 0);
2718 	madera_free_irq(cs47l85->core.madera, MADERA_IRQ_DSP_IRQ1, cs47l85);
2719 	madera_free_overheat(&cs47l85->core);
2720 	madera_core_free(&cs47l85->core);
2721 
2722 	return 0;
2723 }
2724 
2725 static struct platform_driver cs47l85_codec_driver = {
2726 	.driver = {
2727 		.name = "cs47l85-codec",
2728 	},
2729 	.probe = &cs47l85_probe,
2730 	.remove = &cs47l85_remove,
2731 };
2732 
2733 module_platform_driver(cs47l85_codec_driver);
2734 
2735 MODULE_SOFTDEP("pre: madera irq-madera arizona-micsupp");
2736 MODULE_DESCRIPTION("ASoC CS47L85 driver");
2737 MODULE_AUTHOR("Nariman Poushin <nariman@opensource.cirrus.com>");
2738 MODULE_LICENSE("GPL v2");
2739 MODULE_ALIAS("platform:cs47l85-codec");
2740