cs47l90.c (97797B)
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 35struct cs47l90 { 36 struct madera_priv core; 37 struct madera_fll fll[3]; 38}; 39 40static const struct cs_dsp_region cs47l90_dsp1_regions[] = { 41 { .type = WMFW_ADSP2_PM, .base = 0x080000 }, 42 { .type = WMFW_ADSP2_ZM, .base = 0x0e0000 }, 43 { .type = WMFW_ADSP2_XM, .base = 0x0a0000 }, 44 { .type = WMFW_ADSP2_YM, .base = 0x0c0000 }, 45}; 46 47static const struct cs_dsp_region cs47l90_dsp2_regions[] = { 48 { .type = WMFW_ADSP2_PM, .base = 0x100000 }, 49 { .type = WMFW_ADSP2_ZM, .base = 0x160000 }, 50 { .type = WMFW_ADSP2_XM, .base = 0x120000 }, 51 { .type = WMFW_ADSP2_YM, .base = 0x140000 }, 52}; 53 54static const struct cs_dsp_region cs47l90_dsp3_regions[] = { 55 { .type = WMFW_ADSP2_PM, .base = 0x180000 }, 56 { .type = WMFW_ADSP2_ZM, .base = 0x1e0000 }, 57 { .type = WMFW_ADSP2_XM, .base = 0x1a0000 }, 58 { .type = WMFW_ADSP2_YM, .base = 0x1c0000 }, 59}; 60 61static const struct cs_dsp_region cs47l90_dsp4_regions[] = { 62 { .type = WMFW_ADSP2_PM, .base = 0x200000 }, 63 { .type = WMFW_ADSP2_ZM, .base = 0x260000 }, 64 { .type = WMFW_ADSP2_XM, .base = 0x220000 }, 65 { .type = WMFW_ADSP2_YM, .base = 0x240000 }, 66}; 67 68static const struct cs_dsp_region cs47l90_dsp5_regions[] = { 69 { .type = WMFW_ADSP2_PM, .base = 0x280000 }, 70 { .type = WMFW_ADSP2_ZM, .base = 0x2e0000 }, 71 { .type = WMFW_ADSP2_XM, .base = 0x2a0000 }, 72 { .type = WMFW_ADSP2_YM, .base = 0x2c0000 }, 73}; 74 75static const struct cs_dsp_region cs47l90_dsp6_regions[] = { 76 { .type = WMFW_ADSP2_PM, .base = 0x300000 }, 77 { .type = WMFW_ADSP2_ZM, .base = 0x360000 }, 78 { .type = WMFW_ADSP2_XM, .base = 0x320000 }, 79 { .type = WMFW_ADSP2_YM, .base = 0x340000 }, 80}; 81 82static const struct cs_dsp_region cs47l90_dsp7_regions[] = { 83 { .type = WMFW_ADSP2_PM, .base = 0x380000 }, 84 { .type = WMFW_ADSP2_ZM, .base = 0x3e0000 }, 85 { .type = WMFW_ADSP2_XM, .base = 0x3a0000 }, 86 { .type = WMFW_ADSP2_YM, .base = 0x3c0000 }, 87}; 88 89static const struct cs_dsp_region *cs47l90_dsp_regions[] = { 90 cs47l90_dsp1_regions, 91 cs47l90_dsp2_regions, 92 cs47l90_dsp3_regions, 93 cs47l90_dsp4_regions, 94 cs47l90_dsp5_regions, 95 cs47l90_dsp6_regions, 96 cs47l90_dsp7_regions, 97}; 98 99static const int cs47l90_dsp_control_bases[] = { 100 MADERA_DSP1_CONFIG_1, 101 MADERA_DSP2_CONFIG_1, 102 MADERA_DSP3_CONFIG_1, 103 MADERA_DSP4_CONFIG_1, 104 MADERA_DSP5_CONFIG_1, 105 MADERA_DSP6_CONFIG_1, 106 MADERA_DSP7_CONFIG_1, 107}; 108 109static int cs47l90_adsp_power_ev(struct snd_soc_dapm_widget *w, 110 struct snd_kcontrol *kcontrol, 111 int event) 112{ 113 struct snd_soc_component *component = 114 snd_soc_dapm_to_component(w->dapm); 115 struct cs47l90 *cs47l90 = snd_soc_component_get_drvdata(component); 116 struct madera_priv *priv = &cs47l90->core; 117 struct madera *madera = priv->madera; 118 unsigned int freq; 119 int ret; 120 121 ret = regmap_read(madera->regmap, MADERA_DSP_CLOCK_2, &freq); 122 if (ret != 0) { 123 dev_err(madera->dev, 124 "Failed to read MADERA_DSP_CLOCK_2: %d\n", ret); 125 return ret; 126 } 127 128 switch (event) { 129 case SND_SOC_DAPM_PRE_PMU: 130 ret = madera_set_adsp_clk(&cs47l90->core, w->shift, freq); 131 if (ret) 132 return ret; 133 break; 134 default: 135 break; 136 } 137 138 return wm_adsp_early_event(w, kcontrol, event); 139} 140 141#define CS47L90_NG_SRC(name, base) \ 142 SOC_SINGLE(name " NG HPOUT1L Switch", base, 0, 1, 0), \ 143 SOC_SINGLE(name " NG HPOUT1R Switch", base, 1, 1, 0), \ 144 SOC_SINGLE(name " NG HPOUT2L Switch", base, 2, 1, 0), \ 145 SOC_SINGLE(name " NG HPOUT2R Switch", base, 3, 1, 0), \ 146 SOC_SINGLE(name " NG HPOUT3L Switch", base, 4, 1, 0), \ 147 SOC_SINGLE(name " NG HPOUT3R Switch", base, 5, 1, 0), \ 148 SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \ 149 SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0) 150 151#define CS47L90_RXANC_INPUT_ROUTES(widget, name) \ 152 { widget, NULL, name " NG Mux" }, \ 153 { name " NG Internal", NULL, "RXANC NG Clock" }, \ 154 { name " NG Internal", NULL, name " Channel" }, \ 155 { name " NG External", NULL, "RXANC NG External Clock" }, \ 156 { name " NG External", NULL, name " Channel" }, \ 157 { name " NG Mux", "None", name " Channel" }, \ 158 { name " NG Mux", "Internal", name " NG Internal" }, \ 159 { name " NG Mux", "External", name " NG External" }, \ 160 { name " Channel", "Left", name " Left Input" }, \ 161 { name " Channel", "Combine", name " Left Input" }, \ 162 { name " Channel", "Right", name " Right Input" }, \ 163 { name " Channel", "Combine", name " Right Input" }, \ 164 { name " Left Input", "IN1", "IN1L" }, \ 165 { name " Right Input", "IN1", "IN1R" }, \ 166 { name " Left Input", "IN2", "IN2L" }, \ 167 { name " Right Input", "IN2", "IN2R" }, \ 168 { name " Left Input", "IN3", "IN3L" }, \ 169 { name " Right Input", "IN3", "IN3R" }, \ 170 { name " Left Input", "IN4", "IN4L" }, \ 171 { name " Right Input", "IN4", "IN4R" }, \ 172 { name " Left Input", "IN5", "IN5L" }, \ 173 { name " Right Input", "IN5", "IN5R" } 174 175#define CS47L90_RXANC_OUTPUT_ROUTES(widget, name) \ 176 { widget, NULL, name " ANC Source" }, \ 177 { name " ANC Source", "RXANCL", "RXANCL" }, \ 178 { name " ANC Source", "RXANCR", "RXANCR" } 179 180static const struct snd_kcontrol_new cs47l90_snd_controls[] = { 181SOC_ENUM("IN1 OSR", madera_in_dmic_osr[0]), 182SOC_ENUM("IN2 OSR", madera_in_dmic_osr[1]), 183SOC_ENUM("IN3 OSR", madera_in_dmic_osr[2]), 184SOC_ENUM("IN4 OSR", madera_in_dmic_osr[3]), 185SOC_ENUM("IN5 OSR", madera_in_dmic_osr[4]), 186 187SOC_SINGLE_RANGE_TLV("IN1L Volume", MADERA_IN1L_CONTROL, 188 MADERA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv), 189SOC_SINGLE_RANGE_TLV("IN1R Volume", MADERA_IN1R_CONTROL, 190 MADERA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv), 191SOC_SINGLE_RANGE_TLV("IN2L Volume", MADERA_IN2L_CONTROL, 192 MADERA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv), 193SOC_SINGLE_RANGE_TLV("IN2R Volume", MADERA_IN2R_CONTROL, 194 MADERA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, madera_ana_tlv), 195 196SOC_ENUM("IN HPF Cutoff Frequency", madera_in_hpf_cut_enum), 197 198SOC_SINGLE_EXT("IN1L LP Switch", MADERA_ADC_DIGITAL_VOLUME_1L, 199 MADERA_IN1L_LP_MODE_SHIFT, 1, 0, 200 snd_soc_get_volsw, madera_lp_mode_put), 201SOC_SINGLE_EXT("IN1R LP Switch", MADERA_ADC_DIGITAL_VOLUME_1R, 202 MADERA_IN1R_LP_MODE_SHIFT, 1, 0, 203 snd_soc_get_volsw, madera_lp_mode_put), 204SOC_SINGLE_EXT("IN2L LP Switch", MADERA_ADC_DIGITAL_VOLUME_2L, 205 MADERA_IN2L_LP_MODE_SHIFT, 1, 0, 206 snd_soc_get_volsw, madera_lp_mode_put), 207SOC_SINGLE_EXT("IN2R LP Switch", MADERA_ADC_DIGITAL_VOLUME_2R, 208 MADERA_IN2R_LP_MODE_SHIFT, 1, 0, 209 snd_soc_get_volsw, madera_lp_mode_put), 210 211SOC_SINGLE("IN1L HPF Switch", MADERA_IN1L_CONTROL, 212 MADERA_IN1L_HPF_SHIFT, 1, 0), 213SOC_SINGLE("IN1R HPF Switch", MADERA_IN1R_CONTROL, 214 MADERA_IN1R_HPF_SHIFT, 1, 0), 215SOC_SINGLE("IN2L HPF Switch", MADERA_IN2L_CONTROL, 216 MADERA_IN2L_HPF_SHIFT, 1, 0), 217SOC_SINGLE("IN2R HPF Switch", MADERA_IN2R_CONTROL, 218 MADERA_IN2R_HPF_SHIFT, 1, 0), 219SOC_SINGLE("IN3L HPF Switch", MADERA_IN3L_CONTROL, 220 MADERA_IN3L_HPF_SHIFT, 1, 0), 221SOC_SINGLE("IN3R HPF Switch", MADERA_IN3R_CONTROL, 222 MADERA_IN3R_HPF_SHIFT, 1, 0), 223SOC_SINGLE("IN4L HPF Switch", MADERA_IN4L_CONTROL, 224 MADERA_IN4L_HPF_SHIFT, 1, 0), 225SOC_SINGLE("IN4R HPF Switch", MADERA_IN4R_CONTROL, 226 MADERA_IN4R_HPF_SHIFT, 1, 0), 227SOC_SINGLE("IN5L HPF Switch", MADERA_IN5L_CONTROL, 228 MADERA_IN5L_HPF_SHIFT, 1, 0), 229SOC_SINGLE("IN5R HPF Switch", MADERA_IN5R_CONTROL, 230 MADERA_IN5R_HPF_SHIFT, 1, 0), 231 232SOC_SINGLE_TLV("IN1L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_1L, 233 MADERA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 234SOC_SINGLE_TLV("IN1R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_1R, 235 MADERA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 236SOC_SINGLE_TLV("IN2L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_2L, 237 MADERA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 238SOC_SINGLE_TLV("IN2R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_2R, 239 MADERA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 240SOC_SINGLE_TLV("IN3L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_3L, 241 MADERA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 242SOC_SINGLE_TLV("IN3R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_3R, 243 MADERA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 244SOC_SINGLE_TLV("IN4L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_4L, 245 MADERA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 246SOC_SINGLE_TLV("IN4R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_4R, 247 MADERA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 248SOC_SINGLE_TLV("IN5L Digital Volume", MADERA_ADC_DIGITAL_VOLUME_5L, 249 MADERA_IN5L_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 250SOC_SINGLE_TLV("IN5R Digital Volume", MADERA_ADC_DIGITAL_VOLUME_5R, 251 MADERA_IN5R_DIG_VOL_SHIFT, 0xbf, 0, madera_digital_tlv), 252 253SOC_ENUM("Input Ramp Up", madera_in_vi_ramp), 254SOC_ENUM("Input Ramp Down", madera_in_vd_ramp), 255 256SND_SOC_BYTES("RXANC Coefficients", MADERA_ANC_COEFF_START, 257 MADERA_ANC_COEFF_END - MADERA_ANC_COEFF_START + 1), 258SND_SOC_BYTES("RXANCL Config", MADERA_FCL_FILTER_CONTROL, 1), 259SND_SOC_BYTES("RXANCL Coefficients", MADERA_FCL_COEFF_START, 260 MADERA_FCL_COEFF_END - MADERA_FCL_COEFF_START + 1), 261SND_SOC_BYTES("RXANCR Config", MADERA_FCR_FILTER_CONTROL, 1), 262SND_SOC_BYTES("RXANCR Coefficients", MADERA_FCR_COEFF_START, 263 MADERA_FCR_COEFF_END - MADERA_FCR_COEFF_START + 1), 264 265MADERA_MIXER_CONTROLS("EQ1", MADERA_EQ1MIX_INPUT_1_SOURCE), 266MADERA_MIXER_CONTROLS("EQ2", MADERA_EQ2MIX_INPUT_1_SOURCE), 267MADERA_MIXER_CONTROLS("EQ3", MADERA_EQ3MIX_INPUT_1_SOURCE), 268MADERA_MIXER_CONTROLS("EQ4", MADERA_EQ4MIX_INPUT_1_SOURCE), 269 270MADERA_EQ_CONTROL("EQ1 Coefficients", MADERA_EQ1_2), 271SOC_SINGLE_TLV("EQ1 B1 Volume", MADERA_EQ1_1, MADERA_EQ1_B1_GAIN_SHIFT, 272 24, 0, madera_eq_tlv), 273SOC_SINGLE_TLV("EQ1 B2 Volume", MADERA_EQ1_1, MADERA_EQ1_B2_GAIN_SHIFT, 274 24, 0, madera_eq_tlv), 275SOC_SINGLE_TLV("EQ1 B3 Volume", MADERA_EQ1_1, MADERA_EQ1_B3_GAIN_SHIFT, 276 24, 0, madera_eq_tlv), 277SOC_SINGLE_TLV("EQ1 B4 Volume", MADERA_EQ1_2, MADERA_EQ1_B4_GAIN_SHIFT, 278 24, 0, madera_eq_tlv), 279SOC_SINGLE_TLV("EQ1 B5 Volume", MADERA_EQ1_2, MADERA_EQ1_B5_GAIN_SHIFT, 280 24, 0, madera_eq_tlv), 281 282MADERA_EQ_CONTROL("EQ2 Coefficients", MADERA_EQ2_2), 283SOC_SINGLE_TLV("EQ2 B1 Volume", MADERA_EQ2_1, MADERA_EQ2_B1_GAIN_SHIFT, 284 24, 0, madera_eq_tlv), 285SOC_SINGLE_TLV("EQ2 B2 Volume", MADERA_EQ2_1, MADERA_EQ2_B2_GAIN_SHIFT, 286 24, 0, madera_eq_tlv), 287SOC_SINGLE_TLV("EQ2 B3 Volume", MADERA_EQ2_1, MADERA_EQ2_B3_GAIN_SHIFT, 288 24, 0, madera_eq_tlv), 289SOC_SINGLE_TLV("EQ2 B4 Volume", MADERA_EQ2_2, MADERA_EQ2_B4_GAIN_SHIFT, 290 24, 0, madera_eq_tlv), 291SOC_SINGLE_TLV("EQ2 B5 Volume", MADERA_EQ2_2, MADERA_EQ2_B5_GAIN_SHIFT, 292 24, 0, madera_eq_tlv), 293 294MADERA_EQ_CONTROL("EQ3 Coefficients", MADERA_EQ3_2), 295SOC_SINGLE_TLV("EQ3 B1 Volume", MADERA_EQ3_1, MADERA_EQ3_B1_GAIN_SHIFT, 296 24, 0, madera_eq_tlv), 297SOC_SINGLE_TLV("EQ3 B2 Volume", MADERA_EQ3_1, MADERA_EQ3_B2_GAIN_SHIFT, 298 24, 0, madera_eq_tlv), 299SOC_SINGLE_TLV("EQ3 B3 Volume", MADERA_EQ3_1, MADERA_EQ3_B3_GAIN_SHIFT, 300 24, 0, madera_eq_tlv), 301SOC_SINGLE_TLV("EQ3 B4 Volume", MADERA_EQ3_2, MADERA_EQ3_B4_GAIN_SHIFT, 302 24, 0, madera_eq_tlv), 303SOC_SINGLE_TLV("EQ3 B5 Volume", MADERA_EQ3_2, MADERA_EQ3_B5_GAIN_SHIFT, 304 24, 0, madera_eq_tlv), 305 306MADERA_EQ_CONTROL("EQ4 Coefficients", MADERA_EQ4_2), 307SOC_SINGLE_TLV("EQ4 B1 Volume", MADERA_EQ4_1, MADERA_EQ4_B1_GAIN_SHIFT, 308 24, 0, madera_eq_tlv), 309SOC_SINGLE_TLV("EQ4 B2 Volume", MADERA_EQ4_1, MADERA_EQ4_B2_GAIN_SHIFT, 310 24, 0, madera_eq_tlv), 311SOC_SINGLE_TLV("EQ4 B3 Volume", MADERA_EQ4_1, MADERA_EQ4_B3_GAIN_SHIFT, 312 24, 0, madera_eq_tlv), 313SOC_SINGLE_TLV("EQ4 B4 Volume", MADERA_EQ4_2, MADERA_EQ4_B4_GAIN_SHIFT, 314 24, 0, madera_eq_tlv), 315SOC_SINGLE_TLV("EQ4 B5 Volume", MADERA_EQ4_2, MADERA_EQ4_B5_GAIN_SHIFT, 316 24, 0, madera_eq_tlv), 317 318MADERA_MIXER_CONTROLS("DRC1L", MADERA_DRC1LMIX_INPUT_1_SOURCE), 319MADERA_MIXER_CONTROLS("DRC1R", MADERA_DRC1RMIX_INPUT_1_SOURCE), 320MADERA_MIXER_CONTROLS("DRC2L", MADERA_DRC2LMIX_INPUT_1_SOURCE), 321MADERA_MIXER_CONTROLS("DRC2R", MADERA_DRC2RMIX_INPUT_1_SOURCE), 322 323SND_SOC_BYTES_MASK("DRC1", MADERA_DRC1_CTRL1, 5, 324 MADERA_DRC1R_ENA | MADERA_DRC1L_ENA), 325SND_SOC_BYTES_MASK("DRC2", MADERA_DRC2_CTRL1, 5, 326 MADERA_DRC2R_ENA | MADERA_DRC2L_ENA), 327 328MADERA_MIXER_CONTROLS("LHPF1", MADERA_HPLP1MIX_INPUT_1_SOURCE), 329MADERA_MIXER_CONTROLS("LHPF2", MADERA_HPLP2MIX_INPUT_1_SOURCE), 330MADERA_MIXER_CONTROLS("LHPF3", MADERA_HPLP3MIX_INPUT_1_SOURCE), 331MADERA_MIXER_CONTROLS("LHPF4", MADERA_HPLP4MIX_INPUT_1_SOURCE), 332 333MADERA_LHPF_CONTROL("LHPF1 Coefficients", MADERA_HPLPF1_2), 334MADERA_LHPF_CONTROL("LHPF2 Coefficients", MADERA_HPLPF2_2), 335MADERA_LHPF_CONTROL("LHPF3 Coefficients", MADERA_HPLPF3_2), 336MADERA_LHPF_CONTROL("LHPF4 Coefficients", MADERA_HPLPF4_2), 337 338SOC_ENUM("LHPF1 Mode", madera_lhpf1_mode), 339SOC_ENUM("LHPF2 Mode", madera_lhpf2_mode), 340SOC_ENUM("LHPF3 Mode", madera_lhpf3_mode), 341SOC_ENUM("LHPF4 Mode", madera_lhpf4_mode), 342 343MADERA_RATE_ENUM("ISRC1 FSL", madera_isrc_fsl[0]), 344MADERA_RATE_ENUM("ISRC2 FSL", madera_isrc_fsl[1]), 345MADERA_RATE_ENUM("ISRC3 FSL", madera_isrc_fsl[2]), 346MADERA_RATE_ENUM("ISRC4 FSL", madera_isrc_fsl[3]), 347MADERA_RATE_ENUM("ISRC1 FSH", madera_isrc_fsh[0]), 348MADERA_RATE_ENUM("ISRC2 FSH", madera_isrc_fsh[1]), 349MADERA_RATE_ENUM("ISRC3 FSH", madera_isrc_fsh[2]), 350MADERA_RATE_ENUM("ISRC4 FSH", madera_isrc_fsh[3]), 351MADERA_RATE_ENUM("ASRC1 Rate 1", madera_asrc1_rate[0]), 352MADERA_RATE_ENUM("ASRC1 Rate 2", madera_asrc1_rate[1]), 353MADERA_RATE_ENUM("ASRC2 Rate 1", madera_asrc2_rate[0]), 354MADERA_RATE_ENUM("ASRC2 Rate 2", madera_asrc2_rate[1]), 355 356WM_ADSP2_PRELOAD_SWITCH("DSP1", 1), 357WM_ADSP2_PRELOAD_SWITCH("DSP2", 2), 358WM_ADSP2_PRELOAD_SWITCH("DSP3", 3), 359WM_ADSP2_PRELOAD_SWITCH("DSP4", 4), 360WM_ADSP2_PRELOAD_SWITCH("DSP5", 5), 361WM_ADSP2_PRELOAD_SWITCH("DSP6", 6), 362WM_ADSP2_PRELOAD_SWITCH("DSP7", 7), 363 364MADERA_MIXER_CONTROLS("DSP1L", MADERA_DSP1LMIX_INPUT_1_SOURCE), 365MADERA_MIXER_CONTROLS("DSP1R", MADERA_DSP1RMIX_INPUT_1_SOURCE), 366MADERA_MIXER_CONTROLS("DSP2L", MADERA_DSP2LMIX_INPUT_1_SOURCE), 367MADERA_MIXER_CONTROLS("DSP2R", MADERA_DSP2RMIX_INPUT_1_SOURCE), 368MADERA_MIXER_CONTROLS("DSP3L", MADERA_DSP3LMIX_INPUT_1_SOURCE), 369MADERA_MIXER_CONTROLS("DSP3R", MADERA_DSP3RMIX_INPUT_1_SOURCE), 370MADERA_MIXER_CONTROLS("DSP4L", MADERA_DSP4LMIX_INPUT_1_SOURCE), 371MADERA_MIXER_CONTROLS("DSP4R", MADERA_DSP4RMIX_INPUT_1_SOURCE), 372MADERA_MIXER_CONTROLS("DSP5L", MADERA_DSP5LMIX_INPUT_1_SOURCE), 373MADERA_MIXER_CONTROLS("DSP5R", MADERA_DSP5RMIX_INPUT_1_SOURCE), 374MADERA_MIXER_CONTROLS("DSP6L", MADERA_DSP6LMIX_INPUT_1_SOURCE), 375MADERA_MIXER_CONTROLS("DSP6R", MADERA_DSP6RMIX_INPUT_1_SOURCE), 376MADERA_MIXER_CONTROLS("DSP7L", MADERA_DSP7LMIX_INPUT_1_SOURCE), 377MADERA_MIXER_CONTROLS("DSP7R", MADERA_DSP7RMIX_INPUT_1_SOURCE), 378 379SOC_SINGLE_TLV("Noise Generator Volume", MADERA_COMFORT_NOISE_GENERATOR, 380 MADERA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, madera_noise_tlv), 381 382MADERA_MIXER_CONTROLS("HPOUT1L", MADERA_OUT1LMIX_INPUT_1_SOURCE), 383MADERA_MIXER_CONTROLS("HPOUT1R", MADERA_OUT1RMIX_INPUT_1_SOURCE), 384MADERA_MIXER_CONTROLS("HPOUT2L", MADERA_OUT2LMIX_INPUT_1_SOURCE), 385MADERA_MIXER_CONTROLS("HPOUT2R", MADERA_OUT2RMIX_INPUT_1_SOURCE), 386MADERA_MIXER_CONTROLS("HPOUT3L", MADERA_OUT3LMIX_INPUT_1_SOURCE), 387MADERA_MIXER_CONTROLS("HPOUT3R", MADERA_OUT3RMIX_INPUT_1_SOURCE), 388MADERA_MIXER_CONTROLS("SPKDAT1L", MADERA_OUT5LMIX_INPUT_1_SOURCE), 389MADERA_MIXER_CONTROLS("SPKDAT1R", MADERA_OUT5RMIX_INPUT_1_SOURCE), 390 391SOC_SINGLE("HPOUT1 SC Protect Switch", MADERA_HP1_SHORT_CIRCUIT_CTRL, 392 MADERA_HP1_SC_ENA_SHIFT, 1, 0), 393SOC_SINGLE("HPOUT2 SC Protect Switch", MADERA_HP2_SHORT_CIRCUIT_CTRL, 394 MADERA_HP2_SC_ENA_SHIFT, 1, 0), 395SOC_SINGLE("HPOUT3 SC Protect Switch", MADERA_HP3_SHORT_CIRCUIT_CTRL, 396 MADERA_HP3_SC_ENA_SHIFT, 1, 0), 397 398SOC_SINGLE("SPKDAT1 High Performance Switch", MADERA_OUTPUT_PATH_CONFIG_5L, 399 MADERA_OUT5_OSR_SHIFT, 1, 0), 400 401SOC_DOUBLE_R("HPOUT1 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_1L, 402 MADERA_DAC_DIGITAL_VOLUME_1R, MADERA_OUT1L_MUTE_SHIFT, 1, 1), 403SOC_DOUBLE_R("HPOUT2 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_2L, 404 MADERA_DAC_DIGITAL_VOLUME_2R, MADERA_OUT2L_MUTE_SHIFT, 1, 1), 405SOC_DOUBLE_R("HPOUT3 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_3L, 406 MADERA_DAC_DIGITAL_VOLUME_3R, MADERA_OUT3L_MUTE_SHIFT, 1, 1), 407SOC_DOUBLE_R("SPKDAT1 Digital Switch", MADERA_DAC_DIGITAL_VOLUME_5L, 408 MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_OUT5L_MUTE_SHIFT, 1, 1), 409 410SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_1L, 411 MADERA_DAC_DIGITAL_VOLUME_1R, MADERA_OUT1L_VOL_SHIFT, 412 0xbf, 0, madera_digital_tlv), 413SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_2L, 414 MADERA_DAC_DIGITAL_VOLUME_2R, MADERA_OUT2L_VOL_SHIFT, 415 0xbf, 0, madera_digital_tlv), 416SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_3L, 417 MADERA_DAC_DIGITAL_VOLUME_3R, MADERA_OUT3L_VOL_SHIFT, 418 0xbf, 0, madera_digital_tlv), 419SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", MADERA_DAC_DIGITAL_VOLUME_5L, 420 MADERA_DAC_DIGITAL_VOLUME_5R, MADERA_OUT5L_VOL_SHIFT, 421 0xbf, 0, madera_digital_tlv), 422 423SOC_DOUBLE("SPKDAT1 Switch", MADERA_PDM_SPK1_CTRL_1, MADERA_SPK1L_MUTE_SHIFT, 424 MADERA_SPK1R_MUTE_SHIFT, 1, 1), 425 426SOC_ENUM("Output Ramp Up", madera_out_vi_ramp), 427SOC_ENUM("Output Ramp Down", madera_out_vd_ramp), 428 429SOC_SINGLE("Noise Gate Switch", MADERA_NOISE_GATE_CONTROL, 430 MADERA_NGATE_ENA_SHIFT, 1, 0), 431SOC_SINGLE_TLV("Noise Gate Threshold Volume", MADERA_NOISE_GATE_CONTROL, 432 MADERA_NGATE_THR_SHIFT, 7, 1, madera_ng_tlv), 433SOC_ENUM("Noise Gate Hold", madera_ng_hold), 434 435SOC_ENUM_EXT("DFC1RX Width", madera_dfc_width[0], 436 snd_soc_get_enum_double, madera_dfc_put), 437SOC_ENUM_EXT("DFC1RX Type", madera_dfc_type[0], 438 snd_soc_get_enum_double, madera_dfc_put), 439SOC_ENUM_EXT("DFC1TX Width", madera_dfc_width[1], 440 snd_soc_get_enum_double, madera_dfc_put), 441SOC_ENUM_EXT("DFC1TX Type", madera_dfc_type[1], 442 snd_soc_get_enum_double, madera_dfc_put), 443SOC_ENUM_EXT("DFC2RX Width", madera_dfc_width[2], 444 snd_soc_get_enum_double, madera_dfc_put), 445SOC_ENUM_EXT("DFC2RX Type", madera_dfc_type[2], 446 snd_soc_get_enum_double, madera_dfc_put), 447SOC_ENUM_EXT("DFC2TX Width", madera_dfc_width[3], 448 snd_soc_get_enum_double, madera_dfc_put), 449SOC_ENUM_EXT("DFC2TX Type", madera_dfc_type[3], 450 snd_soc_get_enum_double, madera_dfc_put), 451SOC_ENUM_EXT("DFC3RX Width", madera_dfc_width[4], 452 snd_soc_get_enum_double, madera_dfc_put), 453SOC_ENUM_EXT("DFC3RX Type", madera_dfc_type[4], 454 snd_soc_get_enum_double, madera_dfc_put), 455SOC_ENUM_EXT("DFC3TX Width", madera_dfc_width[5], 456 snd_soc_get_enum_double, madera_dfc_put), 457SOC_ENUM_EXT("DFC3TX Type", madera_dfc_type[5], 458 snd_soc_get_enum_double, madera_dfc_put), 459SOC_ENUM_EXT("DFC4RX Width", madera_dfc_width[6], 460 snd_soc_get_enum_double, madera_dfc_put), 461SOC_ENUM_EXT("DFC4RX Type", madera_dfc_type[6], 462 snd_soc_get_enum_double, madera_dfc_put), 463SOC_ENUM_EXT("DFC4TX Width", madera_dfc_width[7], 464 snd_soc_get_enum_double, madera_dfc_put), 465SOC_ENUM_EXT("DFC4TX Type", madera_dfc_type[7], 466 snd_soc_get_enum_double, madera_dfc_put), 467SOC_ENUM_EXT("DFC5RX Width", madera_dfc_width[8], 468 snd_soc_get_enum_double, madera_dfc_put), 469SOC_ENUM_EXT("DFC5RX Type", madera_dfc_type[8], 470 snd_soc_get_enum_double, madera_dfc_put), 471SOC_ENUM_EXT("DFC5TX Width", madera_dfc_width[9], 472 snd_soc_get_enum_double, madera_dfc_put), 473SOC_ENUM_EXT("DFC5TX Type", madera_dfc_type[9], 474 snd_soc_get_enum_double, madera_dfc_put), 475SOC_ENUM_EXT("DFC6RX Width", madera_dfc_width[10], 476 snd_soc_get_enum_double, madera_dfc_put), 477SOC_ENUM_EXT("DFC6RX Type", madera_dfc_type[10], 478 snd_soc_get_enum_double, madera_dfc_put), 479SOC_ENUM_EXT("DFC6TX Width", madera_dfc_width[11], 480 snd_soc_get_enum_double, madera_dfc_put), 481SOC_ENUM_EXT("DFC6TX Type", madera_dfc_type[11], 482 snd_soc_get_enum_double, madera_dfc_put), 483SOC_ENUM_EXT("DFC7RX Width", madera_dfc_width[12], 484 snd_soc_get_enum_double, madera_dfc_put), 485SOC_ENUM_EXT("DFC7RX Type", madera_dfc_type[12], 486 snd_soc_get_enum_double, madera_dfc_put), 487SOC_ENUM_EXT("DFC7TX Width", madera_dfc_width[13], 488 snd_soc_get_enum_double, madera_dfc_put), 489SOC_ENUM_EXT("DFC7TX Type", madera_dfc_type[13], 490 snd_soc_get_enum_double, madera_dfc_put), 491SOC_ENUM_EXT("DFC8RX Width", madera_dfc_width[14], 492 snd_soc_get_enum_double, madera_dfc_put), 493SOC_ENUM_EXT("DFC8RX Type", madera_dfc_type[14], 494 snd_soc_get_enum_double, madera_dfc_put), 495SOC_ENUM_EXT("DFC8TX Width", madera_dfc_width[15], 496 snd_soc_get_enum_double, madera_dfc_put), 497SOC_ENUM_EXT("DFC8TX Type", madera_dfc_type[15], 498 snd_soc_get_enum_double, madera_dfc_put), 499 500CS47L90_NG_SRC("HPOUT1L", MADERA_NOISE_GATE_SELECT_1L), 501CS47L90_NG_SRC("HPOUT1R", MADERA_NOISE_GATE_SELECT_1R), 502CS47L90_NG_SRC("HPOUT2L", MADERA_NOISE_GATE_SELECT_2L), 503CS47L90_NG_SRC("HPOUT2R", MADERA_NOISE_GATE_SELECT_2R), 504CS47L90_NG_SRC("HPOUT3L", MADERA_NOISE_GATE_SELECT_3L), 505CS47L90_NG_SRC("HPOUT3R", MADERA_NOISE_GATE_SELECT_3R), 506CS47L90_NG_SRC("SPKDAT1L", MADERA_NOISE_GATE_SELECT_5L), 507CS47L90_NG_SRC("SPKDAT1R", MADERA_NOISE_GATE_SELECT_5R), 508 509MADERA_MIXER_CONTROLS("AIF1TX1", MADERA_AIF1TX1MIX_INPUT_1_SOURCE), 510MADERA_MIXER_CONTROLS("AIF1TX2", MADERA_AIF1TX2MIX_INPUT_1_SOURCE), 511MADERA_MIXER_CONTROLS("AIF1TX3", MADERA_AIF1TX3MIX_INPUT_1_SOURCE), 512MADERA_MIXER_CONTROLS("AIF1TX4", MADERA_AIF1TX4MIX_INPUT_1_SOURCE), 513MADERA_MIXER_CONTROLS("AIF1TX5", MADERA_AIF1TX5MIX_INPUT_1_SOURCE), 514MADERA_MIXER_CONTROLS("AIF1TX6", MADERA_AIF1TX6MIX_INPUT_1_SOURCE), 515MADERA_MIXER_CONTROLS("AIF1TX7", MADERA_AIF1TX7MIX_INPUT_1_SOURCE), 516MADERA_MIXER_CONTROLS("AIF1TX8", MADERA_AIF1TX8MIX_INPUT_1_SOURCE), 517 518MADERA_MIXER_CONTROLS("AIF2TX1", MADERA_AIF2TX1MIX_INPUT_1_SOURCE), 519MADERA_MIXER_CONTROLS("AIF2TX2", MADERA_AIF2TX2MIX_INPUT_1_SOURCE), 520MADERA_MIXER_CONTROLS("AIF2TX3", MADERA_AIF2TX3MIX_INPUT_1_SOURCE), 521MADERA_MIXER_CONTROLS("AIF2TX4", MADERA_AIF2TX4MIX_INPUT_1_SOURCE), 522MADERA_MIXER_CONTROLS("AIF2TX5", MADERA_AIF2TX5MIX_INPUT_1_SOURCE), 523MADERA_MIXER_CONTROLS("AIF2TX6", MADERA_AIF2TX6MIX_INPUT_1_SOURCE), 524MADERA_MIXER_CONTROLS("AIF2TX7", MADERA_AIF2TX7MIX_INPUT_1_SOURCE), 525MADERA_MIXER_CONTROLS("AIF2TX8", MADERA_AIF2TX8MIX_INPUT_1_SOURCE), 526 527MADERA_MIXER_CONTROLS("AIF3TX1", MADERA_AIF3TX1MIX_INPUT_1_SOURCE), 528MADERA_MIXER_CONTROLS("AIF3TX2", MADERA_AIF3TX2MIX_INPUT_1_SOURCE), 529 530MADERA_MIXER_CONTROLS("AIF4TX1", MADERA_AIF4TX1MIX_INPUT_1_SOURCE), 531MADERA_MIXER_CONTROLS("AIF4TX2", MADERA_AIF4TX2MIX_INPUT_1_SOURCE), 532 533MADERA_MIXER_CONTROLS("SLIMTX1", MADERA_SLIMTX1MIX_INPUT_1_SOURCE), 534MADERA_MIXER_CONTROLS("SLIMTX2", MADERA_SLIMTX2MIX_INPUT_1_SOURCE), 535MADERA_MIXER_CONTROLS("SLIMTX3", MADERA_SLIMTX3MIX_INPUT_1_SOURCE), 536MADERA_MIXER_CONTROLS("SLIMTX4", MADERA_SLIMTX4MIX_INPUT_1_SOURCE), 537MADERA_MIXER_CONTROLS("SLIMTX5", MADERA_SLIMTX5MIX_INPUT_1_SOURCE), 538MADERA_MIXER_CONTROLS("SLIMTX6", MADERA_SLIMTX6MIX_INPUT_1_SOURCE), 539MADERA_MIXER_CONTROLS("SLIMTX7", MADERA_SLIMTX7MIX_INPUT_1_SOURCE), 540MADERA_MIXER_CONTROLS("SLIMTX8", MADERA_SLIMTX8MIX_INPUT_1_SOURCE), 541 542MADERA_GAINMUX_CONTROLS("SPDIF1TX1", MADERA_SPDIF1TX1MIX_INPUT_1_SOURCE), 543MADERA_GAINMUX_CONTROLS("SPDIF1TX2", MADERA_SPDIF1TX2MIX_INPUT_1_SOURCE), 544 545WM_ADSP_FW_CONTROL("DSP1", 0), 546WM_ADSP_FW_CONTROL("DSP2", 1), 547WM_ADSP_FW_CONTROL("DSP3", 2), 548WM_ADSP_FW_CONTROL("DSP4", 3), 549WM_ADSP_FW_CONTROL("DSP5", 4), 550WM_ADSP_FW_CONTROL("DSP6", 5), 551WM_ADSP_FW_CONTROL("DSP7", 6), 552}; 553 554MADERA_MIXER_ENUMS(EQ1, MADERA_EQ1MIX_INPUT_1_SOURCE); 555MADERA_MIXER_ENUMS(EQ2, MADERA_EQ2MIX_INPUT_1_SOURCE); 556MADERA_MIXER_ENUMS(EQ3, MADERA_EQ3MIX_INPUT_1_SOURCE); 557MADERA_MIXER_ENUMS(EQ4, MADERA_EQ4MIX_INPUT_1_SOURCE); 558 559MADERA_MIXER_ENUMS(DRC1L, MADERA_DRC1LMIX_INPUT_1_SOURCE); 560MADERA_MIXER_ENUMS(DRC1R, MADERA_DRC1RMIX_INPUT_1_SOURCE); 561MADERA_MIXER_ENUMS(DRC2L, MADERA_DRC2LMIX_INPUT_1_SOURCE); 562MADERA_MIXER_ENUMS(DRC2R, MADERA_DRC2RMIX_INPUT_1_SOURCE); 563 564MADERA_MIXER_ENUMS(LHPF1, MADERA_HPLP1MIX_INPUT_1_SOURCE); 565MADERA_MIXER_ENUMS(LHPF2, MADERA_HPLP2MIX_INPUT_1_SOURCE); 566MADERA_MIXER_ENUMS(LHPF3, MADERA_HPLP3MIX_INPUT_1_SOURCE); 567MADERA_MIXER_ENUMS(LHPF4, MADERA_HPLP4MIX_INPUT_1_SOURCE); 568 569MADERA_MIXER_ENUMS(DSP1L, MADERA_DSP1LMIX_INPUT_1_SOURCE); 570MADERA_MIXER_ENUMS(DSP1R, MADERA_DSP1RMIX_INPUT_1_SOURCE); 571MADERA_DSP_AUX_ENUMS(DSP1, MADERA_DSP1AUX1MIX_INPUT_1_SOURCE); 572 573MADERA_MIXER_ENUMS(DSP2L, MADERA_DSP2LMIX_INPUT_1_SOURCE); 574MADERA_MIXER_ENUMS(DSP2R, MADERA_DSP2RMIX_INPUT_1_SOURCE); 575MADERA_DSP_AUX_ENUMS(DSP2, MADERA_DSP2AUX1MIX_INPUT_1_SOURCE); 576 577MADERA_MIXER_ENUMS(DSP3L, MADERA_DSP3LMIX_INPUT_1_SOURCE); 578MADERA_MIXER_ENUMS(DSP3R, MADERA_DSP3RMIX_INPUT_1_SOURCE); 579MADERA_DSP_AUX_ENUMS(DSP3, MADERA_DSP3AUX1MIX_INPUT_1_SOURCE); 580 581MADERA_MIXER_ENUMS(DSP4L, MADERA_DSP4LMIX_INPUT_1_SOURCE); 582MADERA_MIXER_ENUMS(DSP4R, MADERA_DSP4RMIX_INPUT_1_SOURCE); 583MADERA_DSP_AUX_ENUMS(DSP4, MADERA_DSP4AUX1MIX_INPUT_1_SOURCE); 584 585MADERA_MIXER_ENUMS(DSP5L, MADERA_DSP5LMIX_INPUT_1_SOURCE); 586MADERA_MIXER_ENUMS(DSP5R, MADERA_DSP5RMIX_INPUT_1_SOURCE); 587MADERA_DSP_AUX_ENUMS(DSP5, MADERA_DSP5AUX1MIX_INPUT_1_SOURCE); 588 589MADERA_MIXER_ENUMS(DSP6L, MADERA_DSP6LMIX_INPUT_1_SOURCE); 590MADERA_MIXER_ENUMS(DSP6R, MADERA_DSP6RMIX_INPUT_1_SOURCE); 591MADERA_DSP_AUX_ENUMS(DSP6, MADERA_DSP6AUX1MIX_INPUT_1_SOURCE); 592 593MADERA_MIXER_ENUMS(DSP7L, MADERA_DSP7LMIX_INPUT_1_SOURCE); 594MADERA_MIXER_ENUMS(DSP7R, MADERA_DSP7RMIX_INPUT_1_SOURCE); 595MADERA_DSP_AUX_ENUMS(DSP7, MADERA_DSP7AUX1MIX_INPUT_1_SOURCE); 596 597MADERA_MIXER_ENUMS(PWM1, MADERA_PWM1MIX_INPUT_1_SOURCE); 598MADERA_MIXER_ENUMS(PWM2, MADERA_PWM2MIX_INPUT_1_SOURCE); 599 600MADERA_MIXER_ENUMS(OUT1L, MADERA_OUT1LMIX_INPUT_1_SOURCE); 601MADERA_MIXER_ENUMS(OUT1R, MADERA_OUT1RMIX_INPUT_1_SOURCE); 602MADERA_MIXER_ENUMS(OUT2L, MADERA_OUT2LMIX_INPUT_1_SOURCE); 603MADERA_MIXER_ENUMS(OUT2R, MADERA_OUT2RMIX_INPUT_1_SOURCE); 604MADERA_MIXER_ENUMS(OUT3L, MADERA_OUT3LMIX_INPUT_1_SOURCE); 605MADERA_MIXER_ENUMS(OUT3R, MADERA_OUT3RMIX_INPUT_1_SOURCE); 606MADERA_MIXER_ENUMS(SPKDAT1L, MADERA_OUT5LMIX_INPUT_1_SOURCE); 607MADERA_MIXER_ENUMS(SPKDAT1R, MADERA_OUT5RMIX_INPUT_1_SOURCE); 608 609MADERA_MIXER_ENUMS(AIF1TX1, MADERA_AIF1TX1MIX_INPUT_1_SOURCE); 610MADERA_MIXER_ENUMS(AIF1TX2, MADERA_AIF1TX2MIX_INPUT_1_SOURCE); 611MADERA_MIXER_ENUMS(AIF1TX3, MADERA_AIF1TX3MIX_INPUT_1_SOURCE); 612MADERA_MIXER_ENUMS(AIF1TX4, MADERA_AIF1TX4MIX_INPUT_1_SOURCE); 613MADERA_MIXER_ENUMS(AIF1TX5, MADERA_AIF1TX5MIX_INPUT_1_SOURCE); 614MADERA_MIXER_ENUMS(AIF1TX6, MADERA_AIF1TX6MIX_INPUT_1_SOURCE); 615MADERA_MIXER_ENUMS(AIF1TX7, MADERA_AIF1TX7MIX_INPUT_1_SOURCE); 616MADERA_MIXER_ENUMS(AIF1TX8, MADERA_AIF1TX8MIX_INPUT_1_SOURCE); 617 618MADERA_MIXER_ENUMS(AIF2TX1, MADERA_AIF2TX1MIX_INPUT_1_SOURCE); 619MADERA_MIXER_ENUMS(AIF2TX2, MADERA_AIF2TX2MIX_INPUT_1_SOURCE); 620MADERA_MIXER_ENUMS(AIF2TX3, MADERA_AIF2TX3MIX_INPUT_1_SOURCE); 621MADERA_MIXER_ENUMS(AIF2TX4, MADERA_AIF2TX4MIX_INPUT_1_SOURCE); 622MADERA_MIXER_ENUMS(AIF2TX5, MADERA_AIF2TX5MIX_INPUT_1_SOURCE); 623MADERA_MIXER_ENUMS(AIF2TX6, MADERA_AIF2TX6MIX_INPUT_1_SOURCE); 624MADERA_MIXER_ENUMS(AIF2TX7, MADERA_AIF2TX7MIX_INPUT_1_SOURCE); 625MADERA_MIXER_ENUMS(AIF2TX8, MADERA_AIF2TX8MIX_INPUT_1_SOURCE); 626 627MADERA_MIXER_ENUMS(AIF3TX1, MADERA_AIF3TX1MIX_INPUT_1_SOURCE); 628MADERA_MIXER_ENUMS(AIF3TX2, MADERA_AIF3TX2MIX_INPUT_1_SOURCE); 629 630MADERA_MIXER_ENUMS(AIF4TX1, MADERA_AIF4TX1MIX_INPUT_1_SOURCE); 631MADERA_MIXER_ENUMS(AIF4TX2, MADERA_AIF4TX2MIX_INPUT_1_SOURCE); 632 633MADERA_MIXER_ENUMS(SLIMTX1, MADERA_SLIMTX1MIX_INPUT_1_SOURCE); 634MADERA_MIXER_ENUMS(SLIMTX2, MADERA_SLIMTX2MIX_INPUT_1_SOURCE); 635MADERA_MIXER_ENUMS(SLIMTX3, MADERA_SLIMTX3MIX_INPUT_1_SOURCE); 636MADERA_MIXER_ENUMS(SLIMTX4, MADERA_SLIMTX4MIX_INPUT_1_SOURCE); 637MADERA_MIXER_ENUMS(SLIMTX5, MADERA_SLIMTX5MIX_INPUT_1_SOURCE); 638MADERA_MIXER_ENUMS(SLIMTX6, MADERA_SLIMTX6MIX_INPUT_1_SOURCE); 639MADERA_MIXER_ENUMS(SLIMTX7, MADERA_SLIMTX7MIX_INPUT_1_SOURCE); 640MADERA_MIXER_ENUMS(SLIMTX8, MADERA_SLIMTX8MIX_INPUT_1_SOURCE); 641 642MADERA_MUX_ENUMS(SPD1TX1, MADERA_SPDIF1TX1MIX_INPUT_1_SOURCE); 643MADERA_MUX_ENUMS(SPD1TX2, MADERA_SPDIF1TX2MIX_INPUT_1_SOURCE); 644 645MADERA_MUX_ENUMS(ASRC1IN1L, MADERA_ASRC1_1LMIX_INPUT_1_SOURCE); 646MADERA_MUX_ENUMS(ASRC1IN1R, MADERA_ASRC1_1RMIX_INPUT_1_SOURCE); 647MADERA_MUX_ENUMS(ASRC1IN2L, MADERA_ASRC1_2LMIX_INPUT_1_SOURCE); 648MADERA_MUX_ENUMS(ASRC1IN2R, MADERA_ASRC1_2RMIX_INPUT_1_SOURCE); 649MADERA_MUX_ENUMS(ASRC2IN1L, MADERA_ASRC2_1LMIX_INPUT_1_SOURCE); 650MADERA_MUX_ENUMS(ASRC2IN1R, MADERA_ASRC2_1RMIX_INPUT_1_SOURCE); 651MADERA_MUX_ENUMS(ASRC2IN2L, MADERA_ASRC2_2LMIX_INPUT_1_SOURCE); 652MADERA_MUX_ENUMS(ASRC2IN2R, MADERA_ASRC2_2RMIX_INPUT_1_SOURCE); 653 654MADERA_MUX_ENUMS(ISRC1INT1, MADERA_ISRC1INT1MIX_INPUT_1_SOURCE); 655MADERA_MUX_ENUMS(ISRC1INT2, MADERA_ISRC1INT2MIX_INPUT_1_SOURCE); 656MADERA_MUX_ENUMS(ISRC1INT3, MADERA_ISRC1INT3MIX_INPUT_1_SOURCE); 657MADERA_MUX_ENUMS(ISRC1INT4, MADERA_ISRC1INT4MIX_INPUT_1_SOURCE); 658 659MADERA_MUX_ENUMS(ISRC1DEC1, MADERA_ISRC1DEC1MIX_INPUT_1_SOURCE); 660MADERA_MUX_ENUMS(ISRC1DEC2, MADERA_ISRC1DEC2MIX_INPUT_1_SOURCE); 661MADERA_MUX_ENUMS(ISRC1DEC3, MADERA_ISRC1DEC3MIX_INPUT_1_SOURCE); 662MADERA_MUX_ENUMS(ISRC1DEC4, MADERA_ISRC1DEC4MIX_INPUT_1_SOURCE); 663 664MADERA_MUX_ENUMS(ISRC2INT1, MADERA_ISRC2INT1MIX_INPUT_1_SOURCE); 665MADERA_MUX_ENUMS(ISRC2INT2, MADERA_ISRC2INT2MIX_INPUT_1_SOURCE); 666MADERA_MUX_ENUMS(ISRC2INT3, MADERA_ISRC2INT3MIX_INPUT_1_SOURCE); 667MADERA_MUX_ENUMS(ISRC2INT4, MADERA_ISRC2INT4MIX_INPUT_1_SOURCE); 668 669MADERA_MUX_ENUMS(ISRC2DEC1, MADERA_ISRC2DEC1MIX_INPUT_1_SOURCE); 670MADERA_MUX_ENUMS(ISRC2DEC2, MADERA_ISRC2DEC2MIX_INPUT_1_SOURCE); 671MADERA_MUX_ENUMS(ISRC2DEC3, MADERA_ISRC2DEC3MIX_INPUT_1_SOURCE); 672MADERA_MUX_ENUMS(ISRC2DEC4, MADERA_ISRC2DEC4MIX_INPUT_1_SOURCE); 673 674MADERA_MUX_ENUMS(ISRC3INT1, MADERA_ISRC3INT1MIX_INPUT_1_SOURCE); 675MADERA_MUX_ENUMS(ISRC3INT2, MADERA_ISRC3INT2MIX_INPUT_1_SOURCE); 676 677MADERA_MUX_ENUMS(ISRC3DEC1, MADERA_ISRC3DEC1MIX_INPUT_1_SOURCE); 678MADERA_MUX_ENUMS(ISRC3DEC2, MADERA_ISRC3DEC2MIX_INPUT_1_SOURCE); 679 680MADERA_MUX_ENUMS(ISRC4INT1, MADERA_ISRC4INT1MIX_INPUT_1_SOURCE); 681MADERA_MUX_ENUMS(ISRC4INT2, MADERA_ISRC4INT2MIX_INPUT_1_SOURCE); 682 683MADERA_MUX_ENUMS(ISRC4DEC1, MADERA_ISRC4DEC1MIX_INPUT_1_SOURCE); 684MADERA_MUX_ENUMS(ISRC4DEC2, MADERA_ISRC4DEC2MIX_INPUT_1_SOURCE); 685 686MADERA_MUX_ENUMS(DFC1, MADERA_DFC1MIX_INPUT_1_SOURCE); 687MADERA_MUX_ENUMS(DFC2, MADERA_DFC2MIX_INPUT_1_SOURCE); 688MADERA_MUX_ENUMS(DFC3, MADERA_DFC3MIX_INPUT_1_SOURCE); 689MADERA_MUX_ENUMS(DFC4, MADERA_DFC4MIX_INPUT_1_SOURCE); 690MADERA_MUX_ENUMS(DFC5, MADERA_DFC5MIX_INPUT_1_SOURCE); 691MADERA_MUX_ENUMS(DFC6, MADERA_DFC6MIX_INPUT_1_SOURCE); 692MADERA_MUX_ENUMS(DFC7, MADERA_DFC7MIX_INPUT_1_SOURCE); 693MADERA_MUX_ENUMS(DFC8, MADERA_DFC8MIX_INPUT_1_SOURCE); 694 695static const char * const cs47l90_aec_loopback_texts[] = { 696 "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R", 697 "SPKDAT1L", "SPKDAT1R", 698}; 699 700static const unsigned int cs47l90_aec_loopback_values[] = { 701 0, 1, 2, 3, 4, 5, 8, 9, 702}; 703 704static const struct soc_enum cs47l90_aec1_loopback = 705 SOC_VALUE_ENUM_SINGLE(MADERA_DAC_AEC_CONTROL_1, 706 MADERA_AEC1_LOOPBACK_SRC_SHIFT, 0xf, 707 ARRAY_SIZE(cs47l90_aec_loopback_texts), 708 cs47l90_aec_loopback_texts, 709 cs47l90_aec_loopback_values); 710 711static const struct soc_enum cs47l90_aec2_loopback = 712 SOC_VALUE_ENUM_SINGLE(MADERA_DAC_AEC_CONTROL_2, 713 MADERA_AEC2_LOOPBACK_SRC_SHIFT, 0xf, 714 ARRAY_SIZE(cs47l90_aec_loopback_texts), 715 cs47l90_aec_loopback_texts, 716 cs47l90_aec_loopback_values); 717 718static const struct snd_kcontrol_new cs47l90_aec_loopback_mux[] = { 719 SOC_DAPM_ENUM("AEC1 Loopback", cs47l90_aec1_loopback), 720 SOC_DAPM_ENUM("AEC2 Loopback", cs47l90_aec2_loopback), 721}; 722 723static const struct snd_kcontrol_new cs47l90_anc_input_mux[] = { 724 SOC_DAPM_ENUM("RXANCL Input", madera_anc_input_src[0]), 725 SOC_DAPM_ENUM("RXANCL Channel", madera_anc_input_src[1]), 726 SOC_DAPM_ENUM("RXANCR Input", madera_anc_input_src[2]), 727 SOC_DAPM_ENUM("RXANCR Channel", madera_anc_input_src[3]), 728}; 729 730static const struct snd_kcontrol_new cs47l90_anc_ng_mux = 731 SOC_DAPM_ENUM("RXANC NG Source", madera_anc_ng_enum); 732 733static const struct snd_kcontrol_new cs47l90_output_anc_src[] = { 734 SOC_DAPM_ENUM("HPOUT1L ANC Source", madera_output_anc_src[0]), 735 SOC_DAPM_ENUM("HPOUT1R ANC Source", madera_output_anc_src[1]), 736 SOC_DAPM_ENUM("HPOUT2L ANC Source", madera_output_anc_src[2]), 737 SOC_DAPM_ENUM("HPOUT2R ANC Source", madera_output_anc_src[3]), 738 SOC_DAPM_ENUM("HPOUT3L ANC Source", madera_output_anc_src[4]), 739 SOC_DAPM_ENUM("HPOUT3R ANC Source", madera_output_anc_src[0]), 740 SOC_DAPM_ENUM("SPKDAT1L ANC Source", madera_output_anc_src[8]), 741 SOC_DAPM_ENUM("SPKDAT1R ANC Source", madera_output_anc_src[9]), 742}; 743 744static const struct snd_soc_dapm_widget cs47l90_dapm_widgets[] = { 745SND_SOC_DAPM_SUPPLY("SYSCLK", MADERA_SYSTEM_CLOCK_1, MADERA_SYSCLK_ENA_SHIFT, 746 0, madera_sysclk_ev, 747 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | 748 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD), 749SND_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), 752SND_SOC_DAPM_SUPPLY("OPCLK", MADERA_OUTPUT_SYSTEM_CLOCK, 753 MADERA_OPCLK_ENA_SHIFT, 0, NULL, 0), 754SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", MADERA_OUTPUT_ASYNC_CLOCK, 755 MADERA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0), 756SND_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 760SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0), 761SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD3", 0, 0), 762SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD4", 0, 0), 763SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD1", 20, 0), 764SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD2", 20, 0), 765SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS), 766 767SND_SOC_DAPM_SUPPLY("MICBIAS1", MADERA_MIC_BIAS_CTRL_1, 768 MADERA_MICB1_ENA_SHIFT, 0, NULL, 0), 769SND_SOC_DAPM_SUPPLY("MICBIAS2", MADERA_MIC_BIAS_CTRL_2, 770 MADERA_MICB1_ENA_SHIFT, 0, NULL, 0), 771 772SND_SOC_DAPM_SUPPLY("MICBIAS1A", MADERA_MIC_BIAS_CTRL_5, 773 MADERA_MICB1A_ENA_SHIFT, 0, NULL, 0), 774SND_SOC_DAPM_SUPPLY("MICBIAS1B", MADERA_MIC_BIAS_CTRL_5, 775 MADERA_MICB1B_ENA_SHIFT, 0, NULL, 0), 776SND_SOC_DAPM_SUPPLY("MICBIAS1C", MADERA_MIC_BIAS_CTRL_5, 777 MADERA_MICB1C_ENA_SHIFT, 0, NULL, 0), 778SND_SOC_DAPM_SUPPLY("MICBIAS1D", MADERA_MIC_BIAS_CTRL_5, 779 MADERA_MICB1D_ENA_SHIFT, 0, NULL, 0), 780 781SND_SOC_DAPM_SUPPLY("MICBIAS2A", MADERA_MIC_BIAS_CTRL_6, 782 MADERA_MICB2A_ENA_SHIFT, 0, NULL, 0), 783SND_SOC_DAPM_SUPPLY("MICBIAS2B", MADERA_MIC_BIAS_CTRL_6, 784 MADERA_MICB2B_ENA_SHIFT, 0, NULL, 0), 785SND_SOC_DAPM_SUPPLY("MICBIAS2C", MADERA_MIC_BIAS_CTRL_6, 786 MADERA_MICB2C_ENA_SHIFT, 0, NULL, 0), 787SND_SOC_DAPM_SUPPLY("MICBIAS2D", MADERA_MIC_BIAS_CTRL_6, 788 MADERA_MICB2D_ENA_SHIFT, 0, NULL, 0), 789 790SND_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), 794SND_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), 798SND_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), 802SND_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), 806SND_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), 810SND_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), 814SND_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), 818SND_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), 822SND_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), 826SND_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), 830SND_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), 834SND_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), 838SND_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), 842SND_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), 846SND_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), 850SND_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), 854SND_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), 858SND_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), 862SND_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), 866SND_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), 870SND_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), 874SND_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), 878SND_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 883SND_SOC_DAPM_SIGGEN("TONE"), 884SND_SOC_DAPM_SIGGEN("NOISE"), 885 886SND_SOC_DAPM_INPUT("IN1ALN"), 887SND_SOC_DAPM_INPUT("IN1ALP"), 888SND_SOC_DAPM_INPUT("IN1BLN"), 889SND_SOC_DAPM_INPUT("IN1BLP"), 890SND_SOC_DAPM_INPUT("IN1ARN"), 891SND_SOC_DAPM_INPUT("IN1ARP"), 892SND_SOC_DAPM_INPUT("IN1BRN"), 893SND_SOC_DAPM_INPUT("IN1BRP"), 894SND_SOC_DAPM_INPUT("IN2ALN"), 895SND_SOC_DAPM_INPUT("IN2ALP"), 896SND_SOC_DAPM_INPUT("IN2BLN"), 897SND_SOC_DAPM_INPUT("IN2BLP"), 898SND_SOC_DAPM_INPUT("IN2RN"), 899SND_SOC_DAPM_INPUT("IN2RP"), 900SND_SOC_DAPM_INPUT("DMICCLK3"), 901SND_SOC_DAPM_INPUT("DMICDAT3"), 902SND_SOC_DAPM_INPUT("DMICCLK4"), 903SND_SOC_DAPM_INPUT("DMICDAT4"), 904SND_SOC_DAPM_INPUT("DMICCLK5"), 905SND_SOC_DAPM_INPUT("DMICDAT5"), 906 907SND_SOC_DAPM_MUX("IN1L Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[0]), 908SND_SOC_DAPM_MUX("IN1R Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[1]), 909SND_SOC_DAPM_MUX("IN2L Analog Mux", SND_SOC_NOPM, 0, 0, &madera_inmux[2]), 910 911SND_SOC_DAPM_MUX("IN1L Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[0]), 912SND_SOC_DAPM_MUX("IN1R Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[0]), 913 914SND_SOC_DAPM_MUX("IN2L Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[1]), 915SND_SOC_DAPM_MUX("IN2R Mode", SND_SOC_NOPM, 0, 0, &madera_inmode[1]), 916 917SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"), 918SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"), 919 920SND_SOC_DAPM_OUTPUT("DSP Trigger Out"), 921 922SND_SOC_DAPM_PGA("PWM1 Driver", MADERA_PWM_DRIVE_1, MADERA_PWM1_ENA_SHIFT, 923 0, NULL, 0), 924SND_SOC_DAPM_PGA("PWM2 Driver", MADERA_PWM_DRIVE_1, MADERA_PWM2_ENA_SHIFT, 925 0, NULL, 0), 926 927SND_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), 930SND_SOC_DAPM_PGA("RXANCL NG External", SND_SOC_NOPM, 0, 0, NULL, 0), 931SND_SOC_DAPM_PGA("RXANCR NG External", SND_SOC_NOPM, 0, 0, NULL, 0), 932 933SND_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), 936SND_SOC_DAPM_PGA("RXANCL NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0), 937SND_SOC_DAPM_PGA("RXANCR NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0), 938 939SND_SOC_DAPM_MUX("RXANCL Left Input", SND_SOC_NOPM, 0, 0, 940 &cs47l90_anc_input_mux[0]), 941SND_SOC_DAPM_MUX("RXANCL Right Input", SND_SOC_NOPM, 0, 0, 942 &cs47l90_anc_input_mux[0]), 943SND_SOC_DAPM_MUX("RXANCL Channel", SND_SOC_NOPM, 0, 0, 944 &cs47l90_anc_input_mux[1]), 945SND_SOC_DAPM_MUX("RXANCL NG Mux", SND_SOC_NOPM, 0, 0, &cs47l90_anc_ng_mux), 946SND_SOC_DAPM_MUX("RXANCR Left Input", SND_SOC_NOPM, 0, 0, 947 &cs47l90_anc_input_mux[2]), 948SND_SOC_DAPM_MUX("RXANCR Right Input", SND_SOC_NOPM, 0, 0, 949 &cs47l90_anc_input_mux[2]), 950SND_SOC_DAPM_MUX("RXANCR Channel", SND_SOC_NOPM, 0, 0, 951 &cs47l90_anc_input_mux[3]), 952SND_SOC_DAPM_MUX("RXANCR NG Mux", SND_SOC_NOPM, 0, 0, &cs47l90_anc_ng_mux), 953 954SND_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), 957SND_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 961SND_SOC_DAPM_MUX("HPOUT1L ANC Source", SND_SOC_NOPM, 0, 0, 962 &cs47l90_output_anc_src[0]), 963SND_SOC_DAPM_MUX("HPOUT1R ANC Source", SND_SOC_NOPM, 0, 0, 964 &cs47l90_output_anc_src[1]), 965SND_SOC_DAPM_MUX("HPOUT2L ANC Source", SND_SOC_NOPM, 0, 0, 966 &cs47l90_output_anc_src[2]), 967SND_SOC_DAPM_MUX("HPOUT2R ANC Source", SND_SOC_NOPM, 0, 0, 968 &cs47l90_output_anc_src[3]), 969SND_SOC_DAPM_MUX("HPOUT3L ANC Source", SND_SOC_NOPM, 0, 0, 970 &cs47l90_output_anc_src[4]), 971SND_SOC_DAPM_MUX("HPOUT3R ANC Source", SND_SOC_NOPM, 0, 0, 972 &cs47l90_output_anc_src[5]), 973SND_SOC_DAPM_MUX("SPKDAT1L ANC Source", SND_SOC_NOPM, 0, 0, 974 &cs47l90_output_anc_src[6]), 975SND_SOC_DAPM_MUX("SPKDAT1R ANC Source", SND_SOC_NOPM, 0, 0, 976 &cs47l90_output_anc_src[7]), 977 978SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0, 979 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX1_ENA_SHIFT, 0), 980SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 1, 981 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX2_ENA_SHIFT, 0), 982SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 2, 983 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX3_ENA_SHIFT, 0), 984SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 3, 985 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX4_ENA_SHIFT, 0), 986SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 4, 987 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX5_ENA_SHIFT, 0), 988SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 5, 989 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX6_ENA_SHIFT, 0), 990SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 6, 991 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX7_ENA_SHIFT, 0), 992SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 7, 993 MADERA_AIF1_TX_ENABLES, MADERA_AIF1TX8_ENA_SHIFT, 0), 994 995SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0, 996 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX1_ENA_SHIFT, 0), 997SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 1, 998 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX2_ENA_SHIFT, 0), 999SND_SOC_DAPM_AIF_OUT("AIF2TX3", NULL, 2, 1000 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX3_ENA_SHIFT, 0), 1001SND_SOC_DAPM_AIF_OUT("AIF2TX4", NULL, 3, 1002 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX4_ENA_SHIFT, 0), 1003SND_SOC_DAPM_AIF_OUT("AIF2TX5", NULL, 4, 1004 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX5_ENA_SHIFT, 0), 1005SND_SOC_DAPM_AIF_OUT("AIF2TX6", NULL, 5, 1006 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX6_ENA_SHIFT, 0), 1007SND_SOC_DAPM_AIF_OUT("AIF2TX7", NULL, 6, 1008 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX7_ENA_SHIFT, 0), 1009SND_SOC_DAPM_AIF_OUT("AIF2TX8", NULL, 7, 1010 MADERA_AIF2_TX_ENABLES, MADERA_AIF2TX8_ENA_SHIFT, 0), 1011 1012SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0, 1013 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1014 MADERA_SLIMTX1_ENA_SHIFT, 0), 1015SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 1, 1016 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1017 MADERA_SLIMTX2_ENA_SHIFT, 0), 1018SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 2, 1019 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1020 MADERA_SLIMTX3_ENA_SHIFT, 0), 1021SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 3, 1022 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1023 MADERA_SLIMTX4_ENA_SHIFT, 0), 1024SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 4, 1025 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1026 MADERA_SLIMTX5_ENA_SHIFT, 0), 1027SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 5, 1028 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1029 MADERA_SLIMTX6_ENA_SHIFT, 0), 1030SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 6, 1031 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1032 MADERA_SLIMTX7_ENA_SHIFT, 0), 1033SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 7, 1034 MADERA_SLIMBUS_TX_CHANNEL_ENABLE, 1035 MADERA_SLIMTX8_ENA_SHIFT, 0), 1036 1037SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0, 1038 MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX1_ENA_SHIFT, 0), 1039SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 1, 1040 MADERA_AIF3_TX_ENABLES, MADERA_AIF3TX2_ENA_SHIFT, 0), 1041 1042SND_SOC_DAPM_AIF_OUT("AIF4TX1", NULL, 0, 1043 MADERA_AIF4_TX_ENABLES, MADERA_AIF4TX1_ENA_SHIFT, 0), 1044SND_SOC_DAPM_AIF_OUT("AIF4TX2", NULL, 1, 1045 MADERA_AIF4_TX_ENABLES, MADERA_AIF4TX2_ENA_SHIFT, 0), 1046 1047SND_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), 1051SND_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), 1055SND_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), 1059SND_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), 1063SND_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), 1067SND_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), 1071SND_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), 1074SND_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 1078SND_SOC_DAPM_PGA("SPD1TX1", MADERA_SPD1_TX_CONTROL, 1079 MADERA_SPD1_VAL1_SHIFT, 0, NULL, 0), 1080SND_SOC_DAPM_PGA("SPD1TX2", MADERA_SPD1_TX_CONTROL, 1081 MADERA_SPD1_VAL2_SHIFT, 0, NULL, 0), 1082SND_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 1090SND_SOC_DAPM_PGA("Noise Generator", MADERA_COMFORT_NOISE_GENERATOR, 1091 MADERA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0), 1092 1093SND_SOC_DAPM_PGA("Tone Generator 1", MADERA_TONE_GENERATOR_1, 1094 MADERA_TONE1_ENA_SHIFT, 0, NULL, 0), 1095SND_SOC_DAPM_PGA("Tone Generator 2", MADERA_TONE_GENERATOR_1, 1096 MADERA_TONE2_ENA_SHIFT, 0, NULL, 0), 1097 1098SND_SOC_DAPM_SIGGEN("HAPTICS"), 1099 1100SND_SOC_DAPM_MUX("AEC1 Loopback", MADERA_DAC_AEC_CONTROL_1, 1101 MADERA_AEC1_LOOPBACK_ENA_SHIFT, 0, 1102 &cs47l90_aec_loopback_mux[0]), 1103SND_SOC_DAPM_MUX("AEC2 Loopback", MADERA_DAC_AEC_CONTROL_2, 1104 MADERA_AEC2_LOOPBACK_ENA_SHIFT, 0, 1105 &cs47l90_aec_loopback_mux[1]), 1106 1107SND_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), 1111SND_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), 1115SND_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), 1119SND_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), 1123SND_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), 1127SND_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), 1131SND_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), 1135SND_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), 1139SND_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), 1143SND_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 1148SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0, 1149 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX1_ENA_SHIFT, 0), 1150SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 1, 1151 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX2_ENA_SHIFT, 0), 1152SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 2, 1153 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX3_ENA_SHIFT, 0), 1154SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 3, 1155 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX4_ENA_SHIFT, 0), 1156SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 4, 1157 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX5_ENA_SHIFT, 0), 1158SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 5, 1159 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX6_ENA_SHIFT, 0), 1160SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 6, 1161 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX7_ENA_SHIFT, 0), 1162SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 7, 1163 MADERA_AIF1_RX_ENABLES, MADERA_AIF1RX8_ENA_SHIFT, 0), 1164 1165SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0, 1166 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX1_ENA_SHIFT, 0), 1167SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 1, 1168 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX2_ENA_SHIFT, 0), 1169SND_SOC_DAPM_AIF_IN("AIF2RX3", NULL, 2, 1170 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX3_ENA_SHIFT, 0), 1171SND_SOC_DAPM_AIF_IN("AIF2RX4", NULL, 3, 1172 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX4_ENA_SHIFT, 0), 1173SND_SOC_DAPM_AIF_IN("AIF2RX5", NULL, 4, 1174 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX5_ENA_SHIFT, 0), 1175SND_SOC_DAPM_AIF_IN("AIF2RX6", NULL, 5, 1176 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX6_ENA_SHIFT, 0), 1177SND_SOC_DAPM_AIF_IN("AIF2RX7", NULL, 6, 1178 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX7_ENA_SHIFT, 0), 1179SND_SOC_DAPM_AIF_IN("AIF2RX8", NULL, 7, 1180 MADERA_AIF2_RX_ENABLES, MADERA_AIF2RX8_ENA_SHIFT, 0), 1181 1182SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0, 1183 MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX1_ENA_SHIFT, 0), 1184SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 1, 1185 MADERA_AIF3_RX_ENABLES, MADERA_AIF3RX2_ENA_SHIFT, 0), 1186 1187SND_SOC_DAPM_AIF_IN("AIF4RX1", NULL, 0, 1188 MADERA_AIF4_RX_ENABLES, MADERA_AIF4RX1_ENA_SHIFT, 0), 1189SND_SOC_DAPM_AIF_IN("AIF4RX2", NULL, 1, 1190 MADERA_AIF4_RX_ENABLES, MADERA_AIF4RX2_ENA_SHIFT, 0), 1191 1192SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1193 MADERA_SLIMRX1_ENA_SHIFT, 0), 1194SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 1, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1195 MADERA_SLIMRX2_ENA_SHIFT, 0), 1196SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 2, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1197 MADERA_SLIMRX3_ENA_SHIFT, 0), 1198SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 3, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1199 MADERA_SLIMRX4_ENA_SHIFT, 0), 1200SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 4, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1201 MADERA_SLIMRX5_ENA_SHIFT, 0), 1202SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 5, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1203 MADERA_SLIMRX6_ENA_SHIFT, 0), 1204SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 6, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1205 MADERA_SLIMRX7_ENA_SHIFT, 0), 1206SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 7, MADERA_SLIMBUS_RX_CHANNEL_ENABLE, 1207 MADERA_SLIMRX8_ENA_SHIFT, 0), 1208 1209SND_SOC_DAPM_PGA("EQ1", MADERA_EQ1_1, MADERA_EQ1_ENA_SHIFT, 0, NULL, 0), 1210SND_SOC_DAPM_PGA("EQ2", MADERA_EQ2_1, MADERA_EQ2_ENA_SHIFT, 0, NULL, 0), 1211SND_SOC_DAPM_PGA("EQ3", MADERA_EQ3_1, MADERA_EQ3_ENA_SHIFT, 0, NULL, 0), 1212SND_SOC_DAPM_PGA("EQ4", MADERA_EQ4_1, MADERA_EQ4_ENA_SHIFT, 0, NULL, 0), 1213 1214SND_SOC_DAPM_PGA("DRC1L", MADERA_DRC1_CTRL1, MADERA_DRC1L_ENA_SHIFT, 0, 1215 NULL, 0), 1216SND_SOC_DAPM_PGA("DRC1R", MADERA_DRC1_CTRL1, MADERA_DRC1R_ENA_SHIFT, 0, 1217 NULL, 0), 1218SND_SOC_DAPM_PGA("DRC2L", MADERA_DRC2_CTRL1, MADERA_DRC2L_ENA_SHIFT, 0, 1219 NULL, 0), 1220SND_SOC_DAPM_PGA("DRC2R", MADERA_DRC2_CTRL1, MADERA_DRC2R_ENA_SHIFT, 0, 1221 NULL, 0), 1222 1223SND_SOC_DAPM_PGA("LHPF1", MADERA_HPLPF1_1, MADERA_LHPF1_ENA_SHIFT, 0, 1224 NULL, 0), 1225SND_SOC_DAPM_PGA("LHPF2", MADERA_HPLPF2_1, MADERA_LHPF2_ENA_SHIFT, 0, 1226 NULL, 0), 1227SND_SOC_DAPM_PGA("LHPF3", MADERA_HPLPF3_1, MADERA_LHPF3_ENA_SHIFT, 0, 1228 NULL, 0), 1229SND_SOC_DAPM_PGA("LHPF4", MADERA_HPLPF4_1, MADERA_LHPF4_ENA_SHIFT, 0, 1230 NULL, 0), 1231 1232SND_SOC_DAPM_PGA("ASRC1IN1L", MADERA_ASRC1_ENABLE, 1233 MADERA_ASRC1_IN1L_ENA_SHIFT, 0, NULL, 0), 1234SND_SOC_DAPM_PGA("ASRC1IN1R", MADERA_ASRC1_ENABLE, 1235 MADERA_ASRC1_IN1R_ENA_SHIFT, 0, NULL, 0), 1236SND_SOC_DAPM_PGA("ASRC1IN2L", MADERA_ASRC1_ENABLE, 1237 MADERA_ASRC1_IN2L_ENA_SHIFT, 0, NULL, 0), 1238SND_SOC_DAPM_PGA("ASRC1IN2R", MADERA_ASRC1_ENABLE, 1239 MADERA_ASRC1_IN2R_ENA_SHIFT, 0, NULL, 0), 1240 1241SND_SOC_DAPM_PGA("ASRC2IN1L", MADERA_ASRC2_ENABLE, 1242 MADERA_ASRC2_IN1L_ENA_SHIFT, 0, NULL, 0), 1243SND_SOC_DAPM_PGA("ASRC2IN1R", MADERA_ASRC2_ENABLE, 1244 MADERA_ASRC2_IN1R_ENA_SHIFT, 0, NULL, 0), 1245SND_SOC_DAPM_PGA("ASRC2IN2L", MADERA_ASRC2_ENABLE, 1246 MADERA_ASRC2_IN2L_ENA_SHIFT, 0, NULL, 0), 1247SND_SOC_DAPM_PGA("ASRC2IN2R", MADERA_ASRC2_ENABLE, 1248 MADERA_ASRC2_IN2R_ENA_SHIFT, 0, NULL, 0), 1249 1250SND_SOC_DAPM_PGA("ISRC1DEC1", MADERA_ISRC_1_CTRL_3, 1251 MADERA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0), 1252SND_SOC_DAPM_PGA("ISRC1DEC2", MADERA_ISRC_1_CTRL_3, 1253 MADERA_ISRC1_DEC2_ENA_SHIFT, 0, NULL, 0), 1254SND_SOC_DAPM_PGA("ISRC1DEC3", MADERA_ISRC_1_CTRL_3, 1255 MADERA_ISRC1_DEC3_ENA_SHIFT, 0, NULL, 0), 1256SND_SOC_DAPM_PGA("ISRC1DEC4", MADERA_ISRC_1_CTRL_3, 1257 MADERA_ISRC1_DEC4_ENA_SHIFT, 0, NULL, 0), 1258 1259SND_SOC_DAPM_PGA("ISRC1INT1", MADERA_ISRC_1_CTRL_3, 1260 MADERA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0), 1261SND_SOC_DAPM_PGA("ISRC1INT2", MADERA_ISRC_1_CTRL_3, 1262 MADERA_ISRC1_INT2_ENA_SHIFT, 0, NULL, 0), 1263SND_SOC_DAPM_PGA("ISRC1INT3", MADERA_ISRC_1_CTRL_3, 1264 MADERA_ISRC1_INT3_ENA_SHIFT, 0, NULL, 0), 1265SND_SOC_DAPM_PGA("ISRC1INT4", MADERA_ISRC_1_CTRL_3, 1266 MADERA_ISRC1_INT4_ENA_SHIFT, 0, NULL, 0), 1267 1268SND_SOC_DAPM_PGA("ISRC2DEC1", MADERA_ISRC_2_CTRL_3, 1269 MADERA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0), 1270SND_SOC_DAPM_PGA("ISRC2DEC2", MADERA_ISRC_2_CTRL_3, 1271 MADERA_ISRC2_DEC2_ENA_SHIFT, 0, NULL, 0), 1272SND_SOC_DAPM_PGA("ISRC2DEC3", MADERA_ISRC_2_CTRL_3, 1273 MADERA_ISRC2_DEC3_ENA_SHIFT, 0, NULL, 0), 1274SND_SOC_DAPM_PGA("ISRC2DEC4", MADERA_ISRC_2_CTRL_3, 1275 MADERA_ISRC2_DEC4_ENA_SHIFT, 0, NULL, 0), 1276 1277SND_SOC_DAPM_PGA("ISRC2INT1", MADERA_ISRC_2_CTRL_3, 1278 MADERA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0), 1279SND_SOC_DAPM_PGA("ISRC2INT2", MADERA_ISRC_2_CTRL_3, 1280 MADERA_ISRC2_INT2_ENA_SHIFT, 0, NULL, 0), 1281SND_SOC_DAPM_PGA("ISRC2INT3", MADERA_ISRC_2_CTRL_3, 1282 MADERA_ISRC2_INT3_ENA_SHIFT, 0, NULL, 0), 1283SND_SOC_DAPM_PGA("ISRC2INT4", MADERA_ISRC_2_CTRL_3, 1284 MADERA_ISRC2_INT4_ENA_SHIFT, 0, NULL, 0), 1285 1286SND_SOC_DAPM_PGA("ISRC3DEC1", MADERA_ISRC_3_CTRL_3, 1287 MADERA_ISRC3_DEC1_ENA_SHIFT, 0, NULL, 0), 1288SND_SOC_DAPM_PGA("ISRC3DEC2", MADERA_ISRC_3_CTRL_3, 1289 MADERA_ISRC3_DEC2_ENA_SHIFT, 0, NULL, 0), 1290 1291SND_SOC_DAPM_PGA("ISRC3INT1", MADERA_ISRC_3_CTRL_3, 1292 MADERA_ISRC3_INT1_ENA_SHIFT, 0, NULL, 0), 1293SND_SOC_DAPM_PGA("ISRC3INT2", MADERA_ISRC_3_CTRL_3, 1294 MADERA_ISRC3_INT2_ENA_SHIFT, 0, NULL, 0), 1295 1296SND_SOC_DAPM_PGA("ISRC4DEC1", MADERA_ISRC_4_CTRL_3, 1297 MADERA_ISRC4_DEC1_ENA_SHIFT, 0, NULL, 0), 1298SND_SOC_DAPM_PGA("ISRC4DEC2", MADERA_ISRC_4_CTRL_3, 1299 MADERA_ISRC4_DEC2_ENA_SHIFT, 0, NULL, 0), 1300 1301SND_SOC_DAPM_PGA("ISRC4INT1", MADERA_ISRC_4_CTRL_3, 1302 MADERA_ISRC4_INT1_ENA_SHIFT, 0, NULL, 0), 1303SND_SOC_DAPM_PGA("ISRC4INT2", MADERA_ISRC_4_CTRL_3, 1304 MADERA_ISRC4_INT2_ENA_SHIFT, 0, NULL, 0), 1305 1306WM_ADSP2("DSP1", 0, cs47l90_adsp_power_ev), 1307WM_ADSP2("DSP2", 1, cs47l90_adsp_power_ev), 1308WM_ADSP2("DSP3", 2, cs47l90_adsp_power_ev), 1309WM_ADSP2("DSP4", 3, cs47l90_adsp_power_ev), 1310WM_ADSP2("DSP5", 4, cs47l90_adsp_power_ev), 1311WM_ADSP2("DSP6", 5, cs47l90_adsp_power_ev), 1312WM_ADSP2("DSP7", 6, cs47l90_adsp_power_ev), 1313 1314/* end of ordered widget list */ 1315 1316SND_SOC_DAPM_PGA("DFC1", MADERA_DFC1_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1317SND_SOC_DAPM_PGA("DFC2", MADERA_DFC2_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1318SND_SOC_DAPM_PGA("DFC3", MADERA_DFC3_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1319SND_SOC_DAPM_PGA("DFC4", MADERA_DFC4_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1320SND_SOC_DAPM_PGA("DFC5", MADERA_DFC5_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1321SND_SOC_DAPM_PGA("DFC6", MADERA_DFC6_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1322SND_SOC_DAPM_PGA("DFC7", MADERA_DFC7_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1323SND_SOC_DAPM_PGA("DFC8", MADERA_DFC8_CTRL, MADERA_DFC1_ENA_SHIFT, 0, NULL, 0), 1324 1325MADERA_MIXER_WIDGETS(EQ1, "EQ1"), 1326MADERA_MIXER_WIDGETS(EQ2, "EQ2"), 1327MADERA_MIXER_WIDGETS(EQ3, "EQ3"), 1328MADERA_MIXER_WIDGETS(EQ4, "EQ4"), 1329 1330MADERA_MIXER_WIDGETS(DRC1L, "DRC1L"), 1331MADERA_MIXER_WIDGETS(DRC1R, "DRC1R"), 1332MADERA_MIXER_WIDGETS(DRC2L, "DRC2L"), 1333MADERA_MIXER_WIDGETS(DRC2R, "DRC2R"), 1334 1335SND_SOC_DAPM_SWITCH("DRC1 Activity Output", SND_SOC_NOPM, 0, 0, 1336 &madera_drc_activity_output_mux[0]), 1337SND_SOC_DAPM_SWITCH("DRC2 Activity Output", SND_SOC_NOPM, 0, 0, 1338 &madera_drc_activity_output_mux[1]), 1339 1340MADERA_MIXER_WIDGETS(LHPF1, "LHPF1"), 1341MADERA_MIXER_WIDGETS(LHPF2, "LHPF2"), 1342MADERA_MIXER_WIDGETS(LHPF3, "LHPF3"), 1343MADERA_MIXER_WIDGETS(LHPF4, "LHPF4"), 1344 1345MADERA_MIXER_WIDGETS(PWM1, "PWM1"), 1346MADERA_MIXER_WIDGETS(PWM2, "PWM2"), 1347 1348MADERA_MIXER_WIDGETS(OUT1L, "HPOUT1L"), 1349MADERA_MIXER_WIDGETS(OUT1R, "HPOUT1R"), 1350MADERA_MIXER_WIDGETS(OUT2L, "HPOUT2L"), 1351MADERA_MIXER_WIDGETS(OUT2R, "HPOUT2R"), 1352MADERA_MIXER_WIDGETS(OUT3L, "HPOUT3L"), 1353MADERA_MIXER_WIDGETS(OUT3R, "HPOUT3R"), 1354MADERA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"), 1355MADERA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"), 1356 1357MADERA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"), 1358MADERA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"), 1359MADERA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"), 1360MADERA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"), 1361MADERA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"), 1362MADERA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"), 1363MADERA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"), 1364MADERA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"), 1365 1366MADERA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"), 1367MADERA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"), 1368MADERA_MIXER_WIDGETS(AIF2TX3, "AIF2TX3"), 1369MADERA_MIXER_WIDGETS(AIF2TX4, "AIF2TX4"), 1370MADERA_MIXER_WIDGETS(AIF2TX5, "AIF2TX5"), 1371MADERA_MIXER_WIDGETS(AIF2TX6, "AIF2TX6"), 1372MADERA_MIXER_WIDGETS(AIF2TX7, "AIF2TX7"), 1373MADERA_MIXER_WIDGETS(AIF2TX8, "AIF2TX8"), 1374 1375MADERA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"), 1376MADERA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"), 1377 1378MADERA_MIXER_WIDGETS(AIF4TX1, "AIF4TX1"), 1379MADERA_MIXER_WIDGETS(AIF4TX2, "AIF4TX2"), 1380 1381MADERA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"), 1382MADERA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"), 1383MADERA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"), 1384MADERA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"), 1385MADERA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"), 1386MADERA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"), 1387MADERA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"), 1388MADERA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"), 1389 1390MADERA_MUX_WIDGETS(SPD1TX1, "SPDIF1TX1"), 1391MADERA_MUX_WIDGETS(SPD1TX2, "SPDIF1TX2"), 1392 1393MADERA_MUX_WIDGETS(ASRC1IN1L, "ASRC1IN1L"), 1394MADERA_MUX_WIDGETS(ASRC1IN1R, "ASRC1IN1R"), 1395MADERA_MUX_WIDGETS(ASRC1IN2L, "ASRC1IN2L"), 1396MADERA_MUX_WIDGETS(ASRC1IN2R, "ASRC1IN2R"), 1397MADERA_MUX_WIDGETS(ASRC2IN1L, "ASRC2IN1L"), 1398MADERA_MUX_WIDGETS(ASRC2IN1R, "ASRC2IN1R"), 1399MADERA_MUX_WIDGETS(ASRC2IN2L, "ASRC2IN2L"), 1400MADERA_MUX_WIDGETS(ASRC2IN2R, "ASRC2IN2R"), 1401 1402MADERA_DSP_WIDGETS(DSP1, "DSP1"), 1403MADERA_DSP_WIDGETS(DSP2, "DSP2"), 1404MADERA_DSP_WIDGETS(DSP3, "DSP3"), 1405MADERA_DSP_WIDGETS(DSP4, "DSP4"), 1406MADERA_DSP_WIDGETS(DSP5, "DSP5"), 1407MADERA_DSP_WIDGETS(DSP6, "DSP6"), 1408MADERA_DSP_WIDGETS(DSP7, "DSP7"), 1409 1410SND_SOC_DAPM_SWITCH("DSP1 Trigger Output", SND_SOC_NOPM, 0, 0, 1411 &madera_dsp_trigger_output_mux[0]), 1412SND_SOC_DAPM_SWITCH("DSP2 Trigger Output", SND_SOC_NOPM, 0, 0, 1413 &madera_dsp_trigger_output_mux[1]), 1414SND_SOC_DAPM_SWITCH("DSP3 Trigger Output", SND_SOC_NOPM, 0, 0, 1415 &madera_dsp_trigger_output_mux[2]), 1416SND_SOC_DAPM_SWITCH("DSP4 Trigger Output", SND_SOC_NOPM, 0, 0, 1417 &madera_dsp_trigger_output_mux[3]), 1418SND_SOC_DAPM_SWITCH("DSP5 Trigger Output", SND_SOC_NOPM, 0, 0, 1419 &madera_dsp_trigger_output_mux[4]), 1420SND_SOC_DAPM_SWITCH("DSP6 Trigger Output", SND_SOC_NOPM, 0, 0, 1421 &madera_dsp_trigger_output_mux[5]), 1422SND_SOC_DAPM_SWITCH("DSP7 Trigger Output", SND_SOC_NOPM, 0, 0, 1423 &madera_dsp_trigger_output_mux[6]), 1424 1425MADERA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"), 1426MADERA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"), 1427MADERA_MUX_WIDGETS(ISRC1DEC3, "ISRC1DEC3"), 1428MADERA_MUX_WIDGETS(ISRC1DEC4, "ISRC1DEC4"), 1429 1430MADERA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"), 1431MADERA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"), 1432MADERA_MUX_WIDGETS(ISRC1INT3, "ISRC1INT3"), 1433MADERA_MUX_WIDGETS(ISRC1INT4, "ISRC1INT4"), 1434 1435MADERA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"), 1436MADERA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"), 1437MADERA_MUX_WIDGETS(ISRC2DEC3, "ISRC2DEC3"), 1438MADERA_MUX_WIDGETS(ISRC2DEC4, "ISRC2DEC4"), 1439 1440MADERA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"), 1441MADERA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"), 1442MADERA_MUX_WIDGETS(ISRC2INT3, "ISRC2INT3"), 1443MADERA_MUX_WIDGETS(ISRC2INT4, "ISRC2INT4"), 1444 1445MADERA_MUX_WIDGETS(ISRC3DEC1, "ISRC3DEC1"), 1446MADERA_MUX_WIDGETS(ISRC3DEC2, "ISRC3DEC2"), 1447 1448MADERA_MUX_WIDGETS(ISRC3INT1, "ISRC3INT1"), 1449MADERA_MUX_WIDGETS(ISRC3INT2, "ISRC3INT2"), 1450 1451MADERA_MUX_WIDGETS(ISRC4DEC1, "ISRC4DEC1"), 1452MADERA_MUX_WIDGETS(ISRC4DEC2, "ISRC4DEC2"), 1453 1454MADERA_MUX_WIDGETS(ISRC4INT1, "ISRC4INT1"), 1455MADERA_MUX_WIDGETS(ISRC4INT2, "ISRC4INT2"), 1456 1457MADERA_MUX_WIDGETS(DFC1, "DFC1"), 1458MADERA_MUX_WIDGETS(DFC2, "DFC2"), 1459MADERA_MUX_WIDGETS(DFC3, "DFC3"), 1460MADERA_MUX_WIDGETS(DFC4, "DFC4"), 1461MADERA_MUX_WIDGETS(DFC5, "DFC5"), 1462MADERA_MUX_WIDGETS(DFC6, "DFC6"), 1463MADERA_MUX_WIDGETS(DFC7, "DFC7"), 1464MADERA_MUX_WIDGETS(DFC8, "DFC8"), 1465 1466SND_SOC_DAPM_OUTPUT("HPOUT1L"), 1467SND_SOC_DAPM_OUTPUT("HPOUT1R"), 1468SND_SOC_DAPM_OUTPUT("HPOUT2L"), 1469SND_SOC_DAPM_OUTPUT("HPOUT2R"), 1470SND_SOC_DAPM_OUTPUT("HPOUT3L"), 1471SND_SOC_DAPM_OUTPUT("HPOUT3R"), 1472SND_SOC_DAPM_OUTPUT("SPKDAT1L"), 1473SND_SOC_DAPM_OUTPUT("SPKDAT1R"), 1474SND_SOC_DAPM_OUTPUT("SPDIF1"), 1475 1476SND_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 1619static 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 2145static 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 2171static 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 2361static 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 2384static 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 2413static 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 2448static 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 2464static 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 2475static 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 2485static 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 2503static 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].cs_dsp.num = i + 1; 2547 cs47l90->core.adsp[i].cs_dsp.type = WMFW_ADSP2; 2548 cs47l90->core.adsp[i].cs_dsp.rev = 2; 2549 cs47l90->core.adsp[i].cs_dsp.dev = madera->dev; 2550 cs47l90->core.adsp[i].cs_dsp.regmap = madera->regmap_32bit; 2551 2552 cs47l90->core.adsp[i].cs_dsp.base = cs47l90_dsp_control_bases[i]; 2553 cs47l90->core.adsp[i].cs_dsp.mem = cs47l90_dsp_regions[i]; 2554 cs47l90->core.adsp[i].cs_dsp.num_mems = 2555 ARRAY_SIZE(cs47l90_dsp1_regions); 2556 2557 cs47l90->core.adsp[i].cs_dsp.lock_regions = CS_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 2606error_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 } 2613error_dsp_irq: 2614 madera_set_irq_wake(madera, MADERA_IRQ_DSP_IRQ1, 0); 2615 madera_free_irq(madera, MADERA_IRQ_DSP_IRQ1, cs47l90); 2616error_core: 2617 madera_core_free(&cs47l90->core); 2618 2619 return ret; 2620} 2621 2622static 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 2641static struct platform_driver cs47l90_codec_driver = { 2642 .driver = { 2643 .name = "cs47l90-codec", 2644 }, 2645 .probe = &cs47l90_probe, 2646 .remove = &cs47l90_remove, 2647}; 2648 2649module_platform_driver(cs47l90_codec_driver); 2650 2651MODULE_SOFTDEP("pre: madera irq-madera arizona-micsupp"); 2652MODULE_DESCRIPTION("ASoC CS47L90 driver"); 2653MODULE_AUTHOR("Nikesh Oswal <nikesh@opensource.cirrus.com>"); 2654MODULE_LICENSE("GPL v2"); 2655MODULE_ALIAS("platform:cs47l90-codec");