root/sound/soc/codecs/cs47l90.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. cs47l90_adsp_power_ev
  2. cs47l90_set_fll
  3. cs47l90_open
  4. cs47l90_adsp2_irq
  5. cs47l90_component_probe
  6. cs47l90_component_remove
  7. cs47l90_probe
  8. cs47l90_remove

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

/* [<][>][^][v][top][bottom][index][help] */