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