This source file includes following definitions.
- cs47l92_put_demux
- cs47l92_adsp_power_ev
- cs47l92_set_fll
- cs47l92_open
- cs47l92_adsp2_irq
- cs47l92_component_probe
- cs47l92_component_remove
- cs47l92_probe
- cs47l92_remove
1
2
3
4
5
6
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 CS47L92_NUM_ADSP 1
31 #define CS47L92_MONO_OUTPUTS 3
32
33 #define DRV_NAME "cs47l92-codec"
34
35 struct cs47l92 {
36 struct madera_priv core;
37 struct madera_fll fll[2];
38 };
39
40 static const struct wm_adsp_region cs47l92_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 char * const cs47l92_outdemux_texts[] = {
48 "HPOUT3",
49 "HPOUT4",
50 };
51
52 static int cs47l92_put_demux(struct snd_kcontrol *kcontrol,
53 struct snd_ctl_elem_value *ucontrol)
54 {
55 struct snd_soc_component *component =
56 snd_soc_dapm_kcontrol_component(kcontrol);
57 struct snd_soc_dapm_context *dapm =
58 snd_soc_component_get_dapm(component);
59 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
60 struct madera_priv *priv = &cs47l92->core;
61 struct madera *madera = priv->madera;
62 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
63 unsigned int ep_sel, mux, change, cur;
64 bool out_mono;
65 int ret;
66
67 if (ucontrol->value.enumerated.item[0] > e->items - 1)
68 return -EINVAL;
69
70 mux = ucontrol->value.enumerated.item[0];
71
72 snd_soc_dapm_mutex_lock(dapm);
73
74 ep_sel = mux << e->shift_l;
75
76 change = snd_soc_component_test_bits(component, MADERA_OUTPUT_ENABLES_1,
77 MADERA_EP_SEL_MASK,
78 ep_sel);
79 if (!change)
80 goto end;
81
82 ret = regmap_read(madera->regmap, MADERA_OUTPUT_ENABLES_1, &cur);
83 if (ret != 0)
84 dev_warn(madera->dev, "Failed to read outputs: %d\n", ret);
85
86
87 ret = regmap_update_bits(madera->regmap, MADERA_OUTPUT_ENABLES_1,
88 MADERA_OUT3L_ENA | MADERA_OUT3R_ENA, 0);
89 if (ret)
90 dev_warn(madera->dev, "Failed to disable outputs: %d\n", ret);
91
92 usleep_range(2000, 3000);
93
94 ret = regmap_update_bits(madera->regmap, MADERA_OUTPUT_ENABLES_1,
95 MADERA_EP_SEL, ep_sel);
96 if (ret) {
97 dev_err(madera->dev, "Failed to set OUT3 demux: %d\n", ret);
98 } else {
99 out_mono = madera->pdata.codec.out_mono[2 + mux];
100
101 ret = madera_set_output_mode(component, 3, out_mono);
102 if (ret < 0)
103 dev_warn(madera->dev,
104 "Failed to set output mode: %d\n", ret);
105 }
106
107 ret = regmap_update_bits(madera->regmap, MADERA_OUTPUT_ENABLES_1,
108 MADERA_OUT3L_ENA | MADERA_OUT3R_ENA, cur);
109 if (ret) {
110 dev_warn(madera->dev, "Failed to restore outputs: %d\n", ret);
111 } else {
112
113 if (cur & (MADERA_OUT3L_ENA | MADERA_OUT3R_ENA))
114 msleep(34);
115 else
116 usleep_range(2000, 3000);
117 }
118
119 end:
120 snd_soc_dapm_mutex_unlock(dapm);
121
122 return snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL);
123 }
124
125 static SOC_ENUM_SINGLE_DECL(cs47l92_outdemux_enum,
126 MADERA_OUTPUT_ENABLES_1,
127 MADERA_EP_SEL_SHIFT,
128 cs47l92_outdemux_texts);
129
130 static const struct snd_kcontrol_new cs47l92_outdemux =
131 SOC_DAPM_ENUM_EXT("OUT3 Demux", cs47l92_outdemux_enum,
132 snd_soc_dapm_get_enum_double, cs47l92_put_demux);
133
134 static int cs47l92_adsp_power_ev(struct snd_soc_dapm_widget *w,
135 struct snd_kcontrol *kcontrol,
136 int event)
137 {
138 struct snd_soc_component *component =
139 snd_soc_dapm_to_component(w->dapm);
140 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
141 struct madera_priv *priv = &cs47l92->core;
142 struct madera *madera = priv->madera;
143 unsigned int freq;
144 int ret;
145
146 ret = regmap_read(madera->regmap, MADERA_DSP_CLOCK_2, &freq);
147 if (ret != 0) {
148 dev_err(madera->dev,
149 "Failed to read MADERA_DSP_CLOCK_2: %d\n", ret);
150 return ret;
151 }
152
153 switch (event) {
154 case SND_SOC_DAPM_PRE_PMU:
155 ret = madera_set_adsp_clk(&cs47l92->core, w->shift, freq);
156 if (ret)
157 return ret;
158 break;
159 default:
160 break;
161 }
162
163 return wm_adsp_early_event(w, kcontrol, event);
164 }
165
166 #define CS47L92_NG_SRC(name, base) \
167 SOC_SINGLE(name " NG HPOUT1L Switch", base, 0, 1, 0), \
168 SOC_SINGLE(name " NG HPOUT1R Switch", base, 1, 1, 0), \
169 SOC_SINGLE(name " NG HPOUT2L Switch", base, 2, 1, 0), \
170 SOC_SINGLE(name " NG HPOUT2R Switch", base, 3, 1, 0), \
171 SOC_SINGLE(name " NG HPOUT3L Switch", base, 4, 1, 0), \
172 SOC_SINGLE(name " NG HPOUT3R Switch", base, 5, 1, 0), \
173 SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \
174 SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0)
175
176 static const struct snd_kcontrol_new cs47l92_snd_controls[] = {
177 SOC_ENUM("IN1 OSR", madera_in_dmic_osr[0]),
178 SOC_ENUM("IN2 OSR", madera_in_dmic_osr[1]),
179 SOC_ENUM("IN3 OSR", madera_in_dmic_osr[2]),
180 SOC_ENUM("IN4 OSR", madera_in_dmic_osr[3]),
181
182 SOC_SINGLE_RANGE_TLV("IN1L Volume", MADERA_IN1L_CONTROL,
183 MADERA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
184 SOC_SINGLE_RANGE_TLV("IN1R Volume", MADERA_IN1R_CONTROL,
185 MADERA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
186 SOC_SINGLE_RANGE_TLV("IN2L Volume", MADERA_IN2L_CONTROL,
187 MADERA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
188 SOC_SINGLE_RANGE_TLV("IN2R Volume", MADERA_IN2R_CONTROL,
189 MADERA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv),
190
191 SOC_ENUM("IN HPF Cutoff Frequency", madera_in_hpf_cut_enum),
192
193 SOC_SINGLE_EXT("IN1L LP Switch", MADERA_ADC_DIGITAL_VOLUME_1L,
194 MADERA_IN1L_LP_MODE_SHIFT, 1, 0,
195 snd_soc_get_volsw, madera_lp_mode_put),
196 SOC_SINGLE_EXT("IN1R LP Switch", MADERA_ADC_DIGITAL_VOLUME_1R,
197 MADERA_IN1L_LP_MODE_SHIFT, 1, 0,
198 snd_soc_get_volsw, madera_lp_mode_put),
199 SOC_SINGLE_EXT("IN2L LP Switch", MADERA_ADC_DIGITAL_VOLUME_2L,
200 MADERA_IN1L_LP_MODE_SHIFT, 1, 0,
201 snd_soc_get_volsw, madera_lp_mode_put),
202 SOC_SINGLE_EXT("IN2R LP Switch", MADERA_ADC_DIGITAL_VOLUME_2R,
203 MADERA_IN1L_LP_MODE_SHIFT, 1, 0,
204 snd_soc_get_volsw, madera_lp_mode_put),
205
206 SOC_SINGLE("IN1L HPF Switch", MADERA_IN1L_CONTROL,
207 MADERA_IN1L_HPF_SHIFT, 1, 0),
208 SOC_SINGLE("IN1R HPF Switch", MADERA_IN1R_CONTROL,
209 MADERA_IN1R_HPF_SHIFT, 1, 0),
210 SOC_SINGLE("IN2L HPF Switch", MADERA_IN2L_CONTROL,
211 MADERA_IN2L_HPF_SHIFT, 1, 0),
212 SOC_SINGLE("IN2R HPF Switch", MADERA_IN2R_CONTROL,
213 MADERA_IN2R_HPF_SHIFT, 1, 0),
214 SOC_SINGLE("IN3L HPF Switch", MADERA_IN3L_CONTROL,
215 MADERA_IN3L_HPF_SHIFT, 1, 0),
216 SOC_SINGLE("IN3R HPF Switch", MADERA_IN3R_CONTROL,
217 MADERA_IN3R_HPF_SHIFT, 1, 0),
218 SOC_SINGLE("IN4L HPF Switch", MADERA_IN4L_CONTROL,
219 MADERA_IN4L_HPF_SHIFT, 1, 0),
220 SOC_SINGLE("IN4R HPF Switch", MADERA_IN4R_CONTROL,
221 MADERA_IN4R_HPF_SHIFT, 1, 0),
222
223 SOC_SINGLE_TLV("IN1L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_1L,
224 MADERA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
225 SOC_SINGLE_TLV("IN1R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_1R,
226 MADERA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
227 SOC_SINGLE_TLV("IN2L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_2L,
228 MADERA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
229 SOC_SINGLE_TLV("IN2R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_2R,
230 MADERA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
231 SOC_SINGLE_TLV("IN3L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_3L,
232 MADERA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
233 SOC_SINGLE_TLV("IN3R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_3R,
234 MADERA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
235 SOC_SINGLE_TLV("IN4L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_4L,
236 MADERA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
237 SOC_SINGLE_TLV("IN4R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_4R,
238 MADERA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv),
239
240 SOC_ENUM("Input Ramp Up", madera_in_vi_ramp),
241 SOC_ENUM("Input Ramp Down", madera_in_vd_ramp),
242
243 MADERA_MIXER_CONTROLS("EQ1", MADERA_EQ1MIX_INPUT_1_SOURCE),
244 MADERA_MIXER_CONTROLS("EQ2", MADERA_EQ2MIX_INPUT_1_SOURCE),
245 MADERA_MIXER_CONTROLS("EQ3", MADERA_EQ3MIX_INPUT_1_SOURCE),
246 MADERA_MIXER_CONTROLS("EQ4", MADERA_EQ4MIX_INPUT_1_SOURCE),
247
248 MADERA_EQ_CONTROL("EQ1 Coefficients", MADERA_EQ1_2),
249 SOC_SINGLE_TLV("EQ1 B1 Volume", MADERA_EQ1_1, MADERA_EQ1_B1_GAIN_SHIFT,
250 24, 0, madera_eq_tlv),
251 SOC_SINGLE_TLV("EQ1 B2 Volume", MADERA_EQ1_1, MADERA_EQ1_B2_GAIN_SHIFT,
252 24, 0, madera_eq_tlv),
253 SOC_SINGLE_TLV("EQ1 B3 Volume", MADERA_EQ1_1, MADERA_EQ1_B3_GAIN_SHIFT,
254 24, 0, madera_eq_tlv),
255 SOC_SINGLE_TLV("EQ1 B4 Volume", MADERA_EQ1_2, MADERA_EQ1_B4_GAIN_SHIFT,
256 24, 0, madera_eq_tlv),
257 SOC_SINGLE_TLV("EQ1 B5 Volume", MADERA_EQ1_2, MADERA_EQ1_B5_GAIN_SHIFT,
258 24, 0, madera_eq_tlv),
259
260 MADERA_EQ_CONTROL("EQ2 Coefficients", MADERA_EQ2_2),
261 SOC_SINGLE_TLV("EQ2 B1 Volume", MADERA_EQ2_1, MADERA_EQ2_B1_GAIN_SHIFT,
262 24, 0, madera_eq_tlv),
263 SOC_SINGLE_TLV("EQ2 B2 Volume", MADERA_EQ2_1, MADERA_EQ2_B2_GAIN_SHIFT,
264 24, 0, madera_eq_tlv),
265 SOC_SINGLE_TLV("EQ2 B3 Volume", MADERA_EQ2_1, MADERA_EQ2_B3_GAIN_SHIFT,
266 24, 0, madera_eq_tlv),
267 SOC_SINGLE_TLV("EQ2 B4 Volume", MADERA_EQ2_2, MADERA_EQ2_B4_GAIN_SHIFT,
268 24, 0, madera_eq_tlv),
269 SOC_SINGLE_TLV("EQ2 B5 Volume", MADERA_EQ2_2, MADERA_EQ2_B5_GAIN_SHIFT,
270 24, 0, madera_eq_tlv),
271
272 MADERA_EQ_CONTROL("EQ3 Coefficients", MADERA_EQ3_2),
273 SOC_SINGLE_TLV("EQ3 B1 Volume", MADERA_EQ3_1, MADERA_EQ3_B1_GAIN_SHIFT,
274 24, 0, madera_eq_tlv),
275 SOC_SINGLE_TLV("EQ3 B2 Volume", MADERA_EQ3_1, MADERA_EQ3_B2_GAIN_SHIFT,
276 24, 0, madera_eq_tlv),
277 SOC_SINGLE_TLV("EQ3 B3 Volume", MADERA_EQ3_1, MADERA_EQ3_B3_GAIN_SHIFT,
278 24, 0, madera_eq_tlv),
279 SOC_SINGLE_TLV("EQ3 B4 Volume", MADERA_EQ3_2, MADERA_EQ3_B4_GAIN_SHIFT,
280 24, 0, madera_eq_tlv),
281 SOC_SINGLE_TLV("EQ3 B5 Volume", MADERA_EQ3_2, MADERA_EQ3_B5_GAIN_SHIFT,
282 24, 0, madera_eq_tlv),
283
284 MADERA_EQ_CONTROL("EQ4 Coefficients", MADERA_EQ4_2),
285 SOC_SINGLE_TLV("EQ4 B1 Volume", MADERA_EQ4_1, MADERA_EQ4_B1_GAIN_SHIFT,
286 24, 0, madera_eq_tlv),
287 SOC_SINGLE_TLV("EQ4 B2 Volume", MADERA_EQ4_1, MADERA_EQ4_B2_GAIN_SHIFT,
288 24, 0, madera_eq_tlv),
289 SOC_SINGLE_TLV("EQ4 B3 Volume", MADERA_EQ4_1, MADERA_EQ4_B3_GAIN_SHIFT,
290 24, 0, madera_eq_tlv),
291 SOC_SINGLE_TLV("EQ4 B4 Volume", MADERA_EQ4_2, MADERA_EQ4_B4_GAIN_SHIFT,
292 24, 0, madera_eq_tlv),
293 SOC_SINGLE_TLV("EQ4 B5 Volume", MADERA_EQ4_2, MADERA_EQ4_B5_GAIN_SHIFT,
294 24, 0, madera_eq_tlv),
295
296 SOC_SINGLE("DAC High Performance Mode Switch", MADERA_OUTPUT_RATE_1,
297 MADERA_CP_DAC_MODE_SHIFT, 1, 0),
298
299 MADERA_MIXER_CONTROLS("DRC1L", MADERA_DRC1LMIX_INPUT_1_SOURCE),
300 MADERA_MIXER_CONTROLS("DRC1R", MADERA_DRC1RMIX_INPUT_1_SOURCE),
301 MADERA_MIXER_CONTROLS("DRC2L", MADERA_DRC2LMIX_INPUT_1_SOURCE),
302 MADERA_MIXER_CONTROLS("DRC2R", MADERA_DRC2RMIX_INPUT_1_SOURCE),
303
304 SND_SOC_BYTES_MASK("DRC1", MADERA_DRC1_CTRL1, 5,
305 MADERA_DRC1R_ENA | MADERA_DRC1L_ENA),
306 SND_SOC_BYTES_MASK("DRC2", MADERA_DRC2_CTRL1, 5,
307 MADERA_DRC2R_ENA | MADERA_DRC2L_ENA),
308
309 MADERA_MIXER_CONTROLS("LHPF1", MADERA_HPLP1MIX_INPUT_1_SOURCE),
310 MADERA_MIXER_CONTROLS("LHPF2", MADERA_HPLP2MIX_INPUT_1_SOURCE),
311 MADERA_MIXER_CONTROLS("LHPF3", MADERA_HPLP3MIX_INPUT_1_SOURCE),
312 MADERA_MIXER_CONTROLS("LHPF4", MADERA_HPLP4MIX_INPUT_1_SOURCE),
313
314 MADERA_LHPF_CONTROL("LHPF1 Coefficients", MADERA_HPLPF1_2),
315 MADERA_LHPF_CONTROL("LHPF2 Coefficients", MADERA_HPLPF2_2),
316 MADERA_LHPF_CONTROL("LHPF3 Coefficients", MADERA_HPLPF3_2),
317 MADERA_LHPF_CONTROL("LHPF4 Coefficients", MADERA_HPLPF4_2),
318
319 SOC_ENUM("LHPF1 Mode", madera_lhpf1_mode),
320 SOC_ENUM("LHPF2 Mode", madera_lhpf2_mode),
321 SOC_ENUM("LHPF3 Mode", madera_lhpf3_mode),
322 SOC_ENUM("LHPF4 Mode", madera_lhpf4_mode),
323
324 MADERA_RATE_ENUM("ISRC1 FSL", madera_isrc_fsl[0]),
325 MADERA_RATE_ENUM("ISRC2 FSL", madera_isrc_fsl[1]),
326 MADERA_RATE_ENUM("ISRC1 FSH", madera_isrc_fsh[0]),
327 MADERA_RATE_ENUM("ISRC2 FSH", madera_isrc_fsh[1]),
328 MADERA_RATE_ENUM("ASRC1 Rate 1", madera_asrc1_bidir_rate[0]),
329 MADERA_RATE_ENUM("ASRC1 Rate 2", madera_asrc1_bidir_rate[1]),
330
331 WM_ADSP2_PRELOAD_SWITCH("DSP1", 1),
332
333 MADERA_MIXER_CONTROLS("DSP1L", MADERA_DSP1LMIX_INPUT_1_SOURCE),
334 MADERA_MIXER_CONTROLS("DSP1R", MADERA_DSP1RMIX_INPUT_1_SOURCE),
335
336 SOC_SINGLE_TLV("Noise Generator Volume", MADERA_COMFORT_NOISE_GENERATOR,
337 MADERA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, madera_noise_tlv),
338
339 MADERA_MIXER_CONTROLS("HPOUT1L", MADERA_OUT1LMIX_INPUT_1_SOURCE),
340 MADERA_MIXER_CONTROLS("HPOUT1R", MADERA_OUT1RMIX_INPUT_1_SOURCE),
341 MADERA_MIXER_CONTROLS("HPOUT2L", MADERA_OUT2LMIX_INPUT_1_SOURCE),
342 MADERA_MIXER_CONTROLS("HPOUT2R", MADERA_OUT2RMIX_INPUT_1_SOURCE),
343 MADERA_MIXER_CONTROLS("HPOUT3L", MADERA_OUT3LMIX_INPUT_1_SOURCE),
344 MADERA_MIXER_CONTROLS("HPOUT3R", MADERA_OUT3RMIX_INPUT_1_SOURCE),
345 MADERA_MIXER_CONTROLS("SPKDAT1L", MADERA_OUT5LMIX_INPUT_1_SOURCE),
346 MADERA_MIXER_CONTROLS("SPKDAT1R", MADERA_OUT5RMIX_INPUT_1_SOURCE),
347
348 SOC_SINGLE("HPOUT1 SC Protect Switch", MADERA_HP1_SHORT_CIRCUIT_CTRL,
349 MADERA_HP1_SC_ENA_SHIFT, 1, 0),
350 SOC_SINGLE("HPOUT2 SC Protect Switch", MADERA_HP2_SHORT_CIRCUIT_CTRL,
351 MADERA_HP2_SC_ENA_SHIFT, 1, 0),
352 SOC_SINGLE("HPOUT3 SC Protect Switch", MADERA_HP3_SHORT_CIRCUIT_CTRL,
353 MADERA_HP3_SC_ENA_SHIFT, 1, 0),
354
355 SOC_SINGLE("SPKDAT1 High Performance Switch", MADERA_OUTPUT_PATH_CONFIG_5L,
356 MADERA_OUT5_OSR_SHIFT, 1, 0),
357
358 SOC_DOUBLE_R("HPOUT1 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_1L,
359 MADERA_DAC_DIGITAL_VOLUME_1R, MADERA_OUT1L_MUTE_SHIFT, 1, 1),
360 SOC_DOUBLE_R("HPOUT2 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_2L,
361 MADERA_DAC_DIGITAL_VOLUME_2R, MADERA_OUT2L_MUTE_SHIFT, 1, 1),
362 SOC_DOUBLE_R("HPOUT3 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_3L,
363 MADERA_DAC_DIGITAL_VOLUME_3R, MADERA_OUT3L_MUTE_SHIFT, 1, 1),
364 SOC_DOUBLE_R("SPKDAT1 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_5L,
365 MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_OUT5L_MUTE_SHIFT, 1, 1),
366
367 SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_1L,
368 MADERA_DAC_DIGITAL_VOLUME_1R, MADERA_OUT1L_VOL_SHIFT,
369 0xbf, 0, madera_digital_tlv),
370 SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_2L,
371 MADERA_DAC_DIGITAL_VOLUME_2R, MADERA_OUT2L_VOL_SHIFT,
372 0xbf, 0, madera_digital_tlv),
373 SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_3L,
374 MADERA_DAC_DIGITAL_VOLUME_3R, MADERA_OUT3L_VOL_SHIFT,
375 0xbf, 0, madera_digital_tlv),
376 SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_5L,
377 MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_OUT5L_VOL_SHIFT,
378 0xbf, 0, madera_digital_tlv),
379
380 SOC_DOUBLE("SPKDAT1 Switch", MADERA_PDM_SPK1_CTRL_1, MADERA_SPK1L_MUTE_SHIFT,
381 MADERA_SPK1R_MUTE_SHIFT, 1, 1),
382
383 SOC_ENUM("Output Ramp Up", madera_out_vi_ramp),
384 SOC_ENUM("Output Ramp Down", madera_out_vd_ramp),
385
386 SOC_SINGLE("Noise Gate Switch", MADERA_NOISE_GATE_CONTROL,
387 MADERA_NGATE_ENA_SHIFT, 1, 0),
388 SOC_SINGLE_TLV("Noise Gate Threshold Volume", MADERA_NOISE_GATE_CONTROL,
389 MADERA_NGATE_THR_SHIFT, 7, 1, madera_ng_tlv),
390 SOC_ENUM("Noise Gate Hold", madera_ng_hold),
391
392 SOC_ENUM_EXT("DFC1RX Width", madera_dfc_width[0],
393 snd_soc_get_enum_double, madera_dfc_put),
394 SOC_ENUM_EXT("DFC1RX Type", madera_dfc_type[0],
395 snd_soc_get_enum_double, madera_dfc_put),
396 SOC_ENUM_EXT("DFC1TX Width", madera_dfc_width[1],
397 snd_soc_get_enum_double, madera_dfc_put),
398 SOC_ENUM_EXT("DFC1TX Type", madera_dfc_type[1],
399 snd_soc_get_enum_double, madera_dfc_put),
400 SOC_ENUM_EXT("DFC2RX Width", madera_dfc_width[2],
401 snd_soc_get_enum_double, madera_dfc_put),
402 SOC_ENUM_EXT("DFC2RX Type", madera_dfc_type[2],
403 snd_soc_get_enum_double, madera_dfc_put),
404 SOC_ENUM_EXT("DFC2TX Width", madera_dfc_width[3],
405 snd_soc_get_enum_double, madera_dfc_put),
406 SOC_ENUM_EXT("DFC2TX Type", madera_dfc_type[3],
407 snd_soc_get_enum_double, madera_dfc_put),
408 SOC_ENUM_EXT("DFC3RX Width", madera_dfc_width[4],
409 snd_soc_get_enum_double, madera_dfc_put),
410 SOC_ENUM_EXT("DFC3RX Type", madera_dfc_type[4],
411 snd_soc_get_enum_double, madera_dfc_put),
412 SOC_ENUM_EXT("DFC3TX Width", madera_dfc_width[5],
413 snd_soc_get_enum_double, madera_dfc_put),
414 SOC_ENUM_EXT("DFC3TX Type", madera_dfc_type[5],
415 snd_soc_get_enum_double, madera_dfc_put),
416 SOC_ENUM_EXT("DFC4RX Width", madera_dfc_width[6],
417 snd_soc_get_enum_double, madera_dfc_put),
418 SOC_ENUM_EXT("DFC4RX Type", madera_dfc_type[6],
419 snd_soc_get_enum_double, madera_dfc_put),
420 SOC_ENUM_EXT("DFC4TX Width", madera_dfc_width[7],
421 snd_soc_get_enum_double, madera_dfc_put),
422 SOC_ENUM_EXT("DFC4TX Type", madera_dfc_type[7],
423 snd_soc_get_enum_double, madera_dfc_put),
424 SOC_ENUM_EXT("DFC5RX Width", madera_dfc_width[8],
425 snd_soc_get_enum_double, madera_dfc_put),
426 SOC_ENUM_EXT("DFC5RX Type", madera_dfc_type[8],
427 snd_soc_get_enum_double, madera_dfc_put),
428 SOC_ENUM_EXT("DFC5TX Width", madera_dfc_width[9],
429 snd_soc_get_enum_double, madera_dfc_put),
430 SOC_ENUM_EXT("DFC5TX Type", madera_dfc_type[9],
431 snd_soc_get_enum_double, madera_dfc_put),
432 SOC_ENUM_EXT("DFC6RX Width", madera_dfc_width[10],
433 snd_soc_get_enum_double, madera_dfc_put),
434 SOC_ENUM_EXT("DFC6RX Type", madera_dfc_type[10],
435 snd_soc_get_enum_double, madera_dfc_put),
436 SOC_ENUM_EXT("DFC6TX Width", madera_dfc_width[11],
437 snd_soc_get_enum_double, madera_dfc_put),
438 SOC_ENUM_EXT("DFC6TX Type", madera_dfc_type[11],
439 snd_soc_get_enum_double, madera_dfc_put),
440 SOC_ENUM_EXT("DFC7RX Width", madera_dfc_width[12],
441 snd_soc_get_enum_double, madera_dfc_put),
442 SOC_ENUM_EXT("DFC7RX Type", madera_dfc_type[12],
443 snd_soc_get_enum_double, madera_dfc_put),
444 SOC_ENUM_EXT("DFC7TX Width", madera_dfc_width[13],
445 snd_soc_get_enum_double, madera_dfc_put),
446 SOC_ENUM_EXT("DFC7TX Type", madera_dfc_type[13],
447 snd_soc_get_enum_double, madera_dfc_put),
448 SOC_ENUM_EXT("DFC8RX Width", madera_dfc_width[14],
449 snd_soc_get_enum_double, madera_dfc_put),
450 SOC_ENUM_EXT("DFC8RX Type", madera_dfc_type[14],
451 snd_soc_get_enum_double, madera_dfc_put),
452 SOC_ENUM_EXT("DFC8TX Width", madera_dfc_width[15],
453 snd_soc_get_enum_double, madera_dfc_put),
454 SOC_ENUM_EXT("DFC8TX Type", madera_dfc_type[15],
455 snd_soc_get_enum_double, madera_dfc_put),
456
457 CS47L92_NG_SRC("HPOUT1L", MADERA_NOISE_GATE_SELECT_1L),
458 CS47L92_NG_SRC("HPOUT1R", MADERA_NOISE_GATE_SELECT_1R),
459 CS47L92_NG_SRC("HPOUT2L", MADERA_NOISE_GATE_SELECT_2L),
460 CS47L92_NG_SRC("HPOUT2R", MADERA_NOISE_GATE_SELECT_2R),
461 CS47L92_NG_SRC("HPOUT3L", MADERA_NOISE_GATE_SELECT_3L),
462 CS47L92_NG_SRC("HPOUT3R", MADERA_NOISE_GATE_SELECT_3R),
463 CS47L92_NG_SRC("SPKDAT1L", MADERA_NOISE_GATE_SELECT_5L),
464 CS47L92_NG_SRC("SPKDAT1R", MADERA_NOISE_GATE_SELECT_5R),
465
466 MADERA_MIXER_CONTROLS("AIF1TX1", MADERA_AIF1TX1MIX_INPUT_1_SOURCE),
467 MADERA_MIXER_CONTROLS("AIF1TX2", MADERA_AIF1TX2MIX_INPUT_1_SOURCE),
468 MADERA_MIXER_CONTROLS("AIF1TX3", MADERA_AIF1TX3MIX_INPUT_1_SOURCE),
469 MADERA_MIXER_CONTROLS("AIF1TX4", MADERA_AIF1TX4MIX_INPUT_1_SOURCE),
470 MADERA_MIXER_CONTROLS("AIF1TX5", MADERA_AIF1TX5MIX_INPUT_1_SOURCE),
471 MADERA_MIXER_CONTROLS("AIF1TX6", MADERA_AIF1TX6MIX_INPUT_1_SOURCE),
472 MADERA_MIXER_CONTROLS("AIF1TX7", MADERA_AIF1TX7MIX_INPUT_1_SOURCE),
473 MADERA_MIXER_CONTROLS("AIF1TX8", MADERA_AIF1TX8MIX_INPUT_1_SOURCE),
474
475 MADERA_MIXER_CONTROLS("AIF2TX1", MADERA_AIF2TX1MIX_INPUT_1_SOURCE),
476 MADERA_MIXER_CONTROLS("AIF2TX2", MADERA_AIF2TX2MIX_INPUT_1_SOURCE),
477 MADERA_MIXER_CONTROLS("AIF2TX3", MADERA_AIF2TX3MIX_INPUT_1_SOURCE),
478 MADERA_MIXER_CONTROLS("AIF2TX4", MADERA_AIF2TX4MIX_INPUT_1_SOURCE),
479 MADERA_MIXER_CONTROLS("AIF2TX5", MADERA_AIF2TX5MIX_INPUT_1_SOURCE),
480 MADERA_MIXER_CONTROLS("AIF2TX6", MADERA_AIF2TX6MIX_INPUT_1_SOURCE),
481 MADERA_MIXER_CONTROLS("AIF2TX7", MADERA_AIF2TX7MIX_INPUT_1_SOURCE),
482 MADERA_MIXER_CONTROLS("AIF2TX8", MADERA_AIF2TX8MIX_INPUT_1_SOURCE),
483
484 MADERA_MIXER_CONTROLS("AIF3TX1", MADERA_AIF3TX1MIX_INPUT_1_SOURCE),
485 MADERA_MIXER_CONTROLS("AIF3TX2", MADERA_AIF3TX2MIX_INPUT_1_SOURCE),
486 MADERA_MIXER_CONTROLS("AIF3TX3", MADERA_AIF3TX3MIX_INPUT_1_SOURCE),
487 MADERA_MIXER_CONTROLS("AIF3TX4", MADERA_AIF3TX4MIX_INPUT_1_SOURCE),
488
489 MADERA_MIXER_CONTROLS("SLIMTX1", MADERA_SLIMTX1MIX_INPUT_1_SOURCE),
490 MADERA_MIXER_CONTROLS("SLIMTX2", MADERA_SLIMTX2MIX_INPUT_1_SOURCE),
491 MADERA_MIXER_CONTROLS("SLIMTX3", MADERA_SLIMTX3MIX_INPUT_1_SOURCE),
492 MADERA_MIXER_CONTROLS("SLIMTX4", MADERA_SLIMTX4MIX_INPUT_1_SOURCE),
493 MADERA_MIXER_CONTROLS("SLIMTX5", MADERA_SLIMTX5MIX_INPUT_1_SOURCE),
494 MADERA_MIXER_CONTROLS("SLIMTX6", MADERA_SLIMTX6MIX_INPUT_1_SOURCE),
495 MADERA_MIXER_CONTROLS("SLIMTX7", MADERA_SLIMTX7MIX_INPUT_1_SOURCE),
496 MADERA_MIXER_CONTROLS("SLIMTX8", MADERA_SLIMTX8MIX_INPUT_1_SOURCE),
497
498 MADERA_GAINMUX_CONTROLS("SPDIFTX1", MADERA_SPDIF1TX1MIX_INPUT_1_SOURCE),
499 MADERA_GAINMUX_CONTROLS("SPDIFTX2", MADERA_SPDIF1TX2MIX_INPUT_1_SOURCE),
500
501 WM_ADSP_FW_CONTROL("DSP1", 0),
502 };
503
504 MADERA_MIXER_ENUMS(EQ1, MADERA_EQ1MIX_INPUT_1_SOURCE);
505 MADERA_MIXER_ENUMS(EQ2, MADERA_EQ2MIX_INPUT_1_SOURCE);
506 MADERA_MIXER_ENUMS(EQ3, MADERA_EQ3MIX_INPUT_1_SOURCE);
507 MADERA_MIXER_ENUMS(EQ4, MADERA_EQ4MIX_INPUT_1_SOURCE);
508
509 MADERA_MIXER_ENUMS(DRC1L, MADERA_DRC1LMIX_INPUT_1_SOURCE);
510 MADERA_MIXER_ENUMS(DRC1R, MADERA_DRC1RMIX_INPUT_1_SOURCE);
511 MADERA_MIXER_ENUMS(DRC2L, MADERA_DRC2LMIX_INPUT_1_SOURCE);
512 MADERA_MIXER_ENUMS(DRC2R, MADERA_DRC2RMIX_INPUT_1_SOURCE);
513
514 MADERA_MIXER_ENUMS(LHPF1, MADERA_HPLP1MIX_INPUT_1_SOURCE);
515 MADERA_MIXER_ENUMS(LHPF2, MADERA_HPLP2MIX_INPUT_1_SOURCE);
516 MADERA_MIXER_ENUMS(LHPF3, MADERA_HPLP3MIX_INPUT_1_SOURCE);
517 MADERA_MIXER_ENUMS(LHPF4, MADERA_HPLP4MIX_INPUT_1_SOURCE);
518
519 MADERA_MIXER_ENUMS(DSP1L, MADERA_DSP1LMIX_INPUT_1_SOURCE);
520 MADERA_MIXER_ENUMS(DSP1R, MADERA_DSP1RMIX_INPUT_1_SOURCE);
521 MADERA_DSP_AUX_ENUMS(DSP1, MADERA_DSP1AUX1MIX_INPUT_1_SOURCE);
522
523 MADERA_MIXER_ENUMS(PWM1, MADERA_PWM1MIX_INPUT_1_SOURCE);
524 MADERA_MIXER_ENUMS(PWM2, MADERA_PWM2MIX_INPUT_1_SOURCE);
525
526 MADERA_MIXER_ENUMS(OUT1L, MADERA_OUT1LMIX_INPUT_1_SOURCE);
527 MADERA_MIXER_ENUMS(OUT1R, MADERA_OUT1RMIX_INPUT_1_SOURCE);
528 MADERA_MIXER_ENUMS(OUT2L, MADERA_OUT2LMIX_INPUT_1_SOURCE);
529 MADERA_MIXER_ENUMS(OUT2R, MADERA_OUT2RMIX_INPUT_1_SOURCE);
530 MADERA_MIXER_ENUMS(OUT3L, MADERA_OUT3LMIX_INPUT_1_SOURCE);
531 MADERA_MIXER_ENUMS(OUT3R, MADERA_OUT3RMIX_INPUT_1_SOURCE);
532 MADERA_MIXER_ENUMS(SPKDAT1L, MADERA_OUT5LMIX_INPUT_1_SOURCE);
533 MADERA_MIXER_ENUMS(SPKDAT1R, MADERA_OUT5RMIX_INPUT_1_SOURCE);
534
535 MADERA_MIXER_ENUMS(AIF1TX1, MADERA_AIF1TX1MIX_INPUT_1_SOURCE);
536 MADERA_MIXER_ENUMS(AIF1TX2, MADERA_AIF1TX2MIX_INPUT_1_SOURCE);
537 MADERA_MIXER_ENUMS(AIF1TX3, MADERA_AIF1TX3MIX_INPUT_1_SOURCE);
538 MADERA_MIXER_ENUMS(AIF1TX4, MADERA_AIF1TX4MIX_INPUT_1_SOURCE);
539 MADERA_MIXER_ENUMS(AIF1TX5, MADERA_AIF1TX5MIX_INPUT_1_SOURCE);
540 MADERA_MIXER_ENUMS(AIF1TX6, MADERA_AIF1TX6MIX_INPUT_1_SOURCE);
541 MADERA_MIXER_ENUMS(AIF1TX7, MADERA_AIF1TX7MIX_INPUT_1_SOURCE);
542 MADERA_MIXER_ENUMS(AIF1TX8, MADERA_AIF1TX8MIX_INPUT_1_SOURCE);
543
544 MADERA_MIXER_ENUMS(AIF2TX1, MADERA_AIF2TX1MIX_INPUT_1_SOURCE);
545 MADERA_MIXER_ENUMS(AIF2TX2, MADERA_AIF2TX2MIX_INPUT_1_SOURCE);
546 MADERA_MIXER_ENUMS(AIF2TX3, MADERA_AIF2TX3MIX_INPUT_1_SOURCE);
547 MADERA_MIXER_ENUMS(AIF2TX4, MADERA_AIF2TX4MIX_INPUT_1_SOURCE);
548 MADERA_MIXER_ENUMS(AIF2TX5, MADERA_AIF2TX5MIX_INPUT_1_SOURCE);
549 MADERA_MIXER_ENUMS(AIF2TX6, MADERA_AIF2TX6MIX_INPUT_1_SOURCE);
550 MADERA_MIXER_ENUMS(AIF2TX7, MADERA_AIF2TX7MIX_INPUT_1_SOURCE);
551 MADERA_MIXER_ENUMS(AIF2TX8, MADERA_AIF2TX8MIX_INPUT_1_SOURCE);
552
553 MADERA_MIXER_ENUMS(AIF3TX1, MADERA_AIF3TX1MIX_INPUT_1_SOURCE);
554 MADERA_MIXER_ENUMS(AIF3TX2, MADERA_AIF3TX2MIX_INPUT_1_SOURCE);
555 MADERA_MIXER_ENUMS(AIF3TX3, MADERA_AIF3TX3MIX_INPUT_1_SOURCE);
556 MADERA_MIXER_ENUMS(AIF3TX4, MADERA_AIF3TX4MIX_INPUT_1_SOURCE);
557
558 MADERA_MIXER_ENUMS(SLIMTX1, MADERA_SLIMTX1MIX_INPUT_1_SOURCE);
559 MADERA_MIXER_ENUMS(SLIMTX2, MADERA_SLIMTX2MIX_INPUT_1_SOURCE);
560 MADERA_MIXER_ENUMS(SLIMTX3, MADERA_SLIMTX3MIX_INPUT_1_SOURCE);
561 MADERA_MIXER_ENUMS(SLIMTX4, MADERA_SLIMTX4MIX_INPUT_1_SOURCE);
562 MADERA_MIXER_ENUMS(SLIMTX5, MADERA_SLIMTX5MIX_INPUT_1_SOURCE);
563 MADERA_MIXER_ENUMS(SLIMTX6, MADERA_SLIMTX6MIX_INPUT_1_SOURCE);
564 MADERA_MIXER_ENUMS(SLIMTX7, MADERA_SLIMTX7MIX_INPUT_1_SOURCE);
565 MADERA_MIXER_ENUMS(SLIMTX8, MADERA_SLIMTX8MIX_INPUT_1_SOURCE);
566
567 MADERA_MUX_ENUMS(SPD1TX1, MADERA_SPDIF1TX1MIX_INPUT_1_SOURCE);
568 MADERA_MUX_ENUMS(SPD1TX2, MADERA_SPDIF1TX2MIX_INPUT_1_SOURCE);
569
570 MADERA_MUX_ENUMS(ASRC1IN1L, MADERA_ASRC1_1LMIX_INPUT_1_SOURCE);
571 MADERA_MUX_ENUMS(ASRC1IN1R, MADERA_ASRC1_1RMIX_INPUT_1_SOURCE);
572 MADERA_MUX_ENUMS(ASRC1IN2L, MADERA_ASRC1_2LMIX_INPUT_1_SOURCE);
573 MADERA_MUX_ENUMS(ASRC1IN2R, MADERA_ASRC1_2RMIX_INPUT_1_SOURCE);
574
575 MADERA_MUX_ENUMS(ISRC1INT1, MADERA_ISRC1INT1MIX_INPUT_1_SOURCE);
576 MADERA_MUX_ENUMS(ISRC1INT2, MADERA_ISRC1INT2MIX_INPUT_1_SOURCE);
577
578 MADERA_MUX_ENUMS(ISRC1DEC1, MADERA_ISRC1DEC1MIX_INPUT_1_SOURCE);
579 MADERA_MUX_ENUMS(ISRC1DEC2, MADERA_ISRC1DEC2MIX_INPUT_1_SOURCE);
580
581 MADERA_MUX_ENUMS(ISRC2INT1, MADERA_ISRC2INT1MIX_INPUT_1_SOURCE);
582 MADERA_MUX_ENUMS(ISRC2INT2, MADERA_ISRC2INT2MIX_INPUT_1_SOURCE);
583
584 MADERA_MUX_ENUMS(ISRC2DEC1, MADERA_ISRC2DEC1MIX_INPUT_1_SOURCE);
585 MADERA_MUX_ENUMS(ISRC2DEC2, MADERA_ISRC2DEC2MIX_INPUT_1_SOURCE);
586
587 MADERA_MUX_ENUMS(DFC1, MADERA_DFC1MIX_INPUT_1_SOURCE);
588 MADERA_MUX_ENUMS(DFC2, MADERA_DFC2MIX_INPUT_1_SOURCE);
589 MADERA_MUX_ENUMS(DFC3, MADERA_DFC3MIX_INPUT_1_SOURCE);
590 MADERA_MUX_ENUMS(DFC4, MADERA_DFC4MIX_INPUT_1_SOURCE);
591 MADERA_MUX_ENUMS(DFC5, MADERA_DFC5MIX_INPUT_1_SOURCE);
592 MADERA_MUX_ENUMS(DFC6, MADERA_DFC6MIX_INPUT_1_SOURCE);
593 MADERA_MUX_ENUMS(DFC7, MADERA_DFC7MIX_INPUT_1_SOURCE);
594 MADERA_MUX_ENUMS(DFC8, MADERA_DFC8MIX_INPUT_1_SOURCE);
595
596 static const char * const cs47l92_aec_loopback_texts[] = {
597 "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R",
598 "SPKDAT1L", "SPKDAT1R",
599 };
600
601 static const unsigned int cs47l92_aec_loopback_values[] = {
602 0, 1, 2, 3, 4, 5, 8, 9
603 };
604
605 static const struct soc_enum cs47l92_aec_loopback =
606 SOC_VALUE_ENUM_SINGLE(MADERA_DAC_AEC_CONTROL_1,
607 MADERA_AEC1_LOOPBACK_SRC_SHIFT, 0xf,
608 ARRAY_SIZE(cs47l92_aec_loopback_texts),
609 cs47l92_aec_loopback_texts,
610 cs47l92_aec_loopback_values);
611
612 static const struct snd_kcontrol_new cs47l92_aec_loopback_mux =
613 SOC_DAPM_ENUM("AEC1 Loopback", cs47l92_aec_loopback);
614
615 static const struct snd_soc_dapm_widget cs47l92_dapm_widgets[] = {
616 SND_SOC_DAPM_SUPPLY("SYSCLK", MADERA_SYSTEM_CLOCK_1, MADERA_SYSCLK_ENA_SHIFT,
617 0, madera_sysclk_ev,
618 SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
619 SND_SOC_DAPM_SUPPLY("ASYNCCLK", MADERA_ASYNC_CLOCK_1,
620 MADERA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
621 SND_SOC_DAPM_SUPPLY("OPCLK", MADERA_OUTPUT_SYSTEM_CLOCK,
622 MADERA_OPCLK_ENA_SHIFT, 0, NULL, 0),
623 SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", MADERA_OUTPUT_ASYNC_CLOCK,
624 MADERA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0),
625 SND_SOC_DAPM_SUPPLY("DSPCLK", MADERA_DSP_CLOCK_1,
626 MADERA_DSP_CLK_ENA_SHIFT, 0, NULL, 0),
627
628 SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD1", 20, 0),
629 SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD2", 20, 0),
630 SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS),
631
632 SND_SOC_DAPM_SUPPLY("MICBIAS1", MADERA_MIC_BIAS_CTRL_1,
633 MADERA_MICB1_ENA_SHIFT, 0, NULL, 0),
634 SND_SOC_DAPM_SUPPLY("MICBIAS2", MADERA_MIC_BIAS_CTRL_2,
635 MADERA_MICB1_ENA_SHIFT, 0, NULL, 0),
636
637 SND_SOC_DAPM_SUPPLY("MICBIAS1A", MADERA_MIC_BIAS_CTRL_5,
638 MADERA_MICB1A_ENA_SHIFT, 0, NULL, 0),
639 SND_SOC_DAPM_SUPPLY("MICBIAS1B", MADERA_MIC_BIAS_CTRL_5,
640 MADERA_MICB1B_ENA_SHIFT, 0, NULL, 0),
641 SND_SOC_DAPM_SUPPLY("MICBIAS1C", MADERA_MIC_BIAS_CTRL_5,
642 MADERA_MICB1C_ENA_SHIFT, 0, NULL, 0),
643 SND_SOC_DAPM_SUPPLY("MICBIAS1D", MADERA_MIC_BIAS_CTRL_5,
644 MADERA_MICB1D_ENA_SHIFT, 0, NULL, 0),
645
646 SND_SOC_DAPM_SUPPLY("MICBIAS2A", MADERA_MIC_BIAS_CTRL_6,
647 MADERA_MICB2A_ENA_SHIFT, 0, NULL, 0),
648 SND_SOC_DAPM_SUPPLY("MICBIAS2B", MADERA_MIC_BIAS_CTRL_6,
649 MADERA_MICB2B_ENA_SHIFT, 0, NULL, 0),
650
651 SND_SOC_DAPM_SUPPLY("FXCLK", SND_SOC_NOPM,
652 MADERA_DOM_GRP_FX, 0,
653 madera_domain_clk_ev,
654 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
655 SND_SOC_DAPM_SUPPLY("ASRC1CLK", SND_SOC_NOPM,
656 MADERA_DOM_GRP_ASRC1, 0,
657 madera_domain_clk_ev,
658 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
659 SND_SOC_DAPM_SUPPLY("ISRC1CLK", SND_SOC_NOPM,
660 MADERA_DOM_GRP_ISRC1, 0,
661 madera_domain_clk_ev,
662 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
663 SND_SOC_DAPM_SUPPLY("ISRC2CLK", SND_SOC_NOPM,
664 MADERA_DOM_GRP_ISRC2, 0,
665 madera_domain_clk_ev,
666 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
667 SND_SOC_DAPM_SUPPLY("OUTCLK", SND_SOC_NOPM,
668 MADERA_DOM_GRP_OUT, 0,
669 madera_domain_clk_ev,
670 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
671 SND_SOC_DAPM_SUPPLY("SPDCLK", SND_SOC_NOPM,
672 MADERA_DOM_GRP_SPD, 0,
673 madera_domain_clk_ev,
674 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
675 SND_SOC_DAPM_SUPPLY("DSP1CLK", SND_SOC_NOPM,
676 MADERA_DOM_GRP_DSP1, 0,
677 madera_domain_clk_ev,
678 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
679 SND_SOC_DAPM_SUPPLY("AIF1TXCLK", SND_SOC_NOPM,
680 MADERA_DOM_GRP_AIF1, 0,
681 madera_domain_clk_ev,
682 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
683 SND_SOC_DAPM_SUPPLY("AIF2TXCLK", SND_SOC_NOPM,
684 MADERA_DOM_GRP_AIF2, 0,
685 madera_domain_clk_ev,
686 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
687 SND_SOC_DAPM_SUPPLY("AIF3TXCLK", SND_SOC_NOPM,
688 MADERA_DOM_GRP_AIF3, 0,
689 madera_domain_clk_ev,
690 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
691 SND_SOC_DAPM_SUPPLY("SLIMBUSCLK", SND_SOC_NOPM,
692 MADERA_DOM_GRP_SLIMBUS, 0,
693 madera_domain_clk_ev,
694 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
695 SND_SOC_DAPM_SUPPLY("PWMCLK", SND_SOC_NOPM,
696 MADERA_DOM_GRP_PWM, 0,
697 madera_domain_clk_ev,
698 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
699 SND_SOC_DAPM_SUPPLY("DFCCLK", SND_SOC_NOPM,
700 MADERA_DOM_GRP_DFC, 0,
701 madera_domain_clk_ev,
702 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
703
704 SND_SOC_DAPM_SIGGEN("TONE"),
705 SND_SOC_DAPM_SIGGEN("NOISE"),
706
707 SND_SOC_DAPM_INPUT("IN1ALN"),
708 SND_SOC_DAPM_INPUT("IN1ALP"),
709 SND_SOC_DAPM_INPUT("IN1BLN"),
710 SND_SOC_DAPM_INPUT("IN1BLP"),
711 SND_SOC_DAPM_INPUT("IN1ARN"),
712 SND_SOC_DAPM_INPUT("IN1ARP"),
713 SND_SOC_DAPM_INPUT("IN1BR"),
714 SND_SOC_DAPM_INPUT("IN2ALN"),
715 SND_SOC_DAPM_INPUT("IN2ALP"),
716 SND_SOC_DAPM_INPUT("IN2BL"),
717 SND_SOC_DAPM_INPUT("IN2ARN"),
718 SND_SOC_DAPM_INPUT("IN2ARP"),
719 SND_SOC_DAPM_INPUT("IN2BR"),
720
721 SND_SOC_DAPM_MUX("IN1L Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[0]),
722 SND_SOC_DAPM_MUX("IN1R Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[1]),
723 SND_SOC_DAPM_MUX("IN2L Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[2]),
724 SND_SOC_DAPM_MUX("IN2R Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[3]),
725
726 SND_SOC_DAPM_MUX("IN1L Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[0]),
727 SND_SOC_DAPM_MUX("IN1R Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[0]),
728
729 SND_SOC_DAPM_MUX("IN2L Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[1]),
730 SND_SOC_DAPM_MUX("IN2R Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[1]),
731
732 SND_SOC_DAPM_DEMUX("OUT3 Demux", SND_SOC_NOPM, 0, 0, &cs47l92_outdemux),
733
734 SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"),
735 SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"),
736
737 SND_SOC_DAPM_PGA("PWM1 Driver", MADERA_PWM_DRIVE_1, MADERA_PWM1_ENA_SHIFT,
738 0, NULL, 0),
739 SND_SOC_DAPM_PGA("PWM2 Driver", MADERA_PWM_DRIVE_1, MADERA_PWM2_ENA_SHIFT,
740 0, NULL, 0),
741
742 SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0,
743 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX1_ENA_SHIFT, 0),
744 SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0,
745 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX2_ENA_SHIFT, 0),
746 SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0,
747 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX3_ENA_SHIFT, 0),
748 SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0,
749 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX4_ENA_SHIFT, 0),
750 SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0,
751 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX5_ENA_SHIFT, 0),
752 SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0,
753 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX6_ENA_SHIFT, 0),
754 SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0,
755 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX7_ENA_SHIFT, 0),
756 SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0,
757 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX8_ENA_SHIFT, 0),
758
759 SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0,
760 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX1_ENA_SHIFT, 0),
761 SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0,
762 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX2_ENA_SHIFT, 0),
763 SND_SOC_DAPM_AIF_OUT("AIF2TX3", NULL, 0,
764 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX3_ENA_SHIFT, 0),
765 SND_SOC_DAPM_AIF_OUT("AIF2TX4", NULL, 0,
766 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX4_ENA_SHIFT, 0),
767 SND_SOC_DAPM_AIF_OUT("AIF2TX5", NULL, 0,
768 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX5_ENA_SHIFT, 0),
769 SND_SOC_DAPM_AIF_OUT("AIF2TX6", NULL, 0,
770 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX6_ENA_SHIFT, 0),
771 SND_SOC_DAPM_AIF_OUT("AIF2TX7", NULL, 0,
772 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX7_ENA_SHIFT, 0),
773 SND_SOC_DAPM_AIF_OUT("AIF2TX8", NULL, 0,
774 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX8_ENA_SHIFT, 0),
775
776 SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0,
777 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
778 MADERA_SLIMTX1_ENA_SHIFT, 0),
779 SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0,
780 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
781 MADERA_SLIMTX2_ENA_SHIFT, 0),
782 SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0,
783 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
784 MADERA_SLIMTX3_ENA_SHIFT, 0),
785 SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0,
786 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
787 MADERA_SLIMTX4_ENA_SHIFT, 0),
788 SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0,
789 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
790 MADERA_SLIMTX5_ENA_SHIFT, 0),
791 SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0,
792 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
793 MADERA_SLIMTX6_ENA_SHIFT, 0),
794 SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0,
795 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
796 MADERA_SLIMTX7_ENA_SHIFT, 0),
797 SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0,
798 MADERA_SLIMBUS_TX_CHANNEL_ENABLE,
799 MADERA_SLIMTX8_ENA_SHIFT, 0),
800
801 SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0,
802 MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX1_ENA_SHIFT, 0),
803 SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 0,
804 MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX2_ENA_SHIFT, 0),
805 SND_SOC_DAPM_AIF_OUT("AIF3TX3", NULL, 0,
806 MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX3_ENA_SHIFT, 0),
807 SND_SOC_DAPM_AIF_OUT("AIF3TX4", NULL, 0,
808 MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX4_ENA_SHIFT, 0),
809
810 SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
811 MADERA_OUT1L_ENA_SHIFT, 0, NULL, 0, madera_hp_ev,
812 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
813 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
814 SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM,
815 MADERA_OUT1R_ENA_SHIFT, 0, NULL, 0, madera_hp_ev,
816 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
817 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
818 SND_SOC_DAPM_PGA_E("OUT2L", SND_SOC_NOPM,
819 MADERA_OUT2L_ENA_SHIFT, 0, NULL, 0, madera_hp_ev,
820 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
821 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
822 SND_SOC_DAPM_PGA_E("OUT2R", SND_SOC_NOPM,
823 MADERA_OUT2R_ENA_SHIFT, 0, NULL, 0, madera_hp_ev,
824 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
825 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
826 SND_SOC_DAPM_PGA_E("OUT3L", MADERA_OUTPUT_ENABLES_1,
827 MADERA_OUT3L_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
828 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
829 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
830 SND_SOC_DAPM_PGA_E("OUT3R", MADERA_OUTPUT_ENABLES_1,
831 MADERA_OUT3R_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
832 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
833 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
834 SND_SOC_DAPM_PGA_E("OUT5L", MADERA_OUTPUT_ENABLES_1,
835 MADERA_OUT5L_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
836 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
837 SND_SOC_DAPM_PGA_E("OUT5R", MADERA_OUTPUT_ENABLES_1,
838 MADERA_OUT5R_ENA_SHIFT, 0, NULL, 0, madera_out_ev,
839 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
840
841 SND_SOC_DAPM_PGA("SPD1TX1", MADERA_SPD1_TX_CONTROL,
842 MADERA_SPD1_VAL1_SHIFT, 0, NULL, 0),
843 SND_SOC_DAPM_PGA("SPD1TX2", MADERA_SPD1_TX_CONTROL,
844 MADERA_SPD1_VAL2_SHIFT, 0, NULL, 0),
845 SND_SOC_DAPM_OUT_DRV("SPD1", MADERA_SPD1_TX_CONTROL,
846 MADERA_SPD1_ENA_SHIFT, 0, NULL, 0),
847
848
849
850
851
852
853 SND_SOC_DAPM_PGA("Noise Generator", MADERA_COMFORT_NOISE_GENERATOR,
854 MADERA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0),
855
856 SND_SOC_DAPM_PGA("Tone Generator 1", MADERA_TONE_GENERATOR_1,
857 MADERA_TONE1_ENA_SHIFT, 0, NULL, 0),
858 SND_SOC_DAPM_PGA("Tone Generator 2", MADERA_TONE_GENERATOR_1,
859 MADERA_TONE2_ENA_SHIFT, 0, NULL, 0),
860
861 SND_SOC_DAPM_SIGGEN("HAPTICS"),
862
863 SND_SOC_DAPM_MUX("AEC1 Loopback", MADERA_DAC_AEC_CONTROL_1,
864 MADERA_AEC1_LOOPBACK_ENA_SHIFT, 0,
865 &cs47l92_aec_loopback_mux),
866
867 SND_SOC_DAPM_PGA_E("IN1L", MADERA_INPUT_ENABLES, MADERA_IN1L_ENA_SHIFT,
868 0, NULL, 0, madera_in_ev,
869 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
870 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
871 SND_SOC_DAPM_PGA_E("IN1R", MADERA_INPUT_ENABLES, MADERA_IN1R_ENA_SHIFT,
872 0, NULL, 0, madera_in_ev,
873 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
874 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
875 SND_SOC_DAPM_PGA_E("IN2L", MADERA_INPUT_ENABLES, MADERA_IN2L_ENA_SHIFT,
876 0, NULL, 0, madera_in_ev,
877 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
878 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
879 SND_SOC_DAPM_PGA_E("IN2R", MADERA_INPUT_ENABLES, MADERA_IN2R_ENA_SHIFT,
880 0, NULL, 0, madera_in_ev,
881 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
882 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
883 SND_SOC_DAPM_PGA_E("IN3L", MADERA_INPUT_ENABLES, MADERA_IN3L_ENA_SHIFT,
884 0, NULL, 0, madera_in_ev,
885 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
886 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
887 SND_SOC_DAPM_PGA_E("IN3R", MADERA_INPUT_ENABLES, MADERA_IN3R_ENA_SHIFT,
888 0, NULL, 0, madera_in_ev,
889 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
890 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
891 SND_SOC_DAPM_PGA_E("IN4L", MADERA_INPUT_ENABLES, MADERA_IN4L_ENA_SHIFT,
892 0, NULL, 0, madera_in_ev,
893 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
894 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
895 SND_SOC_DAPM_PGA_E("IN4R", MADERA_INPUT_ENABLES, MADERA_IN4R_ENA_SHIFT,
896 0, NULL, 0, madera_in_ev,
897 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
898 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
899
900 SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0,
901 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX1_ENA_SHIFT, 0),
902 SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0,
903 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX2_ENA_SHIFT, 0),
904 SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0,
905 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX3_ENA_SHIFT, 0),
906 SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0,
907 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX4_ENA_SHIFT, 0),
908 SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0,
909 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX5_ENA_SHIFT, 0),
910 SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0,
911 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX6_ENA_SHIFT, 0),
912 SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0,
913 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX7_ENA_SHIFT, 0),
914 SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0,
915 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX8_ENA_SHIFT, 0),
916
917 SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0,
918 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX1_ENA_SHIFT, 0),
919 SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0,
920 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX2_ENA_SHIFT, 0),
921 SND_SOC_DAPM_AIF_IN("AIF2RX3", NULL, 0,
922 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX3_ENA_SHIFT, 0),
923 SND_SOC_DAPM_AIF_IN("AIF2RX4", NULL, 0,
924 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX4_ENA_SHIFT, 0),
925 SND_SOC_DAPM_AIF_IN("AIF2RX5", NULL, 0,
926 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX5_ENA_SHIFT, 0),
927 SND_SOC_DAPM_AIF_IN("AIF2RX6", NULL, 0,
928 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX6_ENA_SHIFT, 0),
929 SND_SOC_DAPM_AIF_IN("AIF2RX7", NULL, 0,
930 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX7_ENA_SHIFT, 0),
931 SND_SOC_DAPM_AIF_IN("AIF2RX8", NULL, 0,
932 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX8_ENA_SHIFT, 0),
933
934 SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0,
935 MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX1_ENA_SHIFT, 0),
936 SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0,
937 MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX2_ENA_SHIFT, 0),
938 SND_SOC_DAPM_AIF_IN("AIF3RX3", NULL, 0,
939 MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX3_ENA_SHIFT, 0),
940 SND_SOC_DAPM_AIF_IN("AIF3RX4", NULL, 0,
941 MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX4_ENA_SHIFT, 0),
942
943 SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
944 MADERA_SLIMRX1_ENA_SHIFT, 0),
945 SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
946 MADERA_SLIMRX2_ENA_SHIFT, 0),
947 SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
948 MADERA_SLIMRX3_ENA_SHIFT, 0),
949 SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
950 MADERA_SLIMRX4_ENA_SHIFT, 0),
951 SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
952 MADERA_SLIMRX5_ENA_SHIFT, 0),
953 SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
954 MADERA_SLIMRX6_ENA_SHIFT, 0),
955 SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
956 MADERA_SLIMRX7_ENA_SHIFT, 0),
957 SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE,
958 MADERA_SLIMRX8_ENA_SHIFT, 0),
959
960 SND_SOC_DAPM_PGA("EQ1", MADERA_EQ1_1, MADERA_EQ1_ENA_SHIFT, 0, NULL, 0),
961 SND_SOC_DAPM_PGA("EQ2", MADERA_EQ2_1, MADERA_EQ2_ENA_SHIFT, 0, NULL, 0),
962 SND_SOC_DAPM_PGA("EQ3", MADERA_EQ3_1, MADERA_EQ3_ENA_SHIFT, 0, NULL, 0),
963 SND_SOC_DAPM_PGA("EQ4", MADERA_EQ4_1, MADERA_EQ4_ENA_SHIFT, 0, NULL, 0),
964
965 SND_SOC_DAPM_PGA("DRC1L", MADERA_DRC1_CTRL1, MADERA_DRC1L_ENA_SHIFT, 0,
966 NULL, 0),
967 SND_SOC_DAPM_PGA("DRC1R", MADERA_DRC1_CTRL1, MADERA_DRC1R_ENA_SHIFT, 0,
968 NULL, 0),
969 SND_SOC_DAPM_PGA("DRC2L", MADERA_DRC2_CTRL1, MADERA_DRC2L_ENA_SHIFT, 0,
970 NULL, 0),
971 SND_SOC_DAPM_PGA("DRC2R", MADERA_DRC2_CTRL1, MADERA_DRC2R_ENA_SHIFT, 0,
972 NULL, 0),
973
974 SND_SOC_DAPM_PGA("LHPF1", MADERA_HPLPF1_1, MADERA_LHPF1_ENA_SHIFT, 0,
975 NULL, 0),
976 SND_SOC_DAPM_PGA("LHPF2", MADERA_HPLPF2_1, MADERA_LHPF2_ENA_SHIFT, 0,
977 NULL, 0),
978 SND_SOC_DAPM_PGA("LHPF3", MADERA_HPLPF3_1, MADERA_LHPF3_ENA_SHIFT, 0,
979 NULL, 0),
980 SND_SOC_DAPM_PGA("LHPF4", MADERA_HPLPF4_1, MADERA_LHPF4_ENA_SHIFT, 0,
981 NULL, 0),
982
983 SND_SOC_DAPM_PGA("ASRC1IN1L", MADERA_ASRC1_ENABLE,
984 MADERA_ASRC1_IN1L_ENA_SHIFT, 0, NULL, 0),
985 SND_SOC_DAPM_PGA("ASRC1IN1R", MADERA_ASRC1_ENABLE,
986 MADERA_ASRC1_IN1R_ENA_SHIFT, 0, NULL, 0),
987 SND_SOC_DAPM_PGA("ASRC1IN2L", MADERA_ASRC1_ENABLE,
988 MADERA_ASRC1_IN2L_ENA_SHIFT, 0, NULL, 0),
989 SND_SOC_DAPM_PGA("ASRC1IN2R", MADERA_ASRC1_ENABLE,
990 MADERA_ASRC1_IN2R_ENA_SHIFT, 0, NULL, 0),
991
992 SND_SOC_DAPM_PGA("ISRC1DEC1", MADERA_ISRC_1_CTRL_3,
993 MADERA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0),
994 SND_SOC_DAPM_PGA("ISRC1DEC2", MADERA_ISRC_1_CTRL_3,
995 MADERA_ISRC1_DEC2_ENA_SHIFT, 0, NULL, 0),
996
997 SND_SOC_DAPM_PGA("ISRC1INT1", MADERA_ISRC_1_CTRL_3,
998 MADERA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0),
999 SND_SOC_DAPM_PGA("ISRC1INT2", MADERA_ISRC_1_CTRL_3,
1000 MADERA_ISRC1_INT2_ENA_SHIFT, 0, NULL, 0),
1001
1002 SND_SOC_DAPM_PGA("ISRC2DEC1", MADERA_ISRC_2_CTRL_3,
1003 MADERA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0),
1004 SND_SOC_DAPM_PGA("ISRC2DEC2", MADERA_ISRC_2_CTRL_3,
1005 MADERA_ISRC2_DEC2_ENA_SHIFT, 0, NULL, 0),
1006
1007 SND_SOC_DAPM_PGA("ISRC2INT1", MADERA_ISRC_2_CTRL_3,
1008 MADERA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0),
1009 SND_SOC_DAPM_PGA("ISRC2INT2", MADERA_ISRC_2_CTRL_3,
1010 MADERA_ISRC2_INT2_ENA_SHIFT, 0, NULL, 0),
1011
1012 WM_ADSP2("DSP1", 0, cs47l92_adsp_power_ev),
1013
1014
1015
1016 SND_SOC_DAPM_PGA("DFC1", MADERA_DFC1_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1017 SND_SOC_DAPM_PGA("DFC2", MADERA_DFC2_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1018 SND_SOC_DAPM_PGA("DFC3", MADERA_DFC3_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1019 SND_SOC_DAPM_PGA("DFC4", MADERA_DFC4_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1020 SND_SOC_DAPM_PGA("DFC5", MADERA_DFC5_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1021 SND_SOC_DAPM_PGA("DFC6", MADERA_DFC6_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1022 SND_SOC_DAPM_PGA("DFC7", MADERA_DFC7_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1023 SND_SOC_DAPM_PGA("DFC8", MADERA_DFC8_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0),
1024
1025 MADERA_MIXER_WIDGETS(EQ1, "EQ1"),
1026 MADERA_MIXER_WIDGETS(EQ2, "EQ2"),
1027 MADERA_MIXER_WIDGETS(EQ3, "EQ3"),
1028 MADERA_MIXER_WIDGETS(EQ4, "EQ4"),
1029
1030 MADERA_MIXER_WIDGETS(DRC1L, "DRC1L"),
1031 MADERA_MIXER_WIDGETS(DRC1R, "DRC1R"),
1032 MADERA_MIXER_WIDGETS(DRC2L, "DRC2L"),
1033 MADERA_MIXER_WIDGETS(DRC2R, "DRC2R"),
1034
1035 SND_SOC_DAPM_SWITCH("DRC1 Activity Output", SND_SOC_NOPM, 0, 0,
1036 &madera_drc_activity_output_mux[0]),
1037 SND_SOC_DAPM_SWITCH("DRC2 Activity Output", SND_SOC_NOPM, 0, 0,
1038 &madera_drc_activity_output_mux[1]),
1039
1040 MADERA_MIXER_WIDGETS(LHPF1, "LHPF1"),
1041 MADERA_MIXER_WIDGETS(LHPF2, "LHPF2"),
1042 MADERA_MIXER_WIDGETS(LHPF3, "LHPF3"),
1043 MADERA_MIXER_WIDGETS(LHPF4, "LHPF4"),
1044
1045 MADERA_MIXER_WIDGETS(PWM1, "PWM1"),
1046 MADERA_MIXER_WIDGETS(PWM2, "PWM2"),
1047
1048 MADERA_MIXER_WIDGETS(OUT1L, "HPOUT1L"),
1049 MADERA_MIXER_WIDGETS(OUT1R, "HPOUT1R"),
1050 MADERA_MIXER_WIDGETS(OUT2L, "HPOUT2L"),
1051 MADERA_MIXER_WIDGETS(OUT2R, "HPOUT2R"),
1052 MADERA_MIXER_WIDGETS(OUT3L, "HPOUT3L"),
1053 MADERA_MIXER_WIDGETS(OUT3R, "HPOUT3R"),
1054 MADERA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"),
1055 MADERA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"),
1056
1057 MADERA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"),
1058 MADERA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"),
1059 MADERA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"),
1060 MADERA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"),
1061 MADERA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"),
1062 MADERA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"),
1063 MADERA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"),
1064 MADERA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"),
1065
1066 MADERA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"),
1067 MADERA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"),
1068 MADERA_MIXER_WIDGETS(AIF2TX3, "AIF2TX3"),
1069 MADERA_MIXER_WIDGETS(AIF2TX4, "AIF2TX4"),
1070 MADERA_MIXER_WIDGETS(AIF2TX5, "AIF2TX5"),
1071 MADERA_MIXER_WIDGETS(AIF2TX6, "AIF2TX6"),
1072 MADERA_MIXER_WIDGETS(AIF2TX7, "AIF2TX7"),
1073 MADERA_MIXER_WIDGETS(AIF2TX8, "AIF2TX8"),
1074
1075 MADERA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"),
1076 MADERA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"),
1077 MADERA_MIXER_WIDGETS(AIF3TX3, "AIF3TX3"),
1078 MADERA_MIXER_WIDGETS(AIF3TX4, "AIF3TX4"),
1079
1080 MADERA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"),
1081 MADERA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"),
1082 MADERA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"),
1083 MADERA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"),
1084 MADERA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"),
1085 MADERA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"),
1086 MADERA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"),
1087 MADERA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"),
1088
1089 MADERA_MUX_WIDGETS(SPD1TX1, "SPDIFTX1"),
1090 MADERA_MUX_WIDGETS(SPD1TX2, "SPDIFTX2"),
1091
1092 MADERA_MUX_WIDGETS(ASRC1IN1L, "ASRC1IN1L"),
1093 MADERA_MUX_WIDGETS(ASRC1IN1R, "ASRC1IN1R"),
1094 MADERA_MUX_WIDGETS(ASRC1IN2L, "ASRC1IN2L"),
1095 MADERA_MUX_WIDGETS(ASRC1IN2R, "ASRC1IN2R"),
1096
1097 MADERA_DSP_WIDGETS(DSP1, "DSP1"),
1098
1099 MADERA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"),
1100 MADERA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"),
1101
1102 MADERA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"),
1103 MADERA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"),
1104
1105 MADERA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"),
1106 MADERA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"),
1107
1108 MADERA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"),
1109 MADERA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"),
1110
1111 MADERA_MUX_WIDGETS(DFC1, "DFC1"),
1112 MADERA_MUX_WIDGETS(DFC2, "DFC2"),
1113 MADERA_MUX_WIDGETS(DFC3, "DFC3"),
1114 MADERA_MUX_WIDGETS(DFC4, "DFC4"),
1115 MADERA_MUX_WIDGETS(DFC5, "DFC5"),
1116 MADERA_MUX_WIDGETS(DFC6, "DFC6"),
1117 MADERA_MUX_WIDGETS(DFC7, "DFC7"),
1118 MADERA_MUX_WIDGETS(DFC8, "DFC8"),
1119
1120 SND_SOC_DAPM_OUTPUT("HPOUT1L"),
1121 SND_SOC_DAPM_OUTPUT("HPOUT1R"),
1122 SND_SOC_DAPM_OUTPUT("HPOUT2L"),
1123 SND_SOC_DAPM_OUTPUT("HPOUT2R"),
1124 SND_SOC_DAPM_OUTPUT("HPOUT3L"),
1125 SND_SOC_DAPM_OUTPUT("HPOUT3R"),
1126 SND_SOC_DAPM_OUTPUT("HPOUT4L"),
1127 SND_SOC_DAPM_OUTPUT("HPOUT4R"),
1128 SND_SOC_DAPM_OUTPUT("SPKDAT1L"),
1129 SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
1130 SND_SOC_DAPM_OUTPUT("SPDIF1"),
1131
1132 SND_SOC_DAPM_OUTPUT("MICSUPP"),
1133 };
1134
1135 #define MADERA_MIXER_INPUT_ROUTES(name) \
1136 { name, "Noise Generator", "Noise Generator" }, \
1137 { name, "Tone Generator 1", "Tone Generator 1" }, \
1138 { name, "Tone Generator 2", "Tone Generator 2" }, \
1139 { name, "Haptics", "HAPTICS" }, \
1140 { name, "AEC1", "AEC1 Loopback" }, \
1141 { name, "IN1L", "IN1L" }, \
1142 { name, "IN1R", "IN1R" }, \
1143 { name, "IN2L", "IN2L" }, \
1144 { name, "IN2R", "IN2R" }, \
1145 { name, "IN3L", "IN3L" }, \
1146 { name, "IN3R", "IN3R" }, \
1147 { name, "IN4L", "IN4L" }, \
1148 { name, "IN4R", "IN4R" }, \
1149 { name, "AIF1RX1", "AIF1RX1" }, \
1150 { name, "AIF1RX2", "AIF1RX2" }, \
1151 { name, "AIF1RX3", "AIF1RX3" }, \
1152 { name, "AIF1RX4", "AIF1RX4" }, \
1153 { name, "AIF1RX5", "AIF1RX5" }, \
1154 { name, "AIF1RX6", "AIF1RX6" }, \
1155 { name, "AIF1RX7", "AIF1RX7" }, \
1156 { name, "AIF1RX8", "AIF1RX8" }, \
1157 { name, "AIF2RX1", "AIF2RX1" }, \
1158 { name, "AIF2RX2", "AIF2RX2" }, \
1159 { name, "AIF2RX3", "AIF2RX3" }, \
1160 { name, "AIF2RX4", "AIF2RX4" }, \
1161 { name, "AIF2RX5", "AIF2RX5" }, \
1162 { name, "AIF2RX6", "AIF2RX6" }, \
1163 { name, "AIF2RX7", "AIF2RX7" }, \
1164 { name, "AIF2RX8", "AIF2RX8" }, \
1165 { name, "AIF3RX1", "AIF3RX1" }, \
1166 { name, "AIF3RX2", "AIF3RX2" }, \
1167 { name, "AIF3RX3", "AIF3RX3" }, \
1168 { name, "AIF3RX4", "AIF3RX4" }, \
1169 { name, "SLIMRX1", "SLIMRX1" }, \
1170 { name, "SLIMRX2", "SLIMRX2" }, \
1171 { name, "SLIMRX3", "SLIMRX3" }, \
1172 { name, "SLIMRX4", "SLIMRX4" }, \
1173 { name, "SLIMRX5", "SLIMRX5" }, \
1174 { name, "SLIMRX6", "SLIMRX6" }, \
1175 { name, "SLIMRX7", "SLIMRX7" }, \
1176 { name, "SLIMRX8", "SLIMRX8" }, \
1177 { name, "EQ1", "EQ1" }, \
1178 { name, "EQ2", "EQ2" }, \
1179 { name, "EQ3", "EQ3" }, \
1180 { name, "EQ4", "EQ4" }, \
1181 { name, "DRC1L", "DRC1L" }, \
1182 { name, "DRC1R", "DRC1R" }, \
1183 { name, "DRC2L", "DRC2L" }, \
1184 { name, "DRC2R", "DRC2R" }, \
1185 { name, "LHPF1", "LHPF1" }, \
1186 { name, "LHPF2", "LHPF2" }, \
1187 { name, "LHPF3", "LHPF3" }, \
1188 { name, "LHPF4", "LHPF4" }, \
1189 { name, "ASRC1IN1L", "ASRC1IN1L" }, \
1190 { name, "ASRC1IN1R", "ASRC1IN1R" }, \
1191 { name, "ASRC1IN2L", "ASRC1IN2L" }, \
1192 { name, "ASRC1IN2R", "ASRC1IN2R" }, \
1193 { name, "ISRC1DEC1", "ISRC1DEC1" }, \
1194 { name, "ISRC1DEC2", "ISRC1DEC2" }, \
1195 { name, "ISRC1INT1", "ISRC1INT1" }, \
1196 { name, "ISRC1INT2", "ISRC1INT2" }, \
1197 { name, "ISRC2DEC1", "ISRC2DEC1" }, \
1198 { name, "ISRC2DEC2", "ISRC2DEC2" }, \
1199 { name, "ISRC2INT1", "ISRC2INT1" }, \
1200 { name, "ISRC2INT2", "ISRC2INT2" }, \
1201 { name, "DSP1.1", "DSP1" }, \
1202 { name, "DSP1.2", "DSP1" }, \
1203 { name, "DSP1.3", "DSP1" }, \
1204 { name, "DSP1.4", "DSP1" }, \
1205 { name, "DSP1.5", "DSP1" }, \
1206 { name, "DSP1.6", "DSP1" }, \
1207 { name, "DFC1", "DFC1" }, \
1208 { name, "DFC2", "DFC2" }, \
1209 { name, "DFC3", "DFC3" }, \
1210 { name, "DFC4", "DFC4" }, \
1211 { name, "DFC5", "DFC5" }, \
1212 { name, "DFC6", "DFC6" }, \
1213 { name, "DFC7", "DFC7" }, \
1214 { name, "DFC8", "DFC8" }
1215
1216 static const struct snd_soc_dapm_route cs47l92_dapm_routes[] = {
1217
1218 { "EQ1", NULL, "FXCLK" },
1219 { "EQ2", NULL, "FXCLK" },
1220 { "EQ3", NULL, "FXCLK" },
1221 { "EQ4", NULL, "FXCLK" },
1222 { "DRC1L", NULL, "FXCLK" },
1223 { "DRC1R", NULL, "FXCLK" },
1224 { "DRC2L", NULL, "FXCLK" },
1225 { "DRC2R", NULL, "FXCLK" },
1226 { "LHPF1", NULL, "FXCLK" },
1227 { "LHPF2", NULL, "FXCLK" },
1228 { "LHPF3", NULL, "FXCLK" },
1229 { "LHPF4", NULL, "FXCLK" },
1230 { "PWM1 Mixer", NULL, "PWMCLK" },
1231 { "PWM2 Mixer", NULL, "PWMCLK" },
1232 { "OUT1L", NULL, "OUTCLK" },
1233 { "OUT1R", NULL, "OUTCLK" },
1234 { "OUT2L", NULL, "OUTCLK" },
1235 { "OUT2R", NULL, "OUTCLK" },
1236 { "OUT3L", NULL, "OUTCLK" },
1237 { "OUT3R", NULL, "OUTCLK" },
1238 { "OUT5L", NULL, "OUTCLK" },
1239 { "OUT5R", NULL, "OUTCLK" },
1240 { "AIF1TX1", NULL, "AIF1TXCLK" },
1241 { "AIF1TX2", NULL, "AIF1TXCLK" },
1242 { "AIF1TX3", NULL, "AIF1TXCLK" },
1243 { "AIF1TX4", NULL, "AIF1TXCLK" },
1244 { "AIF1TX5", NULL, "AIF1TXCLK" },
1245 { "AIF1TX6", NULL, "AIF1TXCLK" },
1246 { "AIF1TX7", NULL, "AIF1TXCLK" },
1247 { "AIF1TX8", NULL, "AIF1TXCLK" },
1248 { "AIF2TX1", NULL, "AIF2TXCLK" },
1249 { "AIF2TX2", NULL, "AIF2TXCLK" },
1250 { "AIF2TX3", NULL, "AIF2TXCLK" },
1251 { "AIF2TX4", NULL, "AIF2TXCLK" },
1252 { "AIF2TX5", NULL, "AIF2TXCLK" },
1253 { "AIF2TX6", NULL, "AIF2TXCLK" },
1254 { "AIF2TX7", NULL, "AIF2TXCLK" },
1255 { "AIF2TX8", NULL, "AIF2TXCLK" },
1256 { "AIF3TX1", NULL, "AIF3TXCLK" },
1257 { "AIF3TX2", NULL, "AIF3TXCLK" },
1258 { "AIF3TX3", NULL, "AIF3TXCLK" },
1259 { "AIF3TX4", NULL, "AIF3TXCLK" },
1260 { "SLIMTX1", NULL, "SLIMBUSCLK" },
1261 { "SLIMTX2", NULL, "SLIMBUSCLK" },
1262 { "SLIMTX3", NULL, "SLIMBUSCLK" },
1263 { "SLIMTX4", NULL, "SLIMBUSCLK" },
1264 { "SLIMTX5", NULL, "SLIMBUSCLK" },
1265 { "SLIMTX6", NULL, "SLIMBUSCLK" },
1266 { "SLIMTX7", NULL, "SLIMBUSCLK" },
1267 { "SLIMTX8", NULL, "SLIMBUSCLK" },
1268 { "SPD1TX1", NULL, "SPDCLK" },
1269 { "SPD1TX2", NULL, "SPDCLK" },
1270 { "DSP1", NULL, "DSP1CLK" },
1271 { "ISRC1DEC1", NULL, "ISRC1CLK" },
1272 { "ISRC1DEC2", NULL, "ISRC1CLK" },
1273 { "ISRC1INT1", NULL, "ISRC1CLK" },
1274 { "ISRC1INT2", NULL, "ISRC1CLK" },
1275 { "ISRC2DEC1", NULL, "ISRC2CLK" },
1276 { "ISRC2DEC2", NULL, "ISRC2CLK" },
1277 { "ISRC2INT1", NULL, "ISRC2CLK" },
1278 { "ISRC2INT2", NULL, "ISRC2CLK" },
1279 { "ASRC1IN1L", NULL, "ASRC1CLK" },
1280 { "ASRC1IN1R", NULL, "ASRC1CLK" },
1281 { "ASRC1IN2L", NULL, "ASRC1CLK" },
1282 { "ASRC1IN2R", NULL, "ASRC1CLK" },
1283 { "DFC1", NULL, "DFCCLK" },
1284 { "DFC2", NULL, "DFCCLK" },
1285 { "DFC3", NULL, "DFCCLK" },
1286 { "DFC4", NULL, "DFCCLK" },
1287 { "DFC5", NULL, "DFCCLK" },
1288 { "DFC6", NULL, "DFCCLK" },
1289 { "DFC7", NULL, "DFCCLK" },
1290 { "DFC8", NULL, "DFCCLK" },
1291
1292 { "OUT1L", NULL, "CPVDD1" },
1293 { "OUT1L", NULL, "CPVDD2" },
1294 { "OUT1R", NULL, "CPVDD1" },
1295 { "OUT1R", NULL, "CPVDD2" },
1296 { "OUT2L", NULL, "CPVDD1" },
1297 { "OUT2L", NULL, "CPVDD2" },
1298 { "OUT2R", NULL, "CPVDD1" },
1299 { "OUT2R", NULL, "CPVDD2" },
1300 { "OUT3L", NULL, "CPVDD1" },
1301 { "OUT3L", NULL, "CPVDD2" },
1302 { "OUT3R", NULL, "CPVDD1" },
1303 { "OUT3R", NULL, "CPVDD2" },
1304
1305 { "OUT1L", NULL, "SYSCLK" },
1306 { "OUT1R", NULL, "SYSCLK" },
1307 { "OUT2L", NULL, "SYSCLK" },
1308 { "OUT2R", NULL, "SYSCLK" },
1309 { "OUT3L", NULL, "SYSCLK" },
1310 { "OUT3R", NULL, "SYSCLK" },
1311 { "OUT5L", NULL, "SYSCLK" },
1312 { "OUT5R", NULL, "SYSCLK" },
1313
1314 { "SPD1", NULL, "SYSCLK" },
1315 { "SPD1", NULL, "SPD1TX1" },
1316 { "SPD1", NULL, "SPD1TX2" },
1317
1318 { "IN1L", NULL, "SYSCLK" },
1319 { "IN1R", NULL, "SYSCLK" },
1320 { "IN2L", NULL, "SYSCLK" },
1321 { "IN2R", NULL, "SYSCLK" },
1322 { "IN3L", NULL, "SYSCLK" },
1323 { "IN3R", NULL, "SYSCLK" },
1324 { "IN4L", NULL, "SYSCLK" },
1325 { "IN4R", NULL, "SYSCLK" },
1326
1327 { "ASRC1IN1L", NULL, "SYSCLK" },
1328 { "ASRC1IN1R", NULL, "SYSCLK" },
1329 { "ASRC1IN2L", NULL, "SYSCLK" },
1330 { "ASRC1IN2R", NULL, "SYSCLK" },
1331
1332 { "ASRC1IN1L", NULL, "ASYNCCLK" },
1333 { "ASRC1IN1R", NULL, "ASYNCCLK" },
1334 { "ASRC1IN2L", NULL, "ASYNCCLK" },
1335 { "ASRC1IN2R", NULL, "ASYNCCLK" },
1336
1337 { "MICBIAS1", NULL, "MICVDD" },
1338 { "MICBIAS2", NULL, "MICVDD" },
1339
1340 { "MICBIAS1A", NULL, "MICBIAS1" },
1341 { "MICBIAS1B", NULL, "MICBIAS1" },
1342 { "MICBIAS1C", NULL, "MICBIAS1" },
1343 { "MICBIAS1D", NULL, "MICBIAS1" },
1344
1345 { "MICBIAS2A", NULL, "MICBIAS2" },
1346 { "MICBIAS2B", NULL, "MICBIAS2" },
1347
1348 { "Noise Generator", NULL, "SYSCLK" },
1349 { "Tone Generator 1", NULL, "SYSCLK" },
1350 { "Tone Generator 2", NULL, "SYSCLK" },
1351
1352 { "Noise Generator", NULL, "NOISE" },
1353 { "Tone Generator 1", NULL, "TONE" },
1354 { "Tone Generator 2", NULL, "TONE" },
1355
1356 { "AIF1 Capture", NULL, "AIF1TX1" },
1357 { "AIF1 Capture", NULL, "AIF1TX2" },
1358 { "AIF1 Capture", NULL, "AIF1TX3" },
1359 { "AIF1 Capture", NULL, "AIF1TX4" },
1360 { "AIF1 Capture", NULL, "AIF1TX5" },
1361 { "AIF1 Capture", NULL, "AIF1TX6" },
1362 { "AIF1 Capture", NULL, "AIF1TX7" },
1363 { "AIF1 Capture", NULL, "AIF1TX8" },
1364
1365 { "AIF1RX1", NULL, "AIF1 Playback" },
1366 { "AIF1RX2", NULL, "AIF1 Playback" },
1367 { "AIF1RX3", NULL, "AIF1 Playback" },
1368 { "AIF1RX4", NULL, "AIF1 Playback" },
1369 { "AIF1RX5", NULL, "AIF1 Playback" },
1370 { "AIF1RX6", NULL, "AIF1 Playback" },
1371 { "AIF1RX7", NULL, "AIF1 Playback" },
1372 { "AIF1RX8", NULL, "AIF1 Playback" },
1373
1374 { "AIF2 Capture", NULL, "AIF2TX1" },
1375 { "AIF2 Capture", NULL, "AIF2TX2" },
1376 { "AIF2 Capture", NULL, "AIF2TX3" },
1377 { "AIF2 Capture", NULL, "AIF2TX4" },
1378 { "AIF2 Capture", NULL, "AIF2TX5" },
1379 { "AIF2 Capture", NULL, "AIF2TX6" },
1380 { "AIF2 Capture", NULL, "AIF2TX7" },
1381 { "AIF2 Capture", NULL, "AIF2TX8" },
1382
1383 { "AIF2RX1", NULL, "AIF2 Playback" },
1384 { "AIF2RX2", NULL, "AIF2 Playback" },
1385 { "AIF2RX3", NULL, "AIF2 Playback" },
1386 { "AIF2RX4", NULL, "AIF2 Playback" },
1387 { "AIF2RX5", NULL, "AIF2 Playback" },
1388 { "AIF2RX6", NULL, "AIF2 Playback" },
1389 { "AIF2RX7", NULL, "AIF2 Playback" },
1390 { "AIF2RX8", NULL, "AIF2 Playback" },
1391
1392 { "AIF3 Capture", NULL, "AIF3TX1" },
1393 { "AIF3 Capture", NULL, "AIF3TX2" },
1394 { "AIF3 Capture", NULL, "AIF3TX3" },
1395 { "AIF3 Capture", NULL, "AIF3TX4" },
1396
1397 { "AIF3RX1", NULL, "AIF3 Playback" },
1398 { "AIF3RX2", NULL, "AIF3 Playback" },
1399 { "AIF3RX3", NULL, "AIF3 Playback" },
1400 { "AIF3RX4", NULL, "AIF3 Playback" },
1401
1402 { "Slim1 Capture", NULL, "SLIMTX1" },
1403 { "Slim1 Capture", NULL, "SLIMTX2" },
1404 { "Slim1 Capture", NULL, "SLIMTX3" },
1405 { "Slim1 Capture", NULL, "SLIMTX4" },
1406
1407 { "SLIMRX1", NULL, "Slim1 Playback" },
1408 { "SLIMRX2", NULL, "Slim1 Playback" },
1409 { "SLIMRX3", NULL, "Slim1 Playback" },
1410 { "SLIMRX4", NULL, "Slim1 Playback" },
1411
1412 { "Slim2 Capture", NULL, "SLIMTX5" },
1413 { "Slim2 Capture", NULL, "SLIMTX6" },
1414
1415 { "SLIMRX5", NULL, "Slim2 Playback" },
1416 { "SLIMRX6", NULL, "Slim2 Playback" },
1417
1418 { "Slim3 Capture", NULL, "SLIMTX7" },
1419 { "Slim3 Capture", NULL, "SLIMTX8" },
1420
1421 { "SLIMRX7", NULL, "Slim3 Playback" },
1422 { "SLIMRX8", NULL, "Slim3 Playback" },
1423
1424 { "AIF1 Playback", NULL, "SYSCLK" },
1425 { "AIF2 Playback", NULL, "SYSCLK" },
1426 { "AIF3 Playback", NULL, "SYSCLK" },
1427 { "Slim1 Playback", NULL, "SYSCLK" },
1428 { "Slim2 Playback", NULL, "SYSCLK" },
1429 { "Slim3 Playback", NULL, "SYSCLK" },
1430
1431 { "AIF1 Capture", NULL, "SYSCLK" },
1432 { "AIF2 Capture", NULL, "SYSCLK" },
1433 { "AIF3 Capture", NULL, "SYSCLK" },
1434 { "Slim1 Capture", NULL, "SYSCLK" },
1435 { "Slim2 Capture", NULL, "SYSCLK" },
1436 { "Slim3 Capture", NULL, "SYSCLK" },
1437
1438 { "Audio Trace DSP", NULL, "DSP1" },
1439
1440 { "IN1L Analog Mux", "A", "IN1ALN" },
1441 { "IN1L Analog Mux", "A", "IN1ALP" },
1442 { "IN1L Analog Mux", "B", "IN1BLN" },
1443 { "IN1L Analog Mux", "B", "IN1BLP" },
1444 { "IN1R Analog Mux", "A", "IN1ARN" },
1445 { "IN1R Analog Mux", "A", "IN1ARP" },
1446 { "IN1R Analog Mux", "B", "IN1BR" },
1447 { "IN1R Analog Mux", "B", "IN1ALN" },
1448
1449 { "IN1L Mode", "Analog", "IN1L Analog Mux" },
1450 { "IN1R Mode", "Analog", "IN1R Analog Mux" },
1451
1452 { "IN1L Mode", "Digital", "IN1ALN" },
1453 { "IN1L Mode", "Digital", "IN1ALP" },
1454 { "IN1R Mode", "Digital", "IN1ALN" },
1455 { "IN1R Mode", "Digital", "IN1ALP" },
1456
1457 { "IN1L", NULL, "IN1L Mode" },
1458 { "IN1R", NULL, "IN1R Mode" },
1459
1460 { "IN2L Analog Mux", "A", "IN2ALN" },
1461 { "IN2L Analog Mux", "A", "IN2ALP" },
1462 { "IN2L Analog Mux", "B", "IN2ALN" },
1463 { "IN2L Analog Mux", "B", "IN2BL" },
1464 { "IN2R Analog Mux", "A", "IN2ARN" },
1465 { "IN2R Analog Mux", "A", "IN2ARP" },
1466 { "IN2R Analog Mux", "B", "IN2ARN" },
1467 { "IN2R Analog Mux", "B", "IN2BR" },
1468
1469 { "IN2L Mode", "Analog", "IN2L Analog Mux" },
1470 { "IN2R Mode", "Analog", "IN2R Analog Mux" },
1471
1472 { "IN2L Mode", "Digital", "IN2ALN" },
1473 { "IN2L Mode", "Digital", "IN2ALP" },
1474 { "IN2R Mode", "Digital", "IN2ALN" },
1475 { "IN2R Mode", "Digital", "IN2ALP" },
1476
1477 { "IN2L", NULL, "IN2L Mode" },
1478 { "IN2R", NULL, "IN2R Mode" },
1479
1480 { "IN3L", NULL, "IN1ARN" },
1481 { "IN3L", NULL, "IN1ARP" },
1482 { "IN3R", NULL, "IN1ARN" },
1483 { "IN3R", NULL, "IN1ARP" },
1484
1485 { "IN4L", NULL, "IN2ARN" },
1486 { "IN4L", NULL, "IN2ARP" },
1487 { "IN4R", NULL, "IN2ARN" },
1488 { "IN4R", NULL, "IN2ARP" },
1489
1490 MADERA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
1491 MADERA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
1492 MADERA_MIXER_ROUTES("OUT2L", "HPOUT2L"),
1493 MADERA_MIXER_ROUTES("OUT2R", "HPOUT2R"),
1494 MADERA_MIXER_ROUTES("OUT3L", "HPOUT3L"),
1495 MADERA_MIXER_ROUTES("OUT3R", "HPOUT3R"),
1496
1497 MADERA_MIXER_ROUTES("OUT5L", "SPKDAT1L"),
1498 MADERA_MIXER_ROUTES("OUT5R", "SPKDAT1R"),
1499
1500 MADERA_MIXER_ROUTES("PWM1 Driver", "PWM1"),
1501 MADERA_MIXER_ROUTES("PWM2 Driver", "PWM2"),
1502
1503 MADERA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"),
1504 MADERA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"),
1505 MADERA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"),
1506 MADERA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"),
1507 MADERA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"),
1508 MADERA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"),
1509 MADERA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"),
1510 MADERA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"),
1511
1512 MADERA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"),
1513 MADERA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"),
1514 MADERA_MIXER_ROUTES("AIF2TX3", "AIF2TX3"),
1515 MADERA_MIXER_ROUTES("AIF2TX4", "AIF2TX4"),
1516 MADERA_MIXER_ROUTES("AIF2TX5", "AIF2TX5"),
1517 MADERA_MIXER_ROUTES("AIF2TX6", "AIF2TX6"),
1518 MADERA_MIXER_ROUTES("AIF2TX7", "AIF2TX7"),
1519 MADERA_MIXER_ROUTES("AIF2TX8", "AIF2TX8"),
1520
1521 MADERA_MIXER_ROUTES("AIF3TX1", "AIF3TX1"),
1522 MADERA_MIXER_ROUTES("AIF3TX2", "AIF3TX2"),
1523 MADERA_MIXER_ROUTES("AIF3TX3", "AIF3TX3"),
1524 MADERA_MIXER_ROUTES("AIF3TX4", "AIF3TX4"),
1525
1526 MADERA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"),
1527 MADERA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"),
1528 MADERA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"),
1529 MADERA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"),
1530 MADERA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"),
1531 MADERA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"),
1532 MADERA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"),
1533 MADERA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"),
1534
1535 MADERA_MUX_ROUTES("SPD1TX1", "SPDIFTX1"),
1536 MADERA_MUX_ROUTES("SPD1TX2", "SPDIFTX2"),
1537
1538 MADERA_MIXER_ROUTES("EQ1", "EQ1"),
1539 MADERA_MIXER_ROUTES("EQ2", "EQ2"),
1540 MADERA_MIXER_ROUTES("EQ3", "EQ3"),
1541 MADERA_MIXER_ROUTES("EQ4", "EQ4"),
1542
1543 MADERA_MIXER_ROUTES("DRC1L", "DRC1L"),
1544 MADERA_MIXER_ROUTES("DRC1R", "DRC1R"),
1545 MADERA_MIXER_ROUTES("DRC2L", "DRC2L"),
1546 MADERA_MIXER_ROUTES("DRC2R", "DRC2R"),
1547
1548 MADERA_MIXER_ROUTES("LHPF1", "LHPF1"),
1549 MADERA_MIXER_ROUTES("LHPF2", "LHPF2"),
1550 MADERA_MIXER_ROUTES("LHPF3", "LHPF3"),
1551 MADERA_MIXER_ROUTES("LHPF4", "LHPF4"),
1552
1553 MADERA_MUX_ROUTES("ASRC1IN1L", "ASRC1IN1L"),
1554 MADERA_MUX_ROUTES("ASRC1IN1R", "ASRC1IN1R"),
1555 MADERA_MUX_ROUTES("ASRC1IN2L", "ASRC1IN2L"),
1556 MADERA_MUX_ROUTES("ASRC1IN2R", "ASRC1IN2R"),
1557
1558 MADERA_DSP_ROUTES("DSP1"),
1559
1560 MADERA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"),
1561 MADERA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"),
1562
1563 MADERA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"),
1564 MADERA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"),
1565
1566 MADERA_MUX_ROUTES("ISRC2INT1", "ISRC2INT1"),
1567 MADERA_MUX_ROUTES("ISRC2INT2", "ISRC2INT2"),
1568
1569 MADERA_MUX_ROUTES("ISRC2DEC1", "ISRC2DEC1"),
1570 MADERA_MUX_ROUTES("ISRC2DEC2", "ISRC2DEC2"),
1571
1572 { "AEC1 Loopback", "HPOUT1L", "OUT1L" },
1573 { "AEC1 Loopback", "HPOUT1R", "OUT1R" },
1574 { "HPOUT1L", NULL, "OUT1L" },
1575 { "HPOUT1R", NULL, "OUT1R" },
1576
1577 { "AEC1 Loopback", "HPOUT2L", "OUT2L" },
1578 { "AEC1 Loopback", "HPOUT2R", "OUT2R" },
1579 { "HPOUT2L", NULL, "OUT2L" },
1580 { "HPOUT2R", NULL, "OUT2R" },
1581
1582 { "AEC1 Loopback", "HPOUT3L", "OUT3L" },
1583 { "AEC1 Loopback", "HPOUT3R", "OUT3R" },
1584 { "OUT3 Demux", NULL, "OUT3L" },
1585 { "OUT3 Demux", NULL, "OUT3R" },
1586
1587 { "HPOUT3L", "HPOUT3", "OUT3 Demux" },
1588 { "HPOUT3R", "HPOUT3", "OUT3 Demux" },
1589 { "HPOUT4L", "HPOUT4", "OUT3 Demux" },
1590 { "HPOUT4R", "HPOUT4", "OUT3 Demux" },
1591
1592 { "AEC1 Loopback", "SPKDAT1L", "OUT5L" },
1593 { "AEC1 Loopback", "SPKDAT1R", "OUT5R" },
1594 { "SPKDAT1L", NULL, "OUT5L" },
1595 { "SPKDAT1R", NULL, "OUT5R" },
1596
1597 { "SPDIF1", NULL, "SPD1" },
1598
1599 { "MICSUPP", NULL, "SYSCLK" },
1600
1601 { "DRC1 Signal Activity", NULL, "DRC1 Activity Output" },
1602 { "DRC2 Signal Activity", NULL, "DRC2 Activity Output" },
1603 { "DRC1 Activity Output", "Switch", "DRC1L" },
1604 { "DRC1 Activity Output", "Switch", "DRC1R" },
1605 { "DRC2 Activity Output", "Switch", "DRC2L" },
1606 { "DRC2 Activity Output", "Switch", "DRC2R" },
1607
1608 MADERA_MUX_ROUTES("DFC1", "DFC1"),
1609 MADERA_MUX_ROUTES("DFC2", "DFC2"),
1610 MADERA_MUX_ROUTES("DFC3", "DFC3"),
1611 MADERA_MUX_ROUTES("DFC4", "DFC4"),
1612 MADERA_MUX_ROUTES("DFC5", "DFC5"),
1613 MADERA_MUX_ROUTES("DFC6", "DFC6"),
1614 MADERA_MUX_ROUTES("DFC7", "DFC7"),
1615 MADERA_MUX_ROUTES("DFC8", "DFC8"),
1616 };
1617
1618 static int cs47l92_set_fll(struct snd_soc_component *component, int fll_id,
1619 int source, unsigned int fref, unsigned int fout)
1620 {
1621 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
1622
1623 switch (fll_id) {
1624 case MADERA_FLL1_REFCLK:
1625 return madera_fllhj_set_refclk(&cs47l92->fll[0], source, fref,
1626 fout);
1627 case MADERA_FLL2_REFCLK:
1628 return madera_fllhj_set_refclk(&cs47l92->fll[1], source, fref,
1629 fout);
1630 default:
1631 return -EINVAL;
1632 }
1633 }
1634
1635 static struct snd_soc_dai_driver cs47l92_dai[] = {
1636 {
1637 .name = "cs47l92-aif1",
1638 .id = 1,
1639 .base = MADERA_AIF1_BCLK_CTRL,
1640 .playback = {
1641 .stream_name = "AIF1 Playback",
1642 .channels_min = 1,
1643 .channels_max = 8,
1644 .rates = MADERA_RATES,
1645 .formats = MADERA_FORMATS,
1646 },
1647 .capture = {
1648 .stream_name = "AIF1 Capture",
1649 .channels_min = 1,
1650 .channels_max = 8,
1651 .rates = MADERA_RATES,
1652 .formats = MADERA_FORMATS,
1653 },
1654 .ops = &madera_dai_ops,
1655 .symmetric_rates = 1,
1656 .symmetric_samplebits = 1,
1657 },
1658 {
1659 .name = "cs47l92-aif2",
1660 .id = 2,
1661 .base = MADERA_AIF2_BCLK_CTRL,
1662 .playback = {
1663 .stream_name = "AIF2 Playback",
1664 .channels_min = 1,
1665 .channels_max = 8,
1666 .rates = MADERA_RATES,
1667 .formats = MADERA_FORMATS,
1668 },
1669 .capture = {
1670 .stream_name = "AIF2 Capture",
1671 .channels_min = 1,
1672 .channels_max = 8,
1673 .rates = MADERA_RATES,
1674 .formats = MADERA_FORMATS,
1675 },
1676 .ops = &madera_dai_ops,
1677 .symmetric_rates = 1,
1678 .symmetric_samplebits = 1,
1679 },
1680 {
1681 .name = "cs47l92-aif3",
1682 .id = 3,
1683 .base = MADERA_AIF3_BCLK_CTRL,
1684 .playback = {
1685 .stream_name = "AIF3 Playback",
1686 .channels_min = 1,
1687 .channels_max = 4,
1688 .rates = MADERA_RATES,
1689 .formats = MADERA_FORMATS,
1690 },
1691 .capture = {
1692 .stream_name = "AIF3 Capture",
1693 .channels_min = 1,
1694 .channels_max = 4,
1695 .rates = MADERA_RATES,
1696 .formats = MADERA_FORMATS,
1697 },
1698 .ops = &madera_dai_ops,
1699 .symmetric_rates = 1,
1700 .symmetric_samplebits = 1,
1701 },
1702 {
1703 .name = "cs47l92-slim1",
1704 .id = 5,
1705 .playback = {
1706 .stream_name = "Slim1 Playback",
1707 .channels_min = 1,
1708 .channels_max = 4,
1709 .rates = MADERA_RATES,
1710 .formats = MADERA_FORMATS,
1711 },
1712 .capture = {
1713 .stream_name = "Slim1 Capture",
1714 .channels_min = 1,
1715 .channels_max = 4,
1716 .rates = MADERA_RATES,
1717 .formats = MADERA_FORMATS,
1718 },
1719 .ops = &madera_simple_dai_ops,
1720 },
1721 {
1722 .name = "cs47l92-slim2",
1723 .id = 6,
1724 .playback = {
1725 .stream_name = "Slim2 Playback",
1726 .channels_min = 1,
1727 .channels_max = 2,
1728 .rates = MADERA_RATES,
1729 .formats = MADERA_FORMATS,
1730 },
1731 .capture = {
1732 .stream_name = "Slim2 Capture",
1733 .channels_min = 1,
1734 .channels_max = 2,
1735 .rates = MADERA_RATES,
1736 .formats = MADERA_FORMATS,
1737 },
1738 .ops = &madera_simple_dai_ops,
1739 },
1740 {
1741 .name = "cs47l92-slim3",
1742 .id = 7,
1743 .playback = {
1744 .stream_name = "Slim3 Playback",
1745 .channels_min = 1,
1746 .channels_max = 2,
1747 .rates = MADERA_RATES,
1748 .formats = MADERA_FORMATS,
1749 },
1750 .capture = {
1751 .stream_name = "Slim3 Capture",
1752 .channels_min = 1,
1753 .channels_max = 2,
1754 .rates = MADERA_RATES,
1755 .formats = MADERA_FORMATS,
1756 },
1757 .ops = &madera_simple_dai_ops,
1758 },
1759 {
1760 .name = "cs47l92-cpu-trace",
1761 .capture = {
1762 .stream_name = "Audio Trace CPU",
1763 .channels_min = 1,
1764 .channels_max = 2,
1765 .rates = MADERA_RATES,
1766 .formats = MADERA_FORMATS,
1767 },
1768 .compress_new = snd_soc_new_compress,
1769 },
1770 {
1771 .name = "cs47l92-dsp-trace",
1772 .capture = {
1773 .stream_name = "Audio Trace DSP",
1774 .channels_min = 1,
1775 .channels_max = 2,
1776 .rates = MADERA_RATES,
1777 .formats = MADERA_FORMATS,
1778 },
1779 },
1780 };
1781
1782 static int cs47l92_open(struct snd_compr_stream *stream)
1783 {
1784 struct snd_soc_pcm_runtime *rtd = stream->private_data;
1785 struct snd_soc_component *component =
1786 snd_soc_rtdcom_lookup(rtd, DRV_NAME);
1787 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
1788 struct madera_priv *priv = &cs47l92->core;
1789 struct madera *madera = priv->madera;
1790 int n_adsp;
1791
1792 if (strcmp(rtd->codec_dai->name, "cs47l92-dsp-trace") == 0) {
1793 n_adsp = 0;
1794 } else {
1795 dev_err(madera->dev,
1796 "No suitable compressed stream for DAI '%s'\n",
1797 rtd->codec_dai->name);
1798 return -EINVAL;
1799 }
1800
1801 return wm_adsp_compr_open(&priv->adsp[n_adsp], stream);
1802 }
1803
1804 static irqreturn_t cs47l92_adsp2_irq(int irq, void *data)
1805 {
1806 struct cs47l92 *cs47l92 = data;
1807 struct madera_priv *priv = &cs47l92->core;
1808 struct madera *madera = priv->madera;
1809 int ret;
1810
1811 ret = wm_adsp_compr_handle_irq(&priv->adsp[0]);
1812 if (ret == -ENODEV) {
1813 dev_err(madera->dev, "Spurious compressed data IRQ\n");
1814 return IRQ_NONE;
1815 }
1816
1817 return IRQ_HANDLED;
1818 }
1819
1820 static int cs47l92_component_probe(struct snd_soc_component *component)
1821 {
1822 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
1823 struct madera *madera = cs47l92->core.madera;
1824 int ret;
1825
1826 snd_soc_component_init_regmap(component, madera->regmap);
1827
1828 mutex_lock(&madera->dapm_ptr_lock);
1829 madera->dapm = snd_soc_component_get_dapm(component);
1830 mutex_unlock(&madera->dapm_ptr_lock);
1831
1832 ret = madera_init_inputs(component);
1833 if (ret)
1834 return ret;
1835
1836 ret = madera_init_outputs(component, CS47L92_MONO_OUTPUTS);
1837 if (ret)
1838 return ret;
1839
1840 snd_soc_component_disable_pin(component, "HAPTICS");
1841
1842 ret = snd_soc_add_component_controls(component,
1843 madera_adsp_rate_controls,
1844 CS47L92_NUM_ADSP);
1845 if (ret)
1846 return ret;
1847
1848 return wm_adsp2_component_probe(&cs47l92->core.adsp[0], component);
1849 }
1850
1851 static void cs47l92_component_remove(struct snd_soc_component *component)
1852 {
1853 struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
1854 struct madera *madera = cs47l92->core.madera;
1855
1856 mutex_lock(&madera->dapm_ptr_lock);
1857 madera->dapm = NULL;
1858 mutex_unlock(&madera->dapm_ptr_lock);
1859
1860 wm_adsp2_component_remove(&cs47l92->core.adsp[0], component);
1861 }
1862
1863 #define CS47L92_DIG_VU 0x0200
1864
1865 static unsigned int cs47l92_digital_vu[] = {
1866 MADERA_DAC_DIGITAL_VOLUME_1L,
1867 MADERA_DAC_DIGITAL_VOLUME_1R,
1868 MADERA_DAC_DIGITAL_VOLUME_2L,
1869 MADERA_DAC_DIGITAL_VOLUME_2R,
1870 MADERA_DAC_DIGITAL_VOLUME_3L,
1871 MADERA_DAC_DIGITAL_VOLUME_3R,
1872 MADERA_DAC_DIGITAL_VOLUME_5L,
1873 MADERA_DAC_DIGITAL_VOLUME_5R,
1874 };
1875
1876 static const struct snd_compr_ops cs47l92_compr_ops = {
1877 .open = &cs47l92_open,
1878 .free = &wm_adsp_compr_free,
1879 .set_params = &wm_adsp_compr_set_params,
1880 .get_caps = &wm_adsp_compr_get_caps,
1881 .trigger = &wm_adsp_compr_trigger,
1882 .pointer = &wm_adsp_compr_pointer,
1883 .copy = &wm_adsp_compr_copy,
1884 };
1885
1886 static const struct snd_soc_component_driver soc_component_dev_cs47l92 = {
1887 .probe = &cs47l92_component_probe,
1888 .remove = &cs47l92_component_remove,
1889 .set_sysclk = &madera_set_sysclk,
1890 .set_pll = &cs47l92_set_fll,
1891 .name = DRV_NAME,
1892 .compr_ops = &cs47l92_compr_ops,
1893 .controls = cs47l92_snd_controls,
1894 .num_controls = ARRAY_SIZE(cs47l92_snd_controls),
1895 .dapm_widgets = cs47l92_dapm_widgets,
1896 .num_dapm_widgets = ARRAY_SIZE(cs47l92_dapm_widgets),
1897 .dapm_routes = cs47l92_dapm_routes,
1898 .num_dapm_routes = ARRAY_SIZE(cs47l92_dapm_routes),
1899 .use_pmdown_time = 1,
1900 .endianness = 1,
1901 .non_legacy_dai_naming = 1,
1902 };
1903
1904 static int cs47l92_probe(struct platform_device *pdev)
1905 {
1906 struct madera *madera = dev_get_drvdata(pdev->dev.parent);
1907 struct cs47l92 *cs47l92;
1908 int i, ret;
1909
1910 BUILD_BUG_ON(ARRAY_SIZE(cs47l92_dai) > MADERA_MAX_DAI);
1911
1912
1913 if (!madera->irq_dev) {
1914 dev_dbg(&pdev->dev, "irqchip driver not ready\n");
1915 return -EPROBE_DEFER;
1916 }
1917
1918 cs47l92 = devm_kzalloc(&pdev->dev, sizeof(struct cs47l92), GFP_KERNEL);
1919 if (!cs47l92)
1920 return -ENOMEM;
1921
1922 platform_set_drvdata(pdev, cs47l92);
1923
1924 cs47l92->core.madera = madera;
1925 cs47l92->core.dev = &pdev->dev;
1926 cs47l92->core.num_inputs = 8;
1927
1928 ret = madera_core_init(&cs47l92->core);
1929 if (ret)
1930 return ret;
1931
1932 ret = madera_request_irq(madera, MADERA_IRQ_DSP_IRQ1,
1933 "ADSP2 Compressed IRQ", cs47l92_adsp2_irq,
1934 cs47l92);
1935 if (ret != 0) {
1936 dev_err(&pdev->dev, "Failed to request DSP IRQ: %d\n", ret);
1937 goto error_core;
1938 }
1939
1940 ret = madera_set_irq_wake(madera, MADERA_IRQ_DSP_IRQ1, 1);
1941 if (ret)
1942 dev_warn(&pdev->dev, "Failed to set DSP IRQ wake: %d\n", ret);
1943
1944 cs47l92->core.adsp[0].part = "cs47l92";
1945 cs47l92->core.adsp[0].num = 1;
1946 cs47l92->core.adsp[0].type = WMFW_ADSP2;
1947 cs47l92->core.adsp[0].rev = 2;
1948 cs47l92->core.adsp[0].dev = madera->dev;
1949 cs47l92->core.adsp[0].regmap = madera->regmap_32bit;
1950
1951 cs47l92->core.adsp[0].base = MADERA_DSP1_CONFIG_1;
1952 cs47l92->core.adsp[0].mem = cs47l92_dsp1_regions;
1953 cs47l92->core.adsp[0].num_mems = ARRAY_SIZE(cs47l92_dsp1_regions);
1954
1955 cs47l92->core.adsp[0].lock_regions = WM_ADSP2_REGION_1_9;
1956
1957 ret = wm_adsp2_init(&cs47l92->core.adsp[0]);
1958 if (ret != 0)
1959 goto error_dsp_irq;
1960
1961 ret = madera_init_bus_error_irq(&cs47l92->core, 0, wm_adsp2_bus_error);
1962 if (ret != 0) {
1963 wm_adsp2_remove(&cs47l92->core.adsp[0]);
1964 goto error_adsp;
1965 }
1966
1967 madera_init_fll(madera, 1, MADERA_FLL1_CONTROL_1 - 1,
1968 &cs47l92->fll[0]);
1969 madera_init_fll(madera, 2, MADERA_FLL2_CONTROL_1 - 1,
1970 &cs47l92->fll[1]);
1971
1972 for (i = 0; i < ARRAY_SIZE(cs47l92_dai); i++)
1973 madera_init_dai(&cs47l92->core, i);
1974
1975
1976 for (i = 0; i < ARRAY_SIZE(cs47l92_digital_vu); i++)
1977 regmap_update_bits(madera->regmap, cs47l92_digital_vu[i],
1978 CS47L92_DIG_VU, CS47L92_DIG_VU);
1979
1980 pm_runtime_enable(&pdev->dev);
1981 pm_runtime_idle(&pdev->dev);
1982
1983 ret = devm_snd_soc_register_component(&pdev->dev,
1984 &soc_component_dev_cs47l92,
1985 cs47l92_dai,
1986 ARRAY_SIZE(cs47l92_dai));
1987 if (ret < 0) {
1988 dev_err(&pdev->dev, "Failed to register component: %d\n", ret);
1989 goto error_pm_runtime;
1990 }
1991
1992 return ret;
1993
1994 error_pm_runtime:
1995 pm_runtime_disable(&pdev->dev);
1996 madera_free_bus_error_irq(&cs47l92->core, 0);
1997 error_adsp:
1998 wm_adsp2_remove(&cs47l92->core.adsp[0]);
1999 error_dsp_irq:
2000 madera_set_irq_wake(madera, MADERA_IRQ_DSP_IRQ1, 0);
2001 madera_free_irq(madera, MADERA_IRQ_DSP_IRQ1, cs47l92);
2002 error_core:
2003 madera_core_free(&cs47l92->core);
2004
2005 return ret;
2006 }
2007
2008 static int cs47l92_remove(struct platform_device *pdev)
2009 {
2010 struct cs47l92 *cs47l92 = platform_get_drvdata(pdev);
2011
2012 pm_runtime_disable(&pdev->dev);
2013
2014 madera_free_bus_error_irq(&cs47l92->core, 0);
2015 wm_adsp2_remove(&cs47l92->core.adsp[0]);
2016
2017 madera_set_irq_wake(cs47l92->core.madera, MADERA_IRQ_DSP_IRQ1, 0);
2018 madera_free_irq(cs47l92->core.madera, MADERA_IRQ_DSP_IRQ1, cs47l92);
2019
2020 madera_core_free(&cs47l92->core);
2021
2022 return 0;
2023 }
2024
2025 static struct platform_driver cs47l92_codec_driver = {
2026 .driver = {
2027 .name = "cs47l92-codec",
2028 },
2029 .probe = &cs47l92_probe,
2030 .remove = &cs47l92_remove,
2031 };
2032
2033 module_platform_driver(cs47l92_codec_driver);
2034
2035 MODULE_SOFTDEP("pre: madera irq-madera arizona-micsupp");
2036 MODULE_DESCRIPTION("ASoC CS47L92 driver");
2037 MODULE_AUTHOR("Stuart Henderson <stuarth@opensource.cirrus.com>");
2038 MODULE_LICENSE("GPL v2");
2039 MODULE_ALIAS("platform:cs47l92-codec");