xref: /linux/sound/soc/codecs/wm8997.c (revision 12850b8d45cb03239ede6df58ad0022aba3f3dc2)
140843aeaSCharles Keepax /*
240843aeaSCharles Keepax  * wm8997.c  --  WM8997 ALSA SoC Audio driver
340843aeaSCharles Keepax  *
440843aeaSCharles Keepax  * Copyright 2012 Wolfson Microelectronics plc
540843aeaSCharles Keepax  *
640843aeaSCharles Keepax  * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
740843aeaSCharles Keepax  *
840843aeaSCharles Keepax  * This program is free software; you can redistribute it and/or modify
940843aeaSCharles Keepax  * it under the terms of the GNU General Public License version 2 as
1040843aeaSCharles Keepax  * published by the Free Software Foundation.
1140843aeaSCharles Keepax  */
1240843aeaSCharles Keepax 
1340843aeaSCharles Keepax #include <linux/module.h>
1440843aeaSCharles Keepax #include <linux/moduleparam.h>
1540843aeaSCharles Keepax #include <linux/init.h>
1640843aeaSCharles Keepax #include <linux/delay.h>
1740843aeaSCharles Keepax #include <linux/pm.h>
1840843aeaSCharles Keepax #include <linux/pm_runtime.h>
1940843aeaSCharles Keepax #include <linux/regmap.h>
2040843aeaSCharles Keepax #include <linux/slab.h>
2140843aeaSCharles Keepax #include <sound/core.h>
2240843aeaSCharles Keepax #include <sound/pcm.h>
2340843aeaSCharles Keepax #include <sound/pcm_params.h>
2440843aeaSCharles Keepax #include <sound/soc.h>
2540843aeaSCharles Keepax #include <sound/jack.h>
2640843aeaSCharles Keepax #include <sound/initval.h>
2740843aeaSCharles Keepax #include <sound/tlv.h>
2840843aeaSCharles Keepax 
2940843aeaSCharles Keepax #include <linux/mfd/arizona/core.h>
3040843aeaSCharles Keepax #include <linux/mfd/arizona/registers.h>
3140843aeaSCharles Keepax 
3240843aeaSCharles Keepax #include "arizona.h"
3340843aeaSCharles Keepax #include "wm8997.h"
3440843aeaSCharles Keepax 
3540843aeaSCharles Keepax struct wm8997_priv {
3640843aeaSCharles Keepax 	struct arizona_priv core;
3740843aeaSCharles Keepax 	struct arizona_fll fll[2];
3840843aeaSCharles Keepax };
3940843aeaSCharles Keepax 
4040843aeaSCharles Keepax static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
4140843aeaSCharles Keepax static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
4240843aeaSCharles Keepax static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
4340843aeaSCharles Keepax static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0);
4440843aeaSCharles Keepax static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
4540843aeaSCharles Keepax 
4640843aeaSCharles Keepax static const struct reg_default wm8997_sysclk_reva_patch[] = {
4740843aeaSCharles Keepax 	{ 0x301D, 0x7B15 },
4840843aeaSCharles Keepax 	{ 0x301B, 0x0050 },
4940843aeaSCharles Keepax 	{ 0x305D, 0x7B17 },
5040843aeaSCharles Keepax 	{ 0x305B, 0x0050 },
5140843aeaSCharles Keepax 	{ 0x3001, 0x08FE },
5240843aeaSCharles Keepax 	{ 0x3003, 0x00F4 },
5340843aeaSCharles Keepax 	{ 0x3041, 0x08FF },
5440843aeaSCharles Keepax 	{ 0x3043, 0x0005 },
5540843aeaSCharles Keepax 	{ 0x3020, 0x0225 },
5640843aeaSCharles Keepax 	{ 0x3021, 0x0A00 },
5740843aeaSCharles Keepax 	{ 0x3022, 0xE24D },
5840843aeaSCharles Keepax 	{ 0x3023, 0x0800 },
5940843aeaSCharles Keepax 	{ 0x3024, 0xE24D },
6040843aeaSCharles Keepax 	{ 0x3025, 0xF000 },
6140843aeaSCharles Keepax 	{ 0x3060, 0x0226 },
6240843aeaSCharles Keepax 	{ 0x3061, 0x0A00 },
6340843aeaSCharles Keepax 	{ 0x3062, 0xE252 },
6440843aeaSCharles Keepax 	{ 0x3063, 0x0800 },
6540843aeaSCharles Keepax 	{ 0x3064, 0xE252 },
6640843aeaSCharles Keepax 	{ 0x3065, 0xF000 },
6740843aeaSCharles Keepax 	{ 0x3116, 0x022B },
6840843aeaSCharles Keepax 	{ 0x3117, 0xFA00 },
6940843aeaSCharles Keepax 	{ 0x3110, 0x246C },
7040843aeaSCharles Keepax 	{ 0x3111, 0x0A03 },
7140843aeaSCharles Keepax 	{ 0x3112, 0x246E },
7240843aeaSCharles Keepax 	{ 0x3113, 0x0A03 },
7340843aeaSCharles Keepax 	{ 0x3114, 0x2470 },
7440843aeaSCharles Keepax 	{ 0x3115, 0x0A03 },
7540843aeaSCharles Keepax 	{ 0x3126, 0x246C },
7640843aeaSCharles Keepax 	{ 0x3127, 0x0A02 },
7740843aeaSCharles Keepax 	{ 0x3128, 0x246E },
7840843aeaSCharles Keepax 	{ 0x3129, 0x0A02 },
7940843aeaSCharles Keepax 	{ 0x312A, 0x2470 },
8040843aeaSCharles Keepax 	{ 0x312B, 0xFA02 },
8140843aeaSCharles Keepax 	{ 0x3125, 0x0800 },
8240843aeaSCharles Keepax };
8340843aeaSCharles Keepax 
8440843aeaSCharles Keepax static int wm8997_sysclk_ev(struct snd_soc_dapm_widget *w,
8540843aeaSCharles Keepax 			    struct snd_kcontrol *kcontrol, int event)
8640843aeaSCharles Keepax {
8740843aeaSCharles Keepax 	struct snd_soc_codec *codec = w->codec;
8840843aeaSCharles Keepax 	struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
8940843aeaSCharles Keepax 	struct regmap *regmap = codec->control_data;
9040843aeaSCharles Keepax 	const struct reg_default *patch = NULL;
9140843aeaSCharles Keepax 	int i, patch_size;
9240843aeaSCharles Keepax 
9340843aeaSCharles Keepax 	switch (arizona->rev) {
9440843aeaSCharles Keepax 	case 0:
9540843aeaSCharles Keepax 		patch = wm8997_sysclk_reva_patch;
9640843aeaSCharles Keepax 		patch_size = ARRAY_SIZE(wm8997_sysclk_reva_patch);
9740843aeaSCharles Keepax 		break;
9840843aeaSCharles Keepax 	default:
9940843aeaSCharles Keepax 		break;
10040843aeaSCharles Keepax 	}
10140843aeaSCharles Keepax 
10240843aeaSCharles Keepax 	switch (event) {
10340843aeaSCharles Keepax 	case SND_SOC_DAPM_POST_PMU:
10440843aeaSCharles Keepax 		if (patch)
10540843aeaSCharles Keepax 			for (i = 0; i < patch_size; i++)
10640843aeaSCharles Keepax 				regmap_write(regmap, patch[i].reg,
10740843aeaSCharles Keepax 					     patch[i].def);
10840843aeaSCharles Keepax 		break;
10940843aeaSCharles Keepax 	default:
11040843aeaSCharles Keepax 		break;
11140843aeaSCharles Keepax 	}
11240843aeaSCharles Keepax 
11340843aeaSCharles Keepax 	return 0;
11440843aeaSCharles Keepax }
11540843aeaSCharles Keepax 
11640843aeaSCharles Keepax static const char *wm8997_osr_text[] = {
11740843aeaSCharles Keepax 	"Low power", "Normal", "High performance",
11840843aeaSCharles Keepax };
11940843aeaSCharles Keepax 
12040843aeaSCharles Keepax static const unsigned int wm8997_osr_val[] = {
12140843aeaSCharles Keepax 	0x0, 0x3, 0x5,
12240843aeaSCharles Keepax };
12340843aeaSCharles Keepax 
12440843aeaSCharles Keepax static const struct soc_enum wm8997_hpout_osr[] = {
12540843aeaSCharles Keepax 	SOC_VALUE_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_1L,
12640843aeaSCharles Keepax 			      ARIZONA_OUT1_OSR_SHIFT, 0x7, 3,
12740843aeaSCharles Keepax 			      wm8997_osr_text, wm8997_osr_val),
12840843aeaSCharles Keepax 	SOC_VALUE_ENUM_SINGLE(ARIZONA_OUTPUT_PATH_CONFIG_3L,
12940843aeaSCharles Keepax 			      ARIZONA_OUT3_OSR_SHIFT, 0x7, 3,
13040843aeaSCharles Keepax 			      wm8997_osr_text, wm8997_osr_val),
13140843aeaSCharles Keepax };
13240843aeaSCharles Keepax 
13340843aeaSCharles Keepax #define WM8997_NG_SRC(name, base) \
13440843aeaSCharles Keepax 	SOC_SINGLE(name " NG HPOUT1L Switch",  base, 0, 1, 0), \
13540843aeaSCharles Keepax 	SOC_SINGLE(name " NG HPOUT1R Switch",  base, 1, 1, 0), \
13640843aeaSCharles Keepax 	SOC_SINGLE(name " NG EPOUT Switch",    base, 4, 1, 0), \
13740843aeaSCharles Keepax 	SOC_SINGLE(name " NG SPKOUT Switch",   base, 6, 1, 0), \
13840843aeaSCharles Keepax 	SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \
13940843aeaSCharles Keepax 	SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0)
14040843aeaSCharles Keepax 
14140843aeaSCharles Keepax static const struct snd_kcontrol_new wm8997_snd_controls[] = {
14240843aeaSCharles Keepax SOC_SINGLE("IN1 High Performance Switch", ARIZONA_IN1L_CONTROL,
14340843aeaSCharles Keepax 	   ARIZONA_IN1_OSR_SHIFT, 1, 0),
14440843aeaSCharles Keepax SOC_SINGLE("IN2 High Performance Switch", ARIZONA_IN2L_CONTROL,
14540843aeaSCharles Keepax 	   ARIZONA_IN2_OSR_SHIFT, 1, 0),
14640843aeaSCharles Keepax 
14740843aeaSCharles Keepax SOC_SINGLE_RANGE_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL,
14840843aeaSCharles Keepax 		     ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
14940843aeaSCharles Keepax SOC_SINGLE_RANGE_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL,
15040843aeaSCharles Keepax 		     ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
15140843aeaSCharles Keepax SOC_SINGLE_RANGE_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL,
15240843aeaSCharles Keepax 		     ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
15340843aeaSCharles Keepax SOC_SINGLE_RANGE_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL,
15440843aeaSCharles Keepax 		     ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
15540843aeaSCharles Keepax 
15640843aeaSCharles Keepax SOC_SINGLE_TLV("IN1L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1L,
15740843aeaSCharles Keepax 	       ARIZONA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
15840843aeaSCharles Keepax SOC_SINGLE_TLV("IN1R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1R,
15940843aeaSCharles Keepax 	       ARIZONA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
16040843aeaSCharles Keepax SOC_SINGLE_TLV("IN2L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2L,
16140843aeaSCharles Keepax 	       ARIZONA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
16240843aeaSCharles Keepax SOC_SINGLE_TLV("IN2R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2R,
16340843aeaSCharles Keepax 	       ARIZONA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
16440843aeaSCharles Keepax 
16540843aeaSCharles Keepax SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp),
16640843aeaSCharles Keepax SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp),
16740843aeaSCharles Keepax 
16840843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE),
16940843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
17040843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
17140843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
17240843aeaSCharles Keepax 
173*12850b8dSRichard Fitzgerald SND_SOC_BYTES_MASK("EQ1 Coefficients", ARIZONA_EQ1_1, 21,
17440843aeaSCharles Keepax 		   ARIZONA_EQ1_ENA_MASK),
175*12850b8dSRichard Fitzgerald SND_SOC_BYTES_MASK("EQ2 Coefficients", ARIZONA_EQ2_1, 21,
17640843aeaSCharles Keepax 		   ARIZONA_EQ2_ENA_MASK),
177*12850b8dSRichard Fitzgerald SND_SOC_BYTES_MASK("EQ3 Coefficients", ARIZONA_EQ3_1, 21,
17840843aeaSCharles Keepax 		   ARIZONA_EQ3_ENA_MASK),
179*12850b8dSRichard Fitzgerald SND_SOC_BYTES_MASK("EQ4 Coefficients", ARIZONA_EQ4_1, 21,
18040843aeaSCharles Keepax 		   ARIZONA_EQ4_ENA_MASK),
18140843aeaSCharles Keepax 
18240843aeaSCharles Keepax SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
18340843aeaSCharles Keepax 	       24, 0, eq_tlv),
18440843aeaSCharles Keepax SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT,
18540843aeaSCharles Keepax 	       24, 0, eq_tlv),
18640843aeaSCharles Keepax SOC_SINGLE_TLV("EQ1 B3 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B3_GAIN_SHIFT,
18740843aeaSCharles Keepax 	       24, 0, eq_tlv),
18840843aeaSCharles Keepax SOC_SINGLE_TLV("EQ1 B4 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B4_GAIN_SHIFT,
18940843aeaSCharles Keepax 	       24, 0, eq_tlv),
19040843aeaSCharles Keepax SOC_SINGLE_TLV("EQ1 B5 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B5_GAIN_SHIFT,
19140843aeaSCharles Keepax 	       24, 0, eq_tlv),
19240843aeaSCharles Keepax 
19340843aeaSCharles Keepax SOC_SINGLE_TLV("EQ2 B1 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B1_GAIN_SHIFT,
19440843aeaSCharles Keepax 	       24, 0, eq_tlv),
19540843aeaSCharles Keepax SOC_SINGLE_TLV("EQ2 B2 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B2_GAIN_SHIFT,
19640843aeaSCharles Keepax 	       24, 0, eq_tlv),
19740843aeaSCharles Keepax SOC_SINGLE_TLV("EQ2 B3 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B3_GAIN_SHIFT,
19840843aeaSCharles Keepax 	       24, 0, eq_tlv),
19940843aeaSCharles Keepax SOC_SINGLE_TLV("EQ2 B4 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B4_GAIN_SHIFT,
20040843aeaSCharles Keepax 	       24, 0, eq_tlv),
20140843aeaSCharles Keepax SOC_SINGLE_TLV("EQ2 B5 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B5_GAIN_SHIFT,
20240843aeaSCharles Keepax 	       24, 0, eq_tlv),
20340843aeaSCharles Keepax 
20440843aeaSCharles Keepax SOC_SINGLE_TLV("EQ3 B1 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B1_GAIN_SHIFT,
20540843aeaSCharles Keepax 	       24, 0, eq_tlv),
20640843aeaSCharles Keepax SOC_SINGLE_TLV("EQ3 B2 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B2_GAIN_SHIFT,
20740843aeaSCharles Keepax 	       24, 0, eq_tlv),
20840843aeaSCharles Keepax SOC_SINGLE_TLV("EQ3 B3 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B3_GAIN_SHIFT,
20940843aeaSCharles Keepax 	       24, 0, eq_tlv),
21040843aeaSCharles Keepax SOC_SINGLE_TLV("EQ3 B4 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B4_GAIN_SHIFT,
21140843aeaSCharles Keepax 	       24, 0, eq_tlv),
21240843aeaSCharles Keepax SOC_SINGLE_TLV("EQ3 B5 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B5_GAIN_SHIFT,
21340843aeaSCharles Keepax 	       24, 0, eq_tlv),
21440843aeaSCharles Keepax 
21540843aeaSCharles Keepax SOC_SINGLE_TLV("EQ4 B1 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B1_GAIN_SHIFT,
21640843aeaSCharles Keepax 	       24, 0, eq_tlv),
21740843aeaSCharles Keepax SOC_SINGLE_TLV("EQ4 B2 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B2_GAIN_SHIFT,
21840843aeaSCharles Keepax 	       24, 0, eq_tlv),
21940843aeaSCharles Keepax SOC_SINGLE_TLV("EQ4 B3 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B3_GAIN_SHIFT,
22040843aeaSCharles Keepax 	       24, 0, eq_tlv),
22140843aeaSCharles Keepax SOC_SINGLE_TLV("EQ4 B4 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B4_GAIN_SHIFT,
22240843aeaSCharles Keepax 	       24, 0, eq_tlv),
22340843aeaSCharles Keepax SOC_SINGLE_TLV("EQ4 B5 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B5_GAIN_SHIFT,
22440843aeaSCharles Keepax 	       24, 0, eq_tlv),
22540843aeaSCharles Keepax 
22640843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE),
22740843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE),
22840843aeaSCharles Keepax 
22940843aeaSCharles Keepax SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5,
23040843aeaSCharles Keepax 		   ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA),
23140843aeaSCharles Keepax 
23240843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE),
23340843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE),
23440843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE),
23540843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE),
23640843aeaSCharles Keepax 
23740843aeaSCharles Keepax SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode),
23840843aeaSCharles Keepax SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode),
23940843aeaSCharles Keepax SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode),
24040843aeaSCharles Keepax SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode),
24140843aeaSCharles Keepax 
24240843aeaSCharles Keepax SND_SOC_BYTES("LHPF1 Coefficients", ARIZONA_HPLPF1_2, 1),
24340843aeaSCharles Keepax SND_SOC_BYTES("LHPF2 Coefficients", ARIZONA_HPLPF2_2, 1),
24440843aeaSCharles Keepax SND_SOC_BYTES("LHPF3 Coefficients", ARIZONA_HPLPF3_2, 1),
24540843aeaSCharles Keepax SND_SOC_BYTES("LHPF4 Coefficients", ARIZONA_HPLPF4_2, 1),
24640843aeaSCharles Keepax 
24740843aeaSCharles Keepax SOC_VALUE_ENUM("ISRC1 FSL", arizona_isrc_fsl[0]),
24840843aeaSCharles Keepax SOC_VALUE_ENUM("ISRC2 FSL", arizona_isrc_fsl[1]),
24940843aeaSCharles Keepax 
25040843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE),
25140843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE),
25240843aeaSCharles Keepax 
25340843aeaSCharles Keepax SOC_SINGLE_TLV("Noise Generator Volume", ARIZONA_COMFORT_NOISE_GENERATOR,
25440843aeaSCharles Keepax 	       ARIZONA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, noise_tlv),
25540843aeaSCharles Keepax 
25640843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("HPOUT1L", ARIZONA_OUT1LMIX_INPUT_1_SOURCE),
25740843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("HPOUT1R", ARIZONA_OUT1RMIX_INPUT_1_SOURCE),
25840843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("EPOUT", ARIZONA_OUT3LMIX_INPUT_1_SOURCE),
25940843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SPKOUT", ARIZONA_OUT4LMIX_INPUT_1_SOURCE),
26040843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SPKDAT1L", ARIZONA_OUT5LMIX_INPUT_1_SOURCE),
26140843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE),
26240843aeaSCharles Keepax 
26340843aeaSCharles Keepax SOC_SINGLE("Speaker High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_4L,
26440843aeaSCharles Keepax 	   ARIZONA_OUT4_OSR_SHIFT, 1, 0),
26540843aeaSCharles Keepax SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L,
26640843aeaSCharles Keepax 	   ARIZONA_OUT5_OSR_SHIFT, 1, 0),
26740843aeaSCharles Keepax 
26840843aeaSCharles Keepax SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L,
26940843aeaSCharles Keepax 	     ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1),
27040843aeaSCharles Keepax SOC_SINGLE("EPOUT Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L,
27140843aeaSCharles Keepax 	   ARIZONA_OUT3L_MUTE_SHIFT, 1, 1),
27240843aeaSCharles Keepax SOC_SINGLE("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L,
27340843aeaSCharles Keepax 	   ARIZONA_OUT4L_MUTE_SHIFT, 1, 1),
27440843aeaSCharles Keepax SOC_DOUBLE_R("SPKDAT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_5L,
27540843aeaSCharles Keepax 	     ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_MUTE_SHIFT, 1, 1),
27640843aeaSCharles Keepax 
27740843aeaSCharles Keepax SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L,
27840843aeaSCharles Keepax 		 ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT,
27940843aeaSCharles Keepax 		 0xbf, 0, digital_tlv),
28040843aeaSCharles Keepax SOC_SINGLE_TLV("EPOUT Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L,
28140843aeaSCharles Keepax 	       ARIZONA_OUT3L_VOL_SHIFT, 0xbf, 0, digital_tlv),
28240843aeaSCharles Keepax SOC_SINGLE_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L,
28340843aeaSCharles Keepax 	       ARIZONA_OUT4L_VOL_SHIFT, 0xbf, 0, digital_tlv),
28440843aeaSCharles Keepax SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_5L,
28540843aeaSCharles Keepax 		 ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_VOL_SHIFT,
28640843aeaSCharles Keepax 		 0xbf, 0, digital_tlv),
28740843aeaSCharles Keepax 
28840843aeaSCharles Keepax SOC_VALUE_ENUM("HPOUT1 OSR", wm8997_hpout_osr[0]),
28940843aeaSCharles Keepax SOC_VALUE_ENUM("EPOUT OSR", wm8997_hpout_osr[1]),
29040843aeaSCharles Keepax 
29140843aeaSCharles Keepax SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp),
29240843aeaSCharles Keepax SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp),
29340843aeaSCharles Keepax 
29440843aeaSCharles Keepax SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT,
29540843aeaSCharles Keepax 	   ARIZONA_SPK1R_MUTE_SHIFT, 1, 1),
29640843aeaSCharles Keepax 
29740843aeaSCharles Keepax SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL,
29840843aeaSCharles Keepax 	   ARIZONA_NGATE_ENA_SHIFT, 1, 0),
29940843aeaSCharles Keepax SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL,
30040843aeaSCharles Keepax 	       ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv),
30140843aeaSCharles Keepax SOC_ENUM("Noise Gate Hold", arizona_ng_hold),
30240843aeaSCharles Keepax 
30340843aeaSCharles Keepax WM8997_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L),
30440843aeaSCharles Keepax WM8997_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R),
30540843aeaSCharles Keepax WM8997_NG_SRC("EPOUT", ARIZONA_NOISE_GATE_SELECT_3L),
30640843aeaSCharles Keepax WM8997_NG_SRC("SPKOUT", ARIZONA_NOISE_GATE_SELECT_4L),
30740843aeaSCharles Keepax WM8997_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L),
30840843aeaSCharles Keepax WM8997_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R),
30940843aeaSCharles Keepax 
31040843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE),
31140843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE),
31240843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE),
31340843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX4", ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE),
31440843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX5", ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE),
31540843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX6", ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE),
31640843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX7", ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE),
31740843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF1TX8", ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE),
31840843aeaSCharles Keepax 
31940843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF2TX1", ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE),
32040843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("AIF2TX2", ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE),
32140843aeaSCharles Keepax 
32240843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX1", ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE),
32340843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX2", ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE),
32440843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX3", ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE),
32540843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX4", ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE),
32640843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX5", ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE),
32740843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX6", ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE),
32840843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX7", ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE),
32940843aeaSCharles Keepax ARIZONA_MIXER_CONTROLS("SLIMTX8", ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE),
33040843aeaSCharles Keepax };
33140843aeaSCharles Keepax 
33240843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE);
33340843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE);
33440843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE);
33540843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(EQ4, ARIZONA_EQ4MIX_INPUT_1_SOURCE);
33640843aeaSCharles Keepax 
33740843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE);
33840843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE);
33940843aeaSCharles Keepax 
34040843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE);
34140843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE);
34240843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(LHPF3, ARIZONA_HPLP3MIX_INPUT_1_SOURCE);
34340843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(LHPF4, ARIZONA_HPLP4MIX_INPUT_1_SOURCE);
34440843aeaSCharles Keepax 
34540843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(Mic, ARIZONA_MICMIX_INPUT_1_SOURCE);
34640843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(Noise, ARIZONA_NOISEMIX_INPUT_1_SOURCE);
34740843aeaSCharles Keepax 
34840843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(PWM1, ARIZONA_PWM1MIX_INPUT_1_SOURCE);
34940843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(PWM2, ARIZONA_PWM2MIX_INPUT_1_SOURCE);
35040843aeaSCharles Keepax 
35140843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(OUT1L, ARIZONA_OUT1LMIX_INPUT_1_SOURCE);
35240843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(OUT1R, ARIZONA_OUT1RMIX_INPUT_1_SOURCE);
35340843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(OUT3, ARIZONA_OUT3LMIX_INPUT_1_SOURCE);
35440843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SPKOUT, ARIZONA_OUT4LMIX_INPUT_1_SOURCE);
35540843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SPKDAT1L, ARIZONA_OUT5LMIX_INPUT_1_SOURCE);
35640843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SPKDAT1R, ARIZONA_OUT5RMIX_INPUT_1_SOURCE);
35740843aeaSCharles Keepax 
35840843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX1, ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE);
35940843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX2, ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE);
36040843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX3, ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE);
36140843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX4, ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE);
36240843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX5, ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE);
36340843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX6, ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE);
36440843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX7, ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE);
36540843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF1TX8, ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE);
36640843aeaSCharles Keepax 
36740843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF2TX1, ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE);
36840843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE);
36940843aeaSCharles Keepax 
37040843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX1, ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE);
37140843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX2, ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE);
37240843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX3, ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE);
37340843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX4, ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE);
37440843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX5, ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE);
37540843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX6, ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE);
37640843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX7, ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE);
37740843aeaSCharles Keepax ARIZONA_MIXER_ENUMS(SLIMTX8, ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE);
37840843aeaSCharles Keepax 
37940843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC1INT1, ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE);
38040843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC1INT2, ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE);
38140843aeaSCharles Keepax 
38240843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC1DEC1, ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE);
38340843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC1DEC2, ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE);
38440843aeaSCharles Keepax 
38540843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC2INT1, ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE);
38640843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC2INT2, ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE);
38740843aeaSCharles Keepax 
38840843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC2DEC1, ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE);
38940843aeaSCharles Keepax ARIZONA_MUX_ENUMS(ISRC2DEC2, ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE);
39040843aeaSCharles Keepax 
39140843aeaSCharles Keepax static const char *wm8997_aec_loopback_texts[] = {
39240843aeaSCharles Keepax 	"HPOUT1L", "HPOUT1R", "EPOUT", "SPKOUT", "SPKDAT1L", "SPKDAT1R",
39340843aeaSCharles Keepax };
39440843aeaSCharles Keepax 
39540843aeaSCharles Keepax static const unsigned int wm8997_aec_loopback_values[] = {
39640843aeaSCharles Keepax 	0, 1, 4, 6, 8, 9,
39740843aeaSCharles Keepax };
39840843aeaSCharles Keepax 
39940843aeaSCharles Keepax static const struct soc_enum wm8997_aec_loopback =
40040843aeaSCharles Keepax 	SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1,
40140843aeaSCharles Keepax 			      ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf,
40240843aeaSCharles Keepax 			      ARRAY_SIZE(wm8997_aec_loopback_texts),
40340843aeaSCharles Keepax 			      wm8997_aec_loopback_texts,
40440843aeaSCharles Keepax 			      wm8997_aec_loopback_values);
40540843aeaSCharles Keepax 
40640843aeaSCharles Keepax static const struct snd_kcontrol_new wm8997_aec_loopback_mux =
40740843aeaSCharles Keepax 	SOC_DAPM_VALUE_ENUM("AEC Loopback", wm8997_aec_loopback);
40840843aeaSCharles Keepax 
40940843aeaSCharles Keepax static const struct snd_soc_dapm_widget wm8997_dapm_widgets[] = {
41040843aeaSCharles Keepax SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT,
41140843aeaSCharles Keepax 		    0, wm8997_sysclk_ev, SND_SOC_DAPM_POST_PMU),
41240843aeaSCharles Keepax SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1,
41340843aeaSCharles Keepax 		    ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
41440843aeaSCharles Keepax SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK,
41540843aeaSCharles Keepax 		    ARIZONA_OPCLK_ENA_SHIFT, 0, NULL, 0),
41640843aeaSCharles Keepax SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", ARIZONA_OUTPUT_ASYNC_CLOCK,
41740843aeaSCharles Keepax 		    ARIZONA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0),
41840843aeaSCharles Keepax 
41940843aeaSCharles Keepax SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0),
42040843aeaSCharles Keepax SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD", 20, 0),
42140843aeaSCharles Keepax SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS),
42240843aeaSCharles Keepax SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDD", 0, 0),
42340843aeaSCharles Keepax 
42440843aeaSCharles Keepax SND_SOC_DAPM_SIGGEN("TONE"),
42540843aeaSCharles Keepax SND_SOC_DAPM_SIGGEN("NOISE"),
42640843aeaSCharles Keepax SND_SOC_DAPM_SIGGEN("HAPTICS"),
42740843aeaSCharles Keepax 
42840843aeaSCharles Keepax SND_SOC_DAPM_INPUT("IN1L"),
42940843aeaSCharles Keepax SND_SOC_DAPM_INPUT("IN1R"),
43040843aeaSCharles Keepax SND_SOC_DAPM_INPUT("IN2L"),
43140843aeaSCharles Keepax SND_SOC_DAPM_INPUT("IN2R"),
43240843aeaSCharles Keepax 
43340843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT,
43440843aeaSCharles Keepax 		   0, NULL, 0, arizona_in_ev,
43540843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
43640843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
43740843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("IN1R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1R_ENA_SHIFT,
43840843aeaSCharles Keepax 		   0, NULL, 0, arizona_in_ev,
43940843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
44040843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
44140843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("IN2L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2L_ENA_SHIFT,
44240843aeaSCharles Keepax 		   0, NULL, 0, arizona_in_ev,
44340843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
44440843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
44540843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("IN2R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2R_ENA_SHIFT,
44640843aeaSCharles Keepax 		   0, NULL, 0, arizona_in_ev,
44740843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
44840843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
44940843aeaSCharles Keepax 
45040843aeaSCharles Keepax SND_SOC_DAPM_SUPPLY("MICBIAS1", ARIZONA_MIC_BIAS_CTRL_1,
45140843aeaSCharles Keepax 		    ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
45240843aeaSCharles Keepax SND_SOC_DAPM_SUPPLY("MICBIAS2", ARIZONA_MIC_BIAS_CTRL_2,
45340843aeaSCharles Keepax 		    ARIZONA_MICB2_ENA_SHIFT, 0, NULL, 0),
45440843aeaSCharles Keepax SND_SOC_DAPM_SUPPLY("MICBIAS3", ARIZONA_MIC_BIAS_CTRL_3,
45540843aeaSCharles Keepax 		    ARIZONA_MICB3_ENA_SHIFT, 0, NULL, 0),
45640843aeaSCharles Keepax 
45740843aeaSCharles Keepax SND_SOC_DAPM_PGA("Noise Generator", ARIZONA_COMFORT_NOISE_GENERATOR,
45840843aeaSCharles Keepax 		 ARIZONA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0),
45940843aeaSCharles Keepax 
46040843aeaSCharles Keepax SND_SOC_DAPM_PGA("Tone Generator 1", ARIZONA_TONE_GENERATOR_1,
46140843aeaSCharles Keepax 		 ARIZONA_TONE1_ENA_SHIFT, 0, NULL, 0),
46240843aeaSCharles Keepax SND_SOC_DAPM_PGA("Tone Generator 2", ARIZONA_TONE_GENERATOR_1,
46340843aeaSCharles Keepax 		 ARIZONA_TONE2_ENA_SHIFT, 0, NULL, 0),
46440843aeaSCharles Keepax 
46540843aeaSCharles Keepax SND_SOC_DAPM_PGA("Mic Mute Mixer", ARIZONA_MIC_NOISE_MIX_CONTROL_1,
46640843aeaSCharles Keepax 		 ARIZONA_MICMUTE_MIX_ENA_SHIFT, 0, NULL, 0),
46740843aeaSCharles Keepax 
46840843aeaSCharles Keepax SND_SOC_DAPM_PGA("EQ1", ARIZONA_EQ1_1, ARIZONA_EQ1_ENA_SHIFT, 0, NULL, 0),
46940843aeaSCharles Keepax SND_SOC_DAPM_PGA("EQ2", ARIZONA_EQ2_1, ARIZONA_EQ2_ENA_SHIFT, 0, NULL, 0),
47040843aeaSCharles Keepax SND_SOC_DAPM_PGA("EQ3", ARIZONA_EQ3_1, ARIZONA_EQ3_ENA_SHIFT, 0, NULL, 0),
47140843aeaSCharles Keepax SND_SOC_DAPM_PGA("EQ4", ARIZONA_EQ4_1, ARIZONA_EQ4_ENA_SHIFT, 0, NULL, 0),
47240843aeaSCharles Keepax 
47340843aeaSCharles Keepax SND_SOC_DAPM_PGA("DRC1L", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1L_ENA_SHIFT, 0,
47440843aeaSCharles Keepax 		 NULL, 0),
47540843aeaSCharles Keepax SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0,
47640843aeaSCharles Keepax 		 NULL, 0),
47740843aeaSCharles Keepax 
47840843aeaSCharles Keepax SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0,
47940843aeaSCharles Keepax 		 NULL, 0),
48040843aeaSCharles Keepax SND_SOC_DAPM_PGA("LHPF2", ARIZONA_HPLPF2_1, ARIZONA_LHPF2_ENA_SHIFT, 0,
48140843aeaSCharles Keepax 		 NULL, 0),
48240843aeaSCharles Keepax SND_SOC_DAPM_PGA("LHPF3", ARIZONA_HPLPF3_1, ARIZONA_LHPF3_ENA_SHIFT, 0,
48340843aeaSCharles Keepax 		 NULL, 0),
48440843aeaSCharles Keepax SND_SOC_DAPM_PGA("LHPF4", ARIZONA_HPLPF4_1, ARIZONA_LHPF4_ENA_SHIFT, 0,
48540843aeaSCharles Keepax 		 NULL, 0),
48640843aeaSCharles Keepax 
48740843aeaSCharles Keepax SND_SOC_DAPM_PGA("PWM1 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM1_ENA_SHIFT,
48840843aeaSCharles Keepax 		 0, NULL, 0),
48940843aeaSCharles Keepax SND_SOC_DAPM_PGA("PWM2 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM2_ENA_SHIFT,
49040843aeaSCharles Keepax 		 0, NULL, 0),
49140843aeaSCharles Keepax 
49240843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC1INT1", ARIZONA_ISRC_1_CTRL_3,
49340843aeaSCharles Keepax 		 ARIZONA_ISRC1_INT0_ENA_SHIFT, 0, NULL, 0),
49440843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC1INT2", ARIZONA_ISRC_1_CTRL_3,
49540843aeaSCharles Keepax 		 ARIZONA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0),
49640843aeaSCharles Keepax 
49740843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC1DEC1", ARIZONA_ISRC_1_CTRL_3,
49840843aeaSCharles Keepax 		 ARIZONA_ISRC1_DEC0_ENA_SHIFT, 0, NULL, 0),
49940843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC1DEC2", ARIZONA_ISRC_1_CTRL_3,
50040843aeaSCharles Keepax 		 ARIZONA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0),
50140843aeaSCharles Keepax 
50240843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC2INT1", ARIZONA_ISRC_2_CTRL_3,
50340843aeaSCharles Keepax 		 ARIZONA_ISRC2_INT0_ENA_SHIFT, 0, NULL, 0),
50440843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC2INT2", ARIZONA_ISRC_2_CTRL_3,
50540843aeaSCharles Keepax 		 ARIZONA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0),
50640843aeaSCharles Keepax 
50740843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC2DEC1", ARIZONA_ISRC_2_CTRL_3,
50840843aeaSCharles Keepax 		 ARIZONA_ISRC2_DEC0_ENA_SHIFT, 0, NULL, 0),
50940843aeaSCharles Keepax SND_SOC_DAPM_PGA("ISRC2DEC2", ARIZONA_ISRC_2_CTRL_3,
51040843aeaSCharles Keepax 		 ARIZONA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0),
51140843aeaSCharles Keepax 
51240843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0,
51340843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0),
51440843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0,
51540843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX2_ENA_SHIFT, 0),
51640843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0,
51740843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX3_ENA_SHIFT, 0),
51840843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0,
51940843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX4_ENA_SHIFT, 0),
52040843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0,
52140843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX5_ENA_SHIFT, 0),
52240843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0,
52340843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX6_ENA_SHIFT, 0),
52440843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0,
52540843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX7_ENA_SHIFT, 0),
52640843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0,
52740843aeaSCharles Keepax 		     ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX8_ENA_SHIFT, 0),
52840843aeaSCharles Keepax 
52940843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0,
53040843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX1_ENA_SHIFT, 0),
53140843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0,
53240843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX2_ENA_SHIFT, 0),
53340843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0,
53440843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX3_ENA_SHIFT, 0),
53540843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0,
53640843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX4_ENA_SHIFT, 0),
53740843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0,
53840843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX5_ENA_SHIFT, 0),
53940843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0,
54040843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX6_ENA_SHIFT, 0),
54140843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0,
54240843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX7_ENA_SHIFT, 0),
54340843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0,
54440843aeaSCharles Keepax 		    ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX8_ENA_SHIFT, 0),
54540843aeaSCharles Keepax 
54640843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0,
54740843aeaSCharles Keepax 		     ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX1_ENA_SHIFT, 0),
54840843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0,
54940843aeaSCharles Keepax 		     ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX2_ENA_SHIFT, 0),
55040843aeaSCharles Keepax 
55140843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0,
55240843aeaSCharles Keepax 		    ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX1_ENA_SHIFT, 0),
55340843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0,
55440843aeaSCharles Keepax 		    ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX2_ENA_SHIFT, 0),
55540843aeaSCharles Keepax 
55640843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0,
55740843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
55840843aeaSCharles Keepax 		     ARIZONA_SLIMTX1_ENA_SHIFT, 0),
55940843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0,
56040843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
56140843aeaSCharles Keepax 		     ARIZONA_SLIMTX2_ENA_SHIFT, 0),
56240843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0,
56340843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
56440843aeaSCharles Keepax 		     ARIZONA_SLIMTX3_ENA_SHIFT, 0),
56540843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0,
56640843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
56740843aeaSCharles Keepax 		     ARIZONA_SLIMTX4_ENA_SHIFT, 0),
56840843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0,
56940843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
57040843aeaSCharles Keepax 		     ARIZONA_SLIMTX5_ENA_SHIFT, 0),
57140843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0,
57240843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
57340843aeaSCharles Keepax 		     ARIZONA_SLIMTX6_ENA_SHIFT, 0),
57440843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0,
57540843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
57640843aeaSCharles Keepax 		     ARIZONA_SLIMTX7_ENA_SHIFT, 0),
57740843aeaSCharles Keepax SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0,
57840843aeaSCharles Keepax 		     ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
57940843aeaSCharles Keepax 		     ARIZONA_SLIMTX8_ENA_SHIFT, 0),
58040843aeaSCharles Keepax 
58140843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0,
58240843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
58340843aeaSCharles Keepax 		    ARIZONA_SLIMRX1_ENA_SHIFT, 0),
58440843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0,
58540843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
58640843aeaSCharles Keepax 		    ARIZONA_SLIMRX2_ENA_SHIFT, 0),
58740843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0,
58840843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
58940843aeaSCharles Keepax 		    ARIZONA_SLIMRX3_ENA_SHIFT, 0),
59040843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0,
59140843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
59240843aeaSCharles Keepax 		    ARIZONA_SLIMRX4_ENA_SHIFT, 0),
59340843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0,
59440843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
59540843aeaSCharles Keepax 		    ARIZONA_SLIMRX5_ENA_SHIFT, 0),
59640843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0,
59740843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
59840843aeaSCharles Keepax 		    ARIZONA_SLIMRX6_ENA_SHIFT, 0),
59940843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0,
60040843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
60140843aeaSCharles Keepax 		    ARIZONA_SLIMRX7_ENA_SHIFT, 0),
60240843aeaSCharles Keepax SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0,
60340843aeaSCharles Keepax 		    ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
60440843aeaSCharles Keepax 		    ARIZONA_SLIMRX8_ENA_SHIFT, 0),
60540843aeaSCharles Keepax 
60640843aeaSCharles Keepax SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1,
60740843aeaSCharles Keepax 		       ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0,
60840843aeaSCharles Keepax 		       &wm8997_aec_loopback_mux),
60940843aeaSCharles Keepax 
61040843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
61140843aeaSCharles Keepax 		   ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev,
61240843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
61340843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM,
61440843aeaSCharles Keepax 		   ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev,
61540843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
61640843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
61740843aeaSCharles Keepax 		   ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
61840843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
61940843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1,
62040843aeaSCharles Keepax 		   ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
62140843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
62240843aeaSCharles Keepax SND_SOC_DAPM_PGA_E("OUT5R", ARIZONA_OUTPUT_ENABLES_1,
62340843aeaSCharles Keepax 		   ARIZONA_OUT5R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
62440843aeaSCharles Keepax 		   SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
62540843aeaSCharles Keepax 
62640843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(EQ1, "EQ1"),
62740843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(EQ2, "EQ2"),
62840843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(EQ3, "EQ3"),
62940843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(EQ4, "EQ4"),
63040843aeaSCharles Keepax 
63140843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"),
63240843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"),
63340843aeaSCharles Keepax 
63440843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"),
63540843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"),
63640843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(LHPF3, "LHPF3"),
63740843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(LHPF4, "LHPF4"),
63840843aeaSCharles Keepax 
63940843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(Mic, "Mic"),
64040843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(Noise, "Noise"),
64140843aeaSCharles Keepax 
64240843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(PWM1, "PWM1"),
64340843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(PWM2, "PWM2"),
64440843aeaSCharles Keepax 
64540843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(OUT1L, "HPOUT1L"),
64640843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(OUT1R, "HPOUT1R"),
64740843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(OUT3, "EPOUT"),
64840843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SPKOUT, "SPKOUT"),
64940843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"),
65040843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"),
65140843aeaSCharles Keepax 
65240843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"),
65340843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"),
65440843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"),
65540843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"),
65640843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"),
65740843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"),
65840843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"),
65940843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"),
66040843aeaSCharles Keepax 
66140843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"),
66240843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"),
66340843aeaSCharles Keepax 
66440843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"),
66540843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"),
66640843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"),
66740843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"),
66840843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"),
66940843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"),
67040843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"),
67140843aeaSCharles Keepax ARIZONA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"),
67240843aeaSCharles Keepax 
67340843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"),
67440843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"),
67540843aeaSCharles Keepax 
67640843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"),
67740843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"),
67840843aeaSCharles Keepax 
67940843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"),
68040843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"),
68140843aeaSCharles Keepax 
68240843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"),
68340843aeaSCharles Keepax ARIZONA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"),
68440843aeaSCharles Keepax 
68540843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("HPOUT1L"),
68640843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("HPOUT1R"),
68740843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("EPOUTN"),
68840843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("EPOUTP"),
68940843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("SPKOUTN"),
69040843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("SPKOUTP"),
69140843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("SPKDAT1L"),
69240843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
69340843aeaSCharles Keepax 
69440843aeaSCharles Keepax SND_SOC_DAPM_OUTPUT("MICSUPP"),
69540843aeaSCharles Keepax };
69640843aeaSCharles Keepax 
69740843aeaSCharles Keepax #define ARIZONA_MIXER_INPUT_ROUTES(name)	\
69840843aeaSCharles Keepax 	{ name, "Noise Generator", "Noise Generator" }, \
69940843aeaSCharles Keepax 	{ name, "Tone Generator 1", "Tone Generator 1" }, \
70040843aeaSCharles Keepax 	{ name, "Tone Generator 2", "Tone Generator 2" }, \
70140843aeaSCharles Keepax 	{ name, "Haptics", "HAPTICS" }, \
70240843aeaSCharles Keepax 	{ name, "AEC", "AEC Loopback" }, \
70340843aeaSCharles Keepax 	{ name, "IN1L", "IN1L PGA" }, \
70440843aeaSCharles Keepax 	{ name, "IN1R", "IN1R PGA" }, \
70540843aeaSCharles Keepax 	{ name, "IN2L", "IN2L PGA" }, \
70640843aeaSCharles Keepax 	{ name, "IN2R", "IN2R PGA" }, \
70740843aeaSCharles Keepax 	{ name, "Mic Mute Mixer", "Mic Mute Mixer" }, \
70840843aeaSCharles Keepax 	{ name, "AIF1RX1", "AIF1RX1" }, \
70940843aeaSCharles Keepax 	{ name, "AIF1RX2", "AIF1RX2" }, \
71040843aeaSCharles Keepax 	{ name, "AIF1RX3", "AIF1RX3" }, \
71140843aeaSCharles Keepax 	{ name, "AIF1RX4", "AIF1RX4" }, \
71240843aeaSCharles Keepax 	{ name, "AIF1RX5", "AIF1RX5" }, \
71340843aeaSCharles Keepax 	{ name, "AIF1RX6", "AIF1RX6" }, \
71440843aeaSCharles Keepax 	{ name, "AIF1RX7", "AIF1RX7" }, \
71540843aeaSCharles Keepax 	{ name, "AIF1RX8", "AIF1RX8" }, \
71640843aeaSCharles Keepax 	{ name, "AIF2RX1", "AIF2RX1" }, \
71740843aeaSCharles Keepax 	{ name, "AIF2RX2", "AIF2RX2" }, \
71840843aeaSCharles Keepax 	{ name, "SLIMRX1", "SLIMRX1" }, \
71940843aeaSCharles Keepax 	{ name, "SLIMRX2", "SLIMRX2" }, \
72040843aeaSCharles Keepax 	{ name, "SLIMRX3", "SLIMRX3" }, \
72140843aeaSCharles Keepax 	{ name, "SLIMRX4", "SLIMRX4" }, \
72240843aeaSCharles Keepax 	{ name, "SLIMRX5", "SLIMRX5" }, \
72340843aeaSCharles Keepax 	{ name, "SLIMRX6", "SLIMRX6" }, \
72440843aeaSCharles Keepax 	{ name, "SLIMRX7", "SLIMRX7" }, \
72540843aeaSCharles Keepax 	{ name, "SLIMRX8", "SLIMRX8" }, \
72640843aeaSCharles Keepax 	{ name, "EQ1", "EQ1" }, \
72740843aeaSCharles Keepax 	{ name, "EQ2", "EQ2" }, \
72840843aeaSCharles Keepax 	{ name, "EQ3", "EQ3" }, \
72940843aeaSCharles Keepax 	{ name, "EQ4", "EQ4" }, \
73040843aeaSCharles Keepax 	{ name, "DRC1L", "DRC1L" }, \
73140843aeaSCharles Keepax 	{ name, "DRC1R", "DRC1R" }, \
73240843aeaSCharles Keepax 	{ name, "LHPF1", "LHPF1" }, \
73340843aeaSCharles Keepax 	{ name, "LHPF2", "LHPF2" }, \
73440843aeaSCharles Keepax 	{ name, "LHPF3", "LHPF3" }, \
73540843aeaSCharles Keepax 	{ name, "LHPF4", "LHPF4" }, \
73640843aeaSCharles Keepax 	{ name, "ISRC1DEC1", "ISRC1DEC1" }, \
73740843aeaSCharles Keepax 	{ name, "ISRC1DEC2", "ISRC1DEC2" }, \
73840843aeaSCharles Keepax 	{ name, "ISRC1INT1", "ISRC1INT1" }, \
73940843aeaSCharles Keepax 	{ name, "ISRC1INT2", "ISRC1INT2" }, \
74040843aeaSCharles Keepax 	{ name, "ISRC2DEC1", "ISRC2DEC1" }, \
74140843aeaSCharles Keepax 	{ name, "ISRC2DEC2", "ISRC2DEC2" }, \
74240843aeaSCharles Keepax 	{ name, "ISRC2INT1", "ISRC2INT1" }, \
74340843aeaSCharles Keepax 	{ name, "ISRC2INT2", "ISRC2INT2" }
74440843aeaSCharles Keepax 
74540843aeaSCharles Keepax static const struct snd_soc_dapm_route wm8997_dapm_routes[] = {
74640843aeaSCharles Keepax 	{ "AIF2 Capture", NULL, "DBVDD2" },
74740843aeaSCharles Keepax 	{ "AIF2 Playback", NULL, "DBVDD2" },
74840843aeaSCharles Keepax 
74940843aeaSCharles Keepax 	{ "OUT1L", NULL, "CPVDD" },
75040843aeaSCharles Keepax 	{ "OUT1R", NULL, "CPVDD" },
75140843aeaSCharles Keepax 	{ "OUT3L", NULL, "CPVDD" },
75240843aeaSCharles Keepax 
75340843aeaSCharles Keepax 	{ "OUT4L", NULL, "SPKVDD" },
75440843aeaSCharles Keepax 
75540843aeaSCharles Keepax 	{ "OUT1L", NULL, "SYSCLK" },
75640843aeaSCharles Keepax 	{ "OUT1R", NULL, "SYSCLK" },
75740843aeaSCharles Keepax 	{ "OUT3L", NULL, "SYSCLK" },
75840843aeaSCharles Keepax 	{ "OUT4L", NULL, "SYSCLK" },
75940843aeaSCharles Keepax 
76040843aeaSCharles Keepax 	{ "IN1L", NULL, "SYSCLK" },
76140843aeaSCharles Keepax 	{ "IN1R", NULL, "SYSCLK" },
76240843aeaSCharles Keepax 	{ "IN2L", NULL, "SYSCLK" },
76340843aeaSCharles Keepax 	{ "IN2R", NULL, "SYSCLK" },
76440843aeaSCharles Keepax 
76540843aeaSCharles Keepax 	{ "MICBIAS1", NULL, "MICVDD" },
76640843aeaSCharles Keepax 	{ "MICBIAS2", NULL, "MICVDD" },
76740843aeaSCharles Keepax 	{ "MICBIAS3", NULL, "MICVDD" },
76840843aeaSCharles Keepax 
76940843aeaSCharles Keepax 	{ "Noise Generator", NULL, "SYSCLK" },
77040843aeaSCharles Keepax 	{ "Tone Generator 1", NULL, "SYSCLK" },
77140843aeaSCharles Keepax 	{ "Tone Generator 2", NULL, "SYSCLK" },
77240843aeaSCharles Keepax 
77340843aeaSCharles Keepax 	{ "Noise Generator", NULL, "NOISE" },
77440843aeaSCharles Keepax 	{ "Tone Generator 1", NULL, "TONE" },
77540843aeaSCharles Keepax 	{ "Tone Generator 2", NULL, "TONE" },
77640843aeaSCharles Keepax 
77740843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX1" },
77840843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX2" },
77940843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX3" },
78040843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX4" },
78140843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX5" },
78240843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX6" },
78340843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX7" },
78440843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "AIF1TX8" },
78540843aeaSCharles Keepax 
78640843aeaSCharles Keepax 	{ "AIF1RX1", NULL, "AIF1 Playback" },
78740843aeaSCharles Keepax 	{ "AIF1RX2", NULL, "AIF1 Playback" },
78840843aeaSCharles Keepax 	{ "AIF1RX3", NULL, "AIF1 Playback" },
78940843aeaSCharles Keepax 	{ "AIF1RX4", NULL, "AIF1 Playback" },
79040843aeaSCharles Keepax 	{ "AIF1RX5", NULL, "AIF1 Playback" },
79140843aeaSCharles Keepax 	{ "AIF1RX6", NULL, "AIF1 Playback" },
79240843aeaSCharles Keepax 	{ "AIF1RX7", NULL, "AIF1 Playback" },
79340843aeaSCharles Keepax 	{ "AIF1RX8", NULL, "AIF1 Playback" },
79440843aeaSCharles Keepax 
79540843aeaSCharles Keepax 	{ "AIF2 Capture", NULL, "AIF2TX1" },
79640843aeaSCharles Keepax 	{ "AIF2 Capture", NULL, "AIF2TX2" },
79740843aeaSCharles Keepax 
79840843aeaSCharles Keepax 	{ "AIF2RX1", NULL, "AIF2 Playback" },
79940843aeaSCharles Keepax 	{ "AIF2RX2", NULL, "AIF2 Playback" },
80040843aeaSCharles Keepax 
80140843aeaSCharles Keepax 	{ "Slim1 Capture", NULL, "SLIMTX1" },
80240843aeaSCharles Keepax 	{ "Slim1 Capture", NULL, "SLIMTX2" },
80340843aeaSCharles Keepax 	{ "Slim1 Capture", NULL, "SLIMTX3" },
80440843aeaSCharles Keepax 	{ "Slim1 Capture", NULL, "SLIMTX4" },
80540843aeaSCharles Keepax 
80640843aeaSCharles Keepax 	{ "SLIMRX1", NULL, "Slim1 Playback" },
80740843aeaSCharles Keepax 	{ "SLIMRX2", NULL, "Slim1 Playback" },
80840843aeaSCharles Keepax 	{ "SLIMRX3", NULL, "Slim1 Playback" },
80940843aeaSCharles Keepax 	{ "SLIMRX4", NULL, "Slim1 Playback" },
81040843aeaSCharles Keepax 
81140843aeaSCharles Keepax 	{ "Slim2 Capture", NULL, "SLIMTX5" },
81240843aeaSCharles Keepax 	{ "Slim2 Capture", NULL, "SLIMTX6" },
81340843aeaSCharles Keepax 
81440843aeaSCharles Keepax 	{ "SLIMRX5", NULL, "Slim2 Playback" },
81540843aeaSCharles Keepax 	{ "SLIMRX6", NULL, "Slim2 Playback" },
81640843aeaSCharles Keepax 
81740843aeaSCharles Keepax 	{ "Slim3 Capture", NULL, "SLIMTX7" },
81840843aeaSCharles Keepax 	{ "Slim3 Capture", NULL, "SLIMTX8" },
81940843aeaSCharles Keepax 
82040843aeaSCharles Keepax 	{ "SLIMRX7", NULL, "Slim3 Playback" },
82140843aeaSCharles Keepax 	{ "SLIMRX8", NULL, "Slim3 Playback" },
82240843aeaSCharles Keepax 
82340843aeaSCharles Keepax 	{ "AIF1 Playback", NULL, "SYSCLK" },
82440843aeaSCharles Keepax 	{ "AIF2 Playback", NULL, "SYSCLK" },
82540843aeaSCharles Keepax 	{ "Slim1 Playback", NULL, "SYSCLK" },
82640843aeaSCharles Keepax 	{ "Slim2 Playback", NULL, "SYSCLK" },
82740843aeaSCharles Keepax 	{ "Slim3 Playback", NULL, "SYSCLK" },
82840843aeaSCharles Keepax 
82940843aeaSCharles Keepax 	{ "AIF1 Capture", NULL, "SYSCLK" },
83040843aeaSCharles Keepax 	{ "AIF2 Capture", NULL, "SYSCLK" },
83140843aeaSCharles Keepax 	{ "Slim1 Capture", NULL, "SYSCLK" },
83240843aeaSCharles Keepax 	{ "Slim2 Capture", NULL, "SYSCLK" },
83340843aeaSCharles Keepax 	{ "Slim3 Capture", NULL, "SYSCLK" },
83440843aeaSCharles Keepax 
83540843aeaSCharles Keepax 	{ "IN1L PGA", NULL, "IN1L" },
83640843aeaSCharles Keepax 	{ "IN1R PGA", NULL, "IN1R" },
83740843aeaSCharles Keepax 
83840843aeaSCharles Keepax 	{ "IN2L PGA", NULL, "IN2L" },
83940843aeaSCharles Keepax 	{ "IN2R PGA", NULL, "IN2R" },
84040843aeaSCharles Keepax 
84140843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
84240843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
84340843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("OUT3L", "EPOUT"),
84440843aeaSCharles Keepax 
84540843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("OUT4L", "SPKOUT"),
84640843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("OUT5L", "SPKDAT1L"),
84740843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("OUT5R", "SPKDAT1R"),
84840843aeaSCharles Keepax 
84940843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("PWM1 Driver", "PWM1"),
85040843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("PWM2 Driver", "PWM2"),
85140843aeaSCharles Keepax 
85240843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"),
85340843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"),
85440843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"),
85540843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"),
85640843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"),
85740843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"),
85840843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"),
85940843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"),
86040843aeaSCharles Keepax 
86140843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"),
86240843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"),
86340843aeaSCharles Keepax 
86440843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"),
86540843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"),
86640843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"),
86740843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"),
86840843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"),
86940843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"),
87040843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"),
87140843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"),
87240843aeaSCharles Keepax 
87340843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("EQ1", "EQ1"),
87440843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("EQ2", "EQ2"),
87540843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("EQ3", "EQ3"),
87640843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("EQ4", "EQ4"),
87740843aeaSCharles Keepax 
87840843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"),
87940843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"),
88040843aeaSCharles Keepax 
88140843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"),
88240843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"),
88340843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"),
88440843aeaSCharles Keepax 	ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"),
88540843aeaSCharles Keepax 
886c5efb38aSMark Brown 	ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Noise"),
887c5efb38aSMark Brown 	ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"),
888c5efb38aSMark Brown 
88940843aeaSCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"),
890f4cdb6b4SCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"),
89140843aeaSCharles Keepax 
89240843aeaSCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"),
89340843aeaSCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"),
89440843aeaSCharles Keepax 
89540843aeaSCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC2INT1", "ISRC2INT1"),
89640843aeaSCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC2INT2", "ISRC2INT2"),
89740843aeaSCharles Keepax 
89840843aeaSCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC2DEC1", "ISRC2DEC1"),
89940843aeaSCharles Keepax 	ARIZONA_MUX_ROUTES("ISRC2DEC2", "ISRC2DEC2"),
90040843aeaSCharles Keepax 
90140843aeaSCharles Keepax 	{ "AEC Loopback", "HPOUT1L", "OUT1L" },
90240843aeaSCharles Keepax 	{ "AEC Loopback", "HPOUT1R", "OUT1R" },
90340843aeaSCharles Keepax 	{ "HPOUT1L", NULL, "OUT1L" },
90440843aeaSCharles Keepax 	{ "HPOUT1R", NULL, "OUT1R" },
90540843aeaSCharles Keepax 
90640843aeaSCharles Keepax 	{ "AEC Loopback", "EPOUT", "OUT3L" },
90740843aeaSCharles Keepax 	{ "EPOUTN", NULL, "OUT3L" },
90840843aeaSCharles Keepax 	{ "EPOUTP", NULL, "OUT3L" },
90940843aeaSCharles Keepax 
91040843aeaSCharles Keepax 	{ "AEC Loopback", "SPKOUT", "OUT4L" },
91140843aeaSCharles Keepax 	{ "SPKOUTN", NULL, "OUT4L" },
91240843aeaSCharles Keepax 	{ "SPKOUTP", NULL, "OUT4L" },
91340843aeaSCharles Keepax 
91440843aeaSCharles Keepax 	{ "AEC Loopback", "SPKDAT1L", "OUT5L" },
91540843aeaSCharles Keepax 	{ "AEC Loopback", "SPKDAT1R", "OUT5R" },
91640843aeaSCharles Keepax 	{ "SPKDAT1L", NULL, "OUT5L" },
91740843aeaSCharles Keepax 	{ "SPKDAT1R", NULL, "OUT5R" },
91840843aeaSCharles Keepax 
91940843aeaSCharles Keepax 	{ "MICSUPP", NULL, "SYSCLK" },
92040843aeaSCharles Keepax };
92140843aeaSCharles Keepax 
92240843aeaSCharles Keepax static int wm8997_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
92340843aeaSCharles Keepax 			  unsigned int Fref, unsigned int Fout)
92440843aeaSCharles Keepax {
92540843aeaSCharles Keepax 	struct wm8997_priv *wm8997 = snd_soc_codec_get_drvdata(codec);
92640843aeaSCharles Keepax 
92740843aeaSCharles Keepax 	switch (fll_id) {
92840843aeaSCharles Keepax 	case WM8997_FLL1:
92940843aeaSCharles Keepax 		return arizona_set_fll(&wm8997->fll[0], source, Fref, Fout);
93040843aeaSCharles Keepax 	case WM8997_FLL2:
93140843aeaSCharles Keepax 		return arizona_set_fll(&wm8997->fll[1], source, Fref, Fout);
93240843aeaSCharles Keepax 	case WM8997_FLL1_REFCLK:
93340843aeaSCharles Keepax 		return arizona_set_fll_refclk(&wm8997->fll[0], source, Fref,
93440843aeaSCharles Keepax 					      Fout);
93540843aeaSCharles Keepax 	case WM8997_FLL2_REFCLK:
93640843aeaSCharles Keepax 		return arizona_set_fll_refclk(&wm8997->fll[1], source, Fref,
93740843aeaSCharles Keepax 					      Fout);
93840843aeaSCharles Keepax 	default:
93940843aeaSCharles Keepax 		return -EINVAL;
94040843aeaSCharles Keepax 	}
94140843aeaSCharles Keepax }
94240843aeaSCharles Keepax 
94340843aeaSCharles Keepax #define WM8997_RATES SNDRV_PCM_RATE_8000_192000
94440843aeaSCharles Keepax 
94540843aeaSCharles Keepax #define WM8997_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
94640843aeaSCharles Keepax 			SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
94740843aeaSCharles Keepax 
94840843aeaSCharles Keepax static struct snd_soc_dai_driver wm8997_dai[] = {
94940843aeaSCharles Keepax 	{
95040843aeaSCharles Keepax 		.name = "wm8997-aif1",
95140843aeaSCharles Keepax 		.id = 1,
95240843aeaSCharles Keepax 		.base = ARIZONA_AIF1_BCLK_CTRL,
95340843aeaSCharles Keepax 		.playback = {
95440843aeaSCharles Keepax 			.stream_name = "AIF1 Playback",
95540843aeaSCharles Keepax 			.channels_min = 1,
95640843aeaSCharles Keepax 			.channels_max = 8,
95740843aeaSCharles Keepax 			.rates = WM8997_RATES,
95840843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
95940843aeaSCharles Keepax 		},
96040843aeaSCharles Keepax 		.capture = {
96140843aeaSCharles Keepax 			 .stream_name = "AIF1 Capture",
96240843aeaSCharles Keepax 			 .channels_min = 1,
96340843aeaSCharles Keepax 			 .channels_max = 8,
96440843aeaSCharles Keepax 			 .rates = WM8997_RATES,
96540843aeaSCharles Keepax 			 .formats = WM8997_FORMATS,
96640843aeaSCharles Keepax 		 },
96740843aeaSCharles Keepax 		.ops = &arizona_dai_ops,
96840843aeaSCharles Keepax 		.symmetric_rates = 1,
96940843aeaSCharles Keepax 	},
97040843aeaSCharles Keepax 	{
97140843aeaSCharles Keepax 		.name = "wm8997-aif2",
97240843aeaSCharles Keepax 		.id = 2,
97340843aeaSCharles Keepax 		.base = ARIZONA_AIF2_BCLK_CTRL,
97440843aeaSCharles Keepax 		.playback = {
97540843aeaSCharles Keepax 			.stream_name = "AIF2 Playback",
97640843aeaSCharles Keepax 			.channels_min = 1,
97740843aeaSCharles Keepax 			.channels_max = 2,
97840843aeaSCharles Keepax 			.rates = WM8997_RATES,
97940843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
98040843aeaSCharles Keepax 		},
98140843aeaSCharles Keepax 		.capture = {
98240843aeaSCharles Keepax 			 .stream_name = "AIF2 Capture",
98340843aeaSCharles Keepax 			 .channels_min = 1,
98440843aeaSCharles Keepax 			 .channels_max = 2,
98540843aeaSCharles Keepax 			 .rates = WM8997_RATES,
98640843aeaSCharles Keepax 			 .formats = WM8997_FORMATS,
98740843aeaSCharles Keepax 		 },
98840843aeaSCharles Keepax 		.ops = &arizona_dai_ops,
98940843aeaSCharles Keepax 		.symmetric_rates = 1,
99040843aeaSCharles Keepax 	},
99140843aeaSCharles Keepax 	{
99240843aeaSCharles Keepax 		.name = "wm8997-slim1",
99340843aeaSCharles Keepax 		.id = 3,
99440843aeaSCharles Keepax 		.playback = {
99540843aeaSCharles Keepax 			.stream_name = "Slim1 Playback",
99640843aeaSCharles Keepax 			.channels_min = 1,
99740843aeaSCharles Keepax 			.channels_max = 4,
99840843aeaSCharles Keepax 			.rates = WM8997_RATES,
99940843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
100040843aeaSCharles Keepax 		},
100140843aeaSCharles Keepax 		.capture = {
100240843aeaSCharles Keepax 			.stream_name = "Slim1 Capture",
100340843aeaSCharles Keepax 			.channels_min = 1,
100440843aeaSCharles Keepax 			.channels_max = 4,
100540843aeaSCharles Keepax 			.rates = WM8997_RATES,
100640843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
100740843aeaSCharles Keepax 		},
100840843aeaSCharles Keepax 		.ops = &arizona_simple_dai_ops,
100940843aeaSCharles Keepax 	},
101040843aeaSCharles Keepax 	{
101140843aeaSCharles Keepax 		.name = "wm8997-slim2",
101240843aeaSCharles Keepax 		.id = 4,
101340843aeaSCharles Keepax 		.playback = {
101440843aeaSCharles Keepax 			.stream_name = "Slim2 Playback",
101540843aeaSCharles Keepax 			.channels_min = 1,
101640843aeaSCharles Keepax 			.channels_max = 2,
101740843aeaSCharles Keepax 			.rates = WM8997_RATES,
101840843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
101940843aeaSCharles Keepax 		},
102040843aeaSCharles Keepax 		.capture = {
102140843aeaSCharles Keepax 			.stream_name = "Slim2 Capture",
102240843aeaSCharles Keepax 			.channels_min = 1,
102340843aeaSCharles Keepax 			.channels_max = 2,
102440843aeaSCharles Keepax 			.rates = WM8997_RATES,
102540843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
102640843aeaSCharles Keepax 		},
102740843aeaSCharles Keepax 		.ops = &arizona_simple_dai_ops,
102840843aeaSCharles Keepax 	},
102940843aeaSCharles Keepax 	{
103040843aeaSCharles Keepax 		.name = "wm8997-slim3",
103140843aeaSCharles Keepax 		.id = 5,
103240843aeaSCharles Keepax 		.playback = {
103340843aeaSCharles Keepax 			.stream_name = "Slim3 Playback",
103440843aeaSCharles Keepax 			.channels_min = 1,
103540843aeaSCharles Keepax 			.channels_max = 2,
103640843aeaSCharles Keepax 			.rates = WM8997_RATES,
103740843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
103840843aeaSCharles Keepax 		},
103940843aeaSCharles Keepax 		.capture = {
104040843aeaSCharles Keepax 			.stream_name = "Slim3 Capture",
104140843aeaSCharles Keepax 			.channels_min = 1,
104240843aeaSCharles Keepax 			.channels_max = 2,
104340843aeaSCharles Keepax 			.rates = WM8997_RATES,
104440843aeaSCharles Keepax 			.formats = WM8997_FORMATS,
104540843aeaSCharles Keepax 		},
104640843aeaSCharles Keepax 		.ops = &arizona_simple_dai_ops,
104740843aeaSCharles Keepax 	},
104840843aeaSCharles Keepax };
104940843aeaSCharles Keepax 
105040843aeaSCharles Keepax static int wm8997_codec_probe(struct snd_soc_codec *codec)
105140843aeaSCharles Keepax {
105240843aeaSCharles Keepax 	struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
105340843aeaSCharles Keepax 	int ret;
105440843aeaSCharles Keepax 
105540843aeaSCharles Keepax 	codec->control_data = priv->core.arizona->regmap;
105640843aeaSCharles Keepax 
105740843aeaSCharles Keepax 	ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
105840843aeaSCharles Keepax 	if (ret != 0)
105940843aeaSCharles Keepax 		return ret;
106040843aeaSCharles Keepax 
106140843aeaSCharles Keepax 	arizona_init_spk(codec);
106240843aeaSCharles Keepax 
106340843aeaSCharles Keepax 	snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS");
106440843aeaSCharles Keepax 
106540843aeaSCharles Keepax 	priv->core.arizona->dapm = &codec->dapm;
106640843aeaSCharles Keepax 
106740843aeaSCharles Keepax 	return 0;
106840843aeaSCharles Keepax }
106940843aeaSCharles Keepax 
107040843aeaSCharles Keepax static int wm8997_codec_remove(struct snd_soc_codec *codec)
107140843aeaSCharles Keepax {
107240843aeaSCharles Keepax 	struct wm8997_priv *priv = snd_soc_codec_get_drvdata(codec);
107340843aeaSCharles Keepax 
107440843aeaSCharles Keepax 	priv->core.arizona->dapm = NULL;
107540843aeaSCharles Keepax 
107640843aeaSCharles Keepax 	return 0;
107740843aeaSCharles Keepax }
107840843aeaSCharles Keepax 
107940843aeaSCharles Keepax #define WM8997_DIG_VU 0x0200
108040843aeaSCharles Keepax 
108140843aeaSCharles Keepax static unsigned int wm8997_digital_vu[] = {
108240843aeaSCharles Keepax 	ARIZONA_DAC_DIGITAL_VOLUME_1L,
108340843aeaSCharles Keepax 	ARIZONA_DAC_DIGITAL_VOLUME_1R,
108440843aeaSCharles Keepax 	ARIZONA_DAC_DIGITAL_VOLUME_3L,
108540843aeaSCharles Keepax 	ARIZONA_DAC_DIGITAL_VOLUME_4L,
108640843aeaSCharles Keepax 	ARIZONA_DAC_DIGITAL_VOLUME_5L,
108740843aeaSCharles Keepax 	ARIZONA_DAC_DIGITAL_VOLUME_5R,
108840843aeaSCharles Keepax };
108940843aeaSCharles Keepax 
109040843aeaSCharles Keepax static struct snd_soc_codec_driver soc_codec_dev_wm8997 = {
109140843aeaSCharles Keepax 	.probe = wm8997_codec_probe,
109240843aeaSCharles Keepax 	.remove = wm8997_codec_remove,
109340843aeaSCharles Keepax 
109440843aeaSCharles Keepax 	.idle_bias_off = true,
109540843aeaSCharles Keepax 
109640843aeaSCharles Keepax 	.set_sysclk = arizona_set_sysclk,
109740843aeaSCharles Keepax 	.set_pll = wm8997_set_fll,
109840843aeaSCharles Keepax 
109940843aeaSCharles Keepax 	.controls = wm8997_snd_controls,
110040843aeaSCharles Keepax 	.num_controls = ARRAY_SIZE(wm8997_snd_controls),
110140843aeaSCharles Keepax 	.dapm_widgets = wm8997_dapm_widgets,
110240843aeaSCharles Keepax 	.num_dapm_widgets = ARRAY_SIZE(wm8997_dapm_widgets),
110340843aeaSCharles Keepax 	.dapm_routes = wm8997_dapm_routes,
110440843aeaSCharles Keepax 	.num_dapm_routes = ARRAY_SIZE(wm8997_dapm_routes),
110540843aeaSCharles Keepax };
110640843aeaSCharles Keepax 
110740843aeaSCharles Keepax static int wm8997_probe(struct platform_device *pdev)
110840843aeaSCharles Keepax {
110940843aeaSCharles Keepax 	struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
111040843aeaSCharles Keepax 	struct wm8997_priv *wm8997;
111140843aeaSCharles Keepax 	int i;
111240843aeaSCharles Keepax 
111340843aeaSCharles Keepax 	wm8997 = devm_kzalloc(&pdev->dev, sizeof(struct wm8997_priv),
111440843aeaSCharles Keepax 			      GFP_KERNEL);
111540843aeaSCharles Keepax 	if (wm8997 == NULL)
111640843aeaSCharles Keepax 		return -ENOMEM;
111740843aeaSCharles Keepax 	platform_set_drvdata(pdev, wm8997);
111840843aeaSCharles Keepax 
111940843aeaSCharles Keepax 	wm8997->core.arizona = arizona;
112040843aeaSCharles Keepax 	wm8997->core.num_inputs = 4;
112140843aeaSCharles Keepax 
112240843aeaSCharles Keepax 	for (i = 0; i < ARRAY_SIZE(wm8997->fll); i++)
112340843aeaSCharles Keepax 		wm8997->fll[i].vco_mult = 1;
112440843aeaSCharles Keepax 
112540843aeaSCharles Keepax 	arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1,
112640843aeaSCharles Keepax 			 ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK,
112740843aeaSCharles Keepax 			 &wm8997->fll[0]);
112840843aeaSCharles Keepax 	arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1,
112940843aeaSCharles Keepax 			 ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK,
113040843aeaSCharles Keepax 			 &wm8997->fll[1]);
113140843aeaSCharles Keepax 
113240843aeaSCharles Keepax 	/* SR2 fixed at 8kHz, SR3 fixed at 16kHz */
113340843aeaSCharles Keepax 	regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2,
113440843aeaSCharles Keepax 			   ARIZONA_SAMPLE_RATE_2_MASK, 0x11);
113540843aeaSCharles Keepax 	regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3,
113640843aeaSCharles Keepax 			   ARIZONA_SAMPLE_RATE_3_MASK, 0x12);
113740843aeaSCharles Keepax 
113840843aeaSCharles Keepax 	for (i = 0; i < ARRAY_SIZE(wm8997_dai); i++)
113940843aeaSCharles Keepax 		arizona_init_dai(&wm8997->core, i);
114040843aeaSCharles Keepax 
114140843aeaSCharles Keepax 	/* Latch volume update bits */
114240843aeaSCharles Keepax 	for (i = 0; i < ARRAY_SIZE(wm8997_digital_vu); i++)
114340843aeaSCharles Keepax 		regmap_update_bits(arizona->regmap, wm8997_digital_vu[i],
114440843aeaSCharles Keepax 				   WM8997_DIG_VU, WM8997_DIG_VU);
114540843aeaSCharles Keepax 
114640843aeaSCharles Keepax 	pm_runtime_enable(&pdev->dev);
114740843aeaSCharles Keepax 	pm_runtime_idle(&pdev->dev);
114840843aeaSCharles Keepax 
114940843aeaSCharles Keepax 	return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm8997,
115040843aeaSCharles Keepax 				      wm8997_dai, ARRAY_SIZE(wm8997_dai));
115140843aeaSCharles Keepax }
115240843aeaSCharles Keepax 
115340843aeaSCharles Keepax static int wm8997_remove(struct platform_device *pdev)
115440843aeaSCharles Keepax {
115540843aeaSCharles Keepax 	snd_soc_unregister_codec(&pdev->dev);
115640843aeaSCharles Keepax 	pm_runtime_disable(&pdev->dev);
115740843aeaSCharles Keepax 
115840843aeaSCharles Keepax 	return 0;
115940843aeaSCharles Keepax }
116040843aeaSCharles Keepax 
116140843aeaSCharles Keepax static struct platform_driver wm8997_codec_driver = {
116240843aeaSCharles Keepax 	.driver = {
116340843aeaSCharles Keepax 		.name = "wm8997-codec",
116440843aeaSCharles Keepax 		.owner = THIS_MODULE,
116540843aeaSCharles Keepax 	},
116640843aeaSCharles Keepax 	.probe = wm8997_probe,
116740843aeaSCharles Keepax 	.remove = wm8997_remove,
116840843aeaSCharles Keepax };
116940843aeaSCharles Keepax 
117040843aeaSCharles Keepax module_platform_driver(wm8997_codec_driver);
117140843aeaSCharles Keepax 
117240843aeaSCharles Keepax MODULE_DESCRIPTION("ASoC WM8997 driver");
117340843aeaSCharles Keepax MODULE_AUTHOR("Charles Keepax <ckeepax@opensource.wolfsonmicro.com>");
117440843aeaSCharles Keepax MODULE_LICENSE("GPL");
117540843aeaSCharles Keepax MODULE_ALIAS("platform:wm8997-codec");
1176