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