Linux Audio

Check our new training course

In-person Linux kernel drivers training

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