blob: f3d96eae031a89f0804421d8c4008a06de7137cd [file] [log] [blame]
Mark Brown5c6af632012-07-09 19:09:41 +01001/*
2 * wm5110.c -- WM5110 ALSA SoC Audio driver
3 *
4 * Copyright 2012 Wolfson Microelectronics plc
5 *
6 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/moduleparam.h>
15#include <linux/init.h>
16#include <linux/delay.h>
17#include <linux/pm.h>
18#include <linux/pm_runtime.h>
19#include <linux/regmap.h>
20#include <linux/slab.h>
21#include <sound/core.h>
22#include <sound/pcm.h>
23#include <sound/pcm_params.h>
24#include <sound/soc.h>
25#include <sound/jack.h>
26#include <sound/initval.h>
27#include <sound/tlv.h>
28
29#include <linux/mfd/arizona/core.h>
30#include <linux/mfd/arizona/registers.h>
31
32#include "arizona.h"
Mark Brown9a3e1b82013-11-19 16:04:01 +000033#include "wm_adsp.h"
Mark Brown5c6af632012-07-09 19:09:41 +010034#include "wm5110.h"
35
Mark Brown9a3e1b82013-11-19 16:04:01 +000036#define WM5110_NUM_ADSP 4
37
Mark Brown5c6af632012-07-09 19:09:41 +010038struct wm5110_priv {
39 struct arizona_priv core;
40 struct arizona_fll fll[2];
41};
42
Mark Brown9a3e1b82013-11-19 16:04:01 +000043static const struct wm_adsp_region wm5110_dsp1_regions[] = {
44 { .type = WMFW_ADSP2_PM, .base = 0x100000 },
45 { .type = WMFW_ADSP2_ZM, .base = 0x180000 },
46 { .type = WMFW_ADSP2_XM, .base = 0x190000 },
47 { .type = WMFW_ADSP2_YM, .base = 0x1a8000 },
48};
49
50static const struct wm_adsp_region wm5110_dsp2_regions[] = {
51 { .type = WMFW_ADSP2_PM, .base = 0x200000 },
52 { .type = WMFW_ADSP2_ZM, .base = 0x280000 },
53 { .type = WMFW_ADSP2_XM, .base = 0x290000 },
54 { .type = WMFW_ADSP2_YM, .base = 0x2a8000 },
55};
56
57static const struct wm_adsp_region wm5110_dsp3_regions[] = {
58 { .type = WMFW_ADSP2_PM, .base = 0x300000 },
59 { .type = WMFW_ADSP2_ZM, .base = 0x380000 },
60 { .type = WMFW_ADSP2_XM, .base = 0x390000 },
61 { .type = WMFW_ADSP2_YM, .base = 0x3a8000 },
62};
63
64static const struct wm_adsp_region wm5110_dsp4_regions[] = {
65 { .type = WMFW_ADSP2_PM, .base = 0x400000 },
66 { .type = WMFW_ADSP2_ZM, .base = 0x480000 },
67 { .type = WMFW_ADSP2_XM, .base = 0x490000 },
68 { .type = WMFW_ADSP2_YM, .base = 0x4a8000 },
69};
70
71static const struct wm_adsp_region *wm5110_dsp_regions[] = {
72 wm5110_dsp1_regions,
73 wm5110_dsp2_regions,
74 wm5110_dsp3_regions,
75 wm5110_dsp4_regions,
76};
77
Charles Keepaxf69f86b2013-11-19 10:51:29 +000078static const struct reg_default wm5110_sysclk_revd_patch[] = {
79 { 0x3093, 0x1001 },
80 { 0x30E3, 0x1301 },
81 { 0x3133, 0x1201 },
82 { 0x3183, 0x1501 },
83 { 0x31D3, 0x1401 },
84};
85
86static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w,
87 struct snd_kcontrol *kcontrol, int event)
88{
89 struct snd_soc_codec *codec = w->codec;
90 struct arizona *arizona = dev_get_drvdata(codec->dev->parent);
91 struct regmap *regmap = codec->control_data;
92 const struct reg_default *patch = NULL;
93 int i, patch_size;
94
95 switch (arizona->rev) {
96 case 3:
97 patch = wm5110_sysclk_revd_patch;
98 patch_size = ARRAY_SIZE(wm5110_sysclk_revd_patch);
99 break;
100 default:
101 return 0;
102 }
103
104 switch (event) {
105 case SND_SOC_DAPM_POST_PMU:
106 if (patch)
107 for (i = 0; i < patch_size; i++)
Mark Brown959e4082013-12-12 00:49:56 +0000108 regmap_write_async(regmap, patch[i].reg,
109 patch[i].def);
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000110 break;
111
112 default:
113 break;
114 }
115
116 return 0;
117}
118
Mark Brown5c6af632012-07-09 19:09:41 +0100119static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0);
120static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0);
121static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0);
122static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0);
Mark Brownbd7fe242012-12-18 13:53:26 +0000123static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0);
124
125#define WM5110_NG_SRC(name, base) \
126 SOC_SINGLE(name " NG HPOUT1L Switch", base, 0, 1, 0), \
127 SOC_SINGLE(name " NG HPOUT1R Switch", base, 1, 1, 0), \
128 SOC_SINGLE(name " NG HPOUT2L Switch", base, 2, 1, 0), \
129 SOC_SINGLE(name " NG HPOUT2R Switch", base, 3, 1, 0), \
130 SOC_SINGLE(name " NG HPOUT3L Switch", base, 4, 1, 0), \
131 SOC_SINGLE(name " NG HPOUT3R Switch", base, 5, 1, 0), \
132 SOC_SINGLE(name " NG SPKOUTL Switch", base, 6, 1, 0), \
133 SOC_SINGLE(name " NG SPKOUTR Switch", base, 7, 1, 0), \
134 SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \
135 SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0), \
136 SOC_SINGLE(name " NG SPKDAT2L Switch", base, 10, 1, 0), \
137 SOC_SINGLE(name " NG SPKDAT2R Switch", base, 11, 1, 0)
Mark Brown5c6af632012-07-09 19:09:41 +0100138
139static const struct snd_kcontrol_new wm5110_snd_controls[] = {
Charles Keepaxc7f38432013-08-06 17:03:55 +0100140SOC_ENUM("IN1 OSR", arizona_in_dmic_osr[0]),
141SOC_ENUM("IN2 OSR", arizona_in_dmic_osr[1]),
142SOC_ENUM("IN3 OSR", arizona_in_dmic_osr[2]),
143SOC_ENUM("IN4 OSR", arizona_in_dmic_osr[3]),
Mark Brown5c6af632012-07-09 19:09:41 +0100144
Mark Brown02482da2012-12-14 15:18:30 +0900145SOC_SINGLE_RANGE_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL,
146 ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
147SOC_SINGLE_RANGE_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL,
148 ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
149SOC_SINGLE_RANGE_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL,
150 ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
151SOC_SINGLE_RANGE_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL,
152 ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
153SOC_SINGLE_RANGE_TLV("IN3L Volume", ARIZONA_IN3L_CONTROL,
154 ARIZONA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
155SOC_SINGLE_RANGE_TLV("IN3R Volume", ARIZONA_IN3R_CONTROL,
156 ARIZONA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv),
Mark Brown5c6af632012-07-09 19:09:41 +0100157
Charles Keepax254dc322013-11-19 16:04:03 +0000158SOC_ENUM("IN HPF Cutoff Frequency", arizona_in_hpf_cut_enum),
159
160SOC_SINGLE("IN1L HPF Switch", ARIZONA_IN1L_CONTROL,
161 ARIZONA_IN1L_HPF_SHIFT, 1, 0),
162SOC_SINGLE("IN1R HPF Switch", ARIZONA_IN1R_CONTROL,
163 ARIZONA_IN1R_HPF_SHIFT, 1, 0),
164SOC_SINGLE("IN2L HPF Switch", ARIZONA_IN2L_CONTROL,
165 ARIZONA_IN2L_HPF_SHIFT, 1, 0),
166SOC_SINGLE("IN2R HPF Switch", ARIZONA_IN2R_CONTROL,
167 ARIZONA_IN2R_HPF_SHIFT, 1, 0),
168SOC_SINGLE("IN3L HPF Switch", ARIZONA_IN3L_CONTROL,
169 ARIZONA_IN3L_HPF_SHIFT, 1, 0),
170SOC_SINGLE("IN3R HPF Switch", ARIZONA_IN3R_CONTROL,
171 ARIZONA_IN3R_HPF_SHIFT, 1, 0),
172SOC_SINGLE("IN4L HPF Switch", ARIZONA_IN4L_CONTROL,
173 ARIZONA_IN4L_HPF_SHIFT, 1, 0),
174SOC_SINGLE("IN4R HPF Switch", ARIZONA_IN4R_CONTROL,
175 ARIZONA_IN4R_HPF_SHIFT, 1, 0),
176
Mark Brown02482da2012-12-14 15:18:30 +0900177SOC_SINGLE_TLV("IN1L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1L,
178 ARIZONA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
179SOC_SINGLE_TLV("IN1R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1R,
180 ARIZONA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
181SOC_SINGLE_TLV("IN2L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2L,
182 ARIZONA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
183SOC_SINGLE_TLV("IN2R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2R,
184 ARIZONA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
185SOC_SINGLE_TLV("IN3L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3L,
186 ARIZONA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
187SOC_SINGLE_TLV("IN3R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3R,
188 ARIZONA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
189SOC_SINGLE_TLV("IN4L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4L,
190 ARIZONA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
191SOC_SINGLE_TLV("IN4R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4R,
192 ARIZONA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv),
Mark Brown5c6af632012-07-09 19:09:41 +0100193
Mark Browna1abfa82012-12-09 12:50:05 +0900194SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp),
195SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp),
196
Mark Brown5c6af632012-07-09 19:09:41 +0100197ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE),
198ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE),
199ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE),
200ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE),
201
Richard Fitzgerald12850b82013-11-13 13:01:49 +0000202SND_SOC_BYTES_MASK("EQ1 Coefficients", ARIZONA_EQ1_1, 21,
Mark Brown56fd4602012-12-05 16:38:12 +0900203 ARIZONA_EQ1_ENA_MASK),
Richard Fitzgerald12850b82013-11-13 13:01:49 +0000204SND_SOC_BYTES_MASK("EQ2 Coefficients", ARIZONA_EQ2_1, 21,
Mark Brown56fd4602012-12-05 16:38:12 +0900205 ARIZONA_EQ2_ENA_MASK),
Richard Fitzgerald12850b82013-11-13 13:01:49 +0000206SND_SOC_BYTES_MASK("EQ3 Coefficients", ARIZONA_EQ3_1, 21,
Mark Brown56fd4602012-12-05 16:38:12 +0900207 ARIZONA_EQ3_ENA_MASK),
Richard Fitzgerald12850b82013-11-13 13:01:49 +0000208SND_SOC_BYTES_MASK("EQ4 Coefficients", ARIZONA_EQ4_1, 21,
Mark Brown56fd4602012-12-05 16:38:12 +0900209 ARIZONA_EQ4_ENA_MASK),
210
Mark Brown5c6af632012-07-09 19:09:41 +0100211SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT,
212 24, 0, eq_tlv),
213SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT,
214 24, 0, eq_tlv),
215SOC_SINGLE_TLV("EQ1 B3 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B3_GAIN_SHIFT,
216 24, 0, eq_tlv),
217SOC_SINGLE_TLV("EQ1 B4 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B4_GAIN_SHIFT,
218 24, 0, eq_tlv),
219SOC_SINGLE_TLV("EQ1 B5 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B5_GAIN_SHIFT,
220 24, 0, eq_tlv),
221
222SOC_SINGLE_TLV("EQ2 B1 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B1_GAIN_SHIFT,
223 24, 0, eq_tlv),
224SOC_SINGLE_TLV("EQ2 B2 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B2_GAIN_SHIFT,
225 24, 0, eq_tlv),
226SOC_SINGLE_TLV("EQ2 B3 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B3_GAIN_SHIFT,
227 24, 0, eq_tlv),
228SOC_SINGLE_TLV("EQ2 B4 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B4_GAIN_SHIFT,
229 24, 0, eq_tlv),
230SOC_SINGLE_TLV("EQ2 B5 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B5_GAIN_SHIFT,
231 24, 0, eq_tlv),
232
233SOC_SINGLE_TLV("EQ3 B1 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B1_GAIN_SHIFT,
234 24, 0, eq_tlv),
235SOC_SINGLE_TLV("EQ3 B2 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B2_GAIN_SHIFT,
236 24, 0, eq_tlv),
237SOC_SINGLE_TLV("EQ3 B3 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B3_GAIN_SHIFT,
238 24, 0, eq_tlv),
239SOC_SINGLE_TLV("EQ3 B4 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B4_GAIN_SHIFT,
240 24, 0, eq_tlv),
241SOC_SINGLE_TLV("EQ3 B5 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B5_GAIN_SHIFT,
242 24, 0, eq_tlv),
243
244SOC_SINGLE_TLV("EQ4 B1 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B1_GAIN_SHIFT,
245 24, 0, eq_tlv),
246SOC_SINGLE_TLV("EQ4 B2 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B2_GAIN_SHIFT,
247 24, 0, eq_tlv),
248SOC_SINGLE_TLV("EQ4 B3 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B3_GAIN_SHIFT,
249 24, 0, eq_tlv),
250SOC_SINGLE_TLV("EQ4 B4 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B4_GAIN_SHIFT,
251 24, 0, eq_tlv),
252SOC_SINGLE_TLV("EQ4 B5 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B5_GAIN_SHIFT,
253 24, 0, eq_tlv),
254
255ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE),
256ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE),
257ARIZONA_MIXER_CONTROLS("DRC2L", ARIZONA_DRC2LMIX_INPUT_1_SOURCE),
258ARIZONA_MIXER_CONTROLS("DRC2R", ARIZONA_DRC2RMIX_INPUT_1_SOURCE),
259
260SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5,
261 ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA),
262SND_SOC_BYTES_MASK("DRC2", ARIZONA_DRC2_CTRL1, 5,
263 ARIZONA_DRC2R_ENA | ARIZONA_DRC2L_ENA),
264
265ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE),
266ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE),
267ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE),
268ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE),
269
Mark Brownd4d1eaa2012-12-05 16:38:30 +0900270SND_SOC_BYTES("LHPF1 Coefficients", ARIZONA_HPLPF1_2, 1),
271SND_SOC_BYTES("LHPF2 Coefficients", ARIZONA_HPLPF2_2, 1),
272SND_SOC_BYTES("LHPF3 Coefficients", ARIZONA_HPLPF3_2, 1),
273SND_SOC_BYTES("LHPF4 Coefficients", ARIZONA_HPLPF4_2, 1),
274
Mark Brown5c6af632012-07-09 19:09:41 +0100275SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode),
276SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode),
277SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode),
278SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode),
279
Charles Keepax0da2e5b2013-11-19 16:04:02 +0000280SOC_VALUE_ENUM("ISRC1 FSL", arizona_isrc_fsl[0]),
281SOC_VALUE_ENUM("ISRC2 FSL", arizona_isrc_fsl[1]),
282SOC_VALUE_ENUM("ISRC3 FSL", arizona_isrc_fsl[2]),
Charles Keepaxfbedc8c2013-12-19 09:30:12 +0000283SOC_VALUE_ENUM("ISRC1 FSH", arizona_isrc_fsh[0]),
284SOC_VALUE_ENUM("ISRC2 FSH", arizona_isrc_fsh[1]),
285SOC_VALUE_ENUM("ISRC3 FSH", arizona_isrc_fsh[2]),
Charles Keepax56d37d82013-12-19 09:30:13 +0000286SOC_VALUE_ENUM("ASRC RATE 1", arizona_asrc_rate1),
Charles Keepax0da2e5b2013-11-19 16:04:02 +0000287
Mark Brown35d38892012-08-26 13:50:48 -0700288ARIZONA_MIXER_CONTROLS("DSP1L", ARIZONA_DSP1LMIX_INPUT_1_SOURCE),
289ARIZONA_MIXER_CONTROLS("DSP1R", ARIZONA_DSP1RMIX_INPUT_1_SOURCE),
290ARIZONA_MIXER_CONTROLS("DSP2L", ARIZONA_DSP2LMIX_INPUT_1_SOURCE),
291ARIZONA_MIXER_CONTROLS("DSP2R", ARIZONA_DSP2RMIX_INPUT_1_SOURCE),
292ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE),
293ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE),
294ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE),
Charles Keepax39d4ecd2013-05-24 11:38:24 +0100295ARIZONA_MIXER_CONTROLS("DSP4R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE),
Mark Brown35d38892012-08-26 13:50:48 -0700296
Mark Brown5c6af632012-07-09 19:09:41 +0100297ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE),
298ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE),
299
300SOC_SINGLE_TLV("Noise Generator Volume", ARIZONA_COMFORT_NOISE_GENERATOR,
301 ARIZONA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, noise_tlv),
302
303ARIZONA_MIXER_CONTROLS("HPOUT1L", ARIZONA_OUT1LMIX_INPUT_1_SOURCE),
304ARIZONA_MIXER_CONTROLS("HPOUT1R", ARIZONA_OUT1RMIX_INPUT_1_SOURCE),
305ARIZONA_MIXER_CONTROLS("HPOUT2L", ARIZONA_OUT2LMIX_INPUT_1_SOURCE),
306ARIZONA_MIXER_CONTROLS("HPOUT2R", ARIZONA_OUT2RMIX_INPUT_1_SOURCE),
Mark Brown35d38892012-08-26 13:50:48 -0700307ARIZONA_MIXER_CONTROLS("HPOUT3L", ARIZONA_OUT3LMIX_INPUT_1_SOURCE),
308ARIZONA_MIXER_CONTROLS("HPOUT3R", ARIZONA_OUT3RMIX_INPUT_1_SOURCE),
Mark Brown5c6af632012-07-09 19:09:41 +0100309ARIZONA_MIXER_CONTROLS("SPKOUTL", ARIZONA_OUT4LMIX_INPUT_1_SOURCE),
310ARIZONA_MIXER_CONTROLS("SPKOUTR", ARIZONA_OUT4RMIX_INPUT_1_SOURCE),
311ARIZONA_MIXER_CONTROLS("SPKDAT1L", ARIZONA_OUT5LMIX_INPUT_1_SOURCE),
312ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE),
313ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE),
314ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE),
315
316SOC_SINGLE("HPOUT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_1L,
317 ARIZONA_OUT1_OSR_SHIFT, 1, 0),
Charles Keepax5752ec92013-02-15 10:37:27 +0000318SOC_SINGLE("HPOUT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_2L,
Mark Brown5c6af632012-07-09 19:09:41 +0100319 ARIZONA_OUT2_OSR_SHIFT, 1, 0),
Charles Keepax5752ec92013-02-15 10:37:27 +0000320SOC_SINGLE("HPOUT3 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_3L,
Mark Brown5c6af632012-07-09 19:09:41 +0100321 ARIZONA_OUT3_OSR_SHIFT, 1, 0),
322SOC_SINGLE("Speaker High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_4L,
323 ARIZONA_OUT4_OSR_SHIFT, 1, 0),
324SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L,
325 ARIZONA_OUT5_OSR_SHIFT, 1, 0),
326SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L,
327 ARIZONA_OUT6_OSR_SHIFT, 1, 0),
328
329SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L,
330 ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1),
Charles Keepax5752ec92013-02-15 10:37:27 +0000331SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L,
Mark Brown5c6af632012-07-09 19:09:41 +0100332 ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1),
Charles Keepax5752ec92013-02-15 10:37:27 +0000333SOC_DOUBLE_R("HPOUT3 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L,
Mark Brown35d38892012-08-26 13:50:48 -0700334 ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_MUTE_SHIFT, 1, 1),
Mark Brown5c6af632012-07-09 19:09:41 +0100335SOC_DOUBLE_R("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L,
336 ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_MUTE_SHIFT, 1, 1),
337SOC_DOUBLE_R("SPKDAT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_5L,
338 ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_MUTE_SHIFT, 1, 1),
339SOC_DOUBLE_R("SPKDAT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_6L,
340 ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_MUTE_SHIFT, 1, 1),
341
342SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L,
343 ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT,
344 0xbf, 0, digital_tlv),
Charles Keepax5752ec92013-02-15 10:37:27 +0000345SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L,
Mark Brown5c6af632012-07-09 19:09:41 +0100346 ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT,
347 0xbf, 0, digital_tlv),
Charles Keepax5752ec92013-02-15 10:37:27 +0000348SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L,
Mark Brown35d38892012-08-26 13:50:48 -0700349 ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_VOL_SHIFT,
350 0xbf, 0, digital_tlv),
Mark Brown5c6af632012-07-09 19:09:41 +0100351SOC_DOUBLE_R_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L,
352 ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_VOL_SHIFT,
353 0xbf, 0, digital_tlv),
354SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_5L,
355 ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_VOL_SHIFT,
356 0xbf, 0, digital_tlv),
357SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_6L,
358 ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT,
359 0xbf, 0, digital_tlv),
360
361SOC_DOUBLE_R_RANGE_TLV("HPOUT1 Volume", ARIZONA_OUTPUT_PATH_CONFIG_1L,
362 ARIZONA_OUTPUT_PATH_CONFIG_1R,
363 ARIZONA_OUT1L_PGA_VOL_SHIFT,
364 0x34, 0x40, 0, ana_tlv),
Charles Keepax5752ec92013-02-15 10:37:27 +0000365SOC_DOUBLE_R_RANGE_TLV("HPOUT2 Volume", ARIZONA_OUTPUT_PATH_CONFIG_2L,
Mark Brown5c6af632012-07-09 19:09:41 +0100366 ARIZONA_OUTPUT_PATH_CONFIG_2R,
367 ARIZONA_OUT2L_PGA_VOL_SHIFT,
368 0x34, 0x40, 0, ana_tlv),
Charles Keepax5752ec92013-02-15 10:37:27 +0000369SOC_DOUBLE_R_RANGE_TLV("HPOUT3 Volume", ARIZONA_OUTPUT_PATH_CONFIG_3L,
Mark Brown35d38892012-08-26 13:50:48 -0700370 ARIZONA_OUTPUT_PATH_CONFIG_3R,
371 ARIZONA_OUT3L_PGA_VOL_SHIFT, 0x34, 0x40, 0, ana_tlv),
Mark Brown5c6af632012-07-09 19:09:41 +0100372
373SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT,
374 ARIZONA_SPK1R_MUTE_SHIFT, 1, 1),
375SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT,
376 ARIZONA_SPK2R_MUTE_SHIFT, 1, 1),
377
Charles Keepaxa4c0d272013-12-19 09:11:02 +0000378SOC_DOUBLE("HPOUT1 DRE Switch", ARIZONA_DRE_ENABLE,
379 ARIZONA_DRE1L_ENA_SHIFT, ARIZONA_DRE1R_ENA_SHIFT, 1, 0),
380SOC_DOUBLE("HPOUT2 DRE Switch", ARIZONA_DRE_ENABLE,
381 ARIZONA_DRE2L_ENA_SHIFT, ARIZONA_DRE2R_ENA_SHIFT, 1, 0),
382SOC_DOUBLE("HPOUT3 DRE Switch", ARIZONA_DRE_ENABLE,
383 ARIZONA_DRE3L_ENA_SHIFT, ARIZONA_DRE3R_ENA_SHIFT, 1, 0),
384
Mark Browna1abfa82012-12-09 12:50:05 +0900385SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp),
386SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp),
387
Mark Brownbd7fe242012-12-18 13:53:26 +0000388SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL,
389 ARIZONA_NGATE_ENA_SHIFT, 1, 0),
390SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL,
391 ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv),
392SOC_ENUM("Noise Gate Hold", arizona_ng_hold),
393
394WM5110_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L),
395WM5110_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R),
396WM5110_NG_SRC("HPOUT2L", ARIZONA_NOISE_GATE_SELECT_2L),
397WM5110_NG_SRC("HPOUT2R", ARIZONA_NOISE_GATE_SELECT_2R),
398WM5110_NG_SRC("HPOUT3L", ARIZONA_NOISE_GATE_SELECT_3L),
399WM5110_NG_SRC("HPOUT3R", ARIZONA_NOISE_GATE_SELECT_3R),
400WM5110_NG_SRC("SPKOUTL", ARIZONA_NOISE_GATE_SELECT_4L),
401WM5110_NG_SRC("SPKOUTR", ARIZONA_NOISE_GATE_SELECT_4R),
402WM5110_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L),
403WM5110_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R),
404WM5110_NG_SRC("SPKDAT2L", ARIZONA_NOISE_GATE_SELECT_6L),
405WM5110_NG_SRC("SPKDAT2R", ARIZONA_NOISE_GATE_SELECT_6R),
406
Mark Brown5c6af632012-07-09 19:09:41 +0100407ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE),
408ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE),
409ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE),
410ARIZONA_MIXER_CONTROLS("AIF1TX4", ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE),
411ARIZONA_MIXER_CONTROLS("AIF1TX5", ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE),
412ARIZONA_MIXER_CONTROLS("AIF1TX6", ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE),
413ARIZONA_MIXER_CONTROLS("AIF1TX7", ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE),
414ARIZONA_MIXER_CONTROLS("AIF1TX8", ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE),
415
416ARIZONA_MIXER_CONTROLS("AIF2TX1", ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE),
417ARIZONA_MIXER_CONTROLS("AIF2TX2", ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +0000418ARIZONA_MIXER_CONTROLS("AIF2TX3", ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE),
419ARIZONA_MIXER_CONTROLS("AIF2TX4", ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE),
420ARIZONA_MIXER_CONTROLS("AIF2TX5", ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE),
421ARIZONA_MIXER_CONTROLS("AIF2TX6", ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE),
Mark Brown5c6af632012-07-09 19:09:41 +0100422
423ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE),
424ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE),
Mark Brownd217f902013-05-17 13:29:05 +0100425
426ARIZONA_MIXER_CONTROLS("SLIMTX1", ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE),
427ARIZONA_MIXER_CONTROLS("SLIMTX2", ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE),
428ARIZONA_MIXER_CONTROLS("SLIMTX3", ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE),
429ARIZONA_MIXER_CONTROLS("SLIMTX4", ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE),
430ARIZONA_MIXER_CONTROLS("SLIMTX5", ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE),
431ARIZONA_MIXER_CONTROLS("SLIMTX6", ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE),
432ARIZONA_MIXER_CONTROLS("SLIMTX7", ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE),
433ARIZONA_MIXER_CONTROLS("SLIMTX8", ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE),
Mark Brown5c6af632012-07-09 19:09:41 +0100434};
435
436ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE);
437ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE);
438ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE);
439ARIZONA_MIXER_ENUMS(EQ4, ARIZONA_EQ4MIX_INPUT_1_SOURCE);
440
441ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE);
442ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE);
443ARIZONA_MIXER_ENUMS(DRC2L, ARIZONA_DRC2LMIX_INPUT_1_SOURCE);
444ARIZONA_MIXER_ENUMS(DRC2R, ARIZONA_DRC2RMIX_INPUT_1_SOURCE);
445
446ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE);
447ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE);
448ARIZONA_MIXER_ENUMS(LHPF3, ARIZONA_HPLP3MIX_INPUT_1_SOURCE);
449ARIZONA_MIXER_ENUMS(LHPF4, ARIZONA_HPLP4MIX_INPUT_1_SOURCE);
450
Mark Brown9a3e1b82013-11-19 16:04:01 +0000451ARIZONA_MIXER_ENUMS(DSP1L, ARIZONA_DSP1LMIX_INPUT_1_SOURCE);
452ARIZONA_MIXER_ENUMS(DSP1R, ARIZONA_DSP1RMIX_INPUT_1_SOURCE);
453ARIZONA_DSP_AUX_ENUMS(DSP1, ARIZONA_DSP1AUX1MIX_INPUT_1_SOURCE);
454
455ARIZONA_MIXER_ENUMS(DSP2L, ARIZONA_DSP2LMIX_INPUT_1_SOURCE);
456ARIZONA_MIXER_ENUMS(DSP2R, ARIZONA_DSP2RMIX_INPUT_1_SOURCE);
457ARIZONA_DSP_AUX_ENUMS(DSP2, ARIZONA_DSP2AUX1MIX_INPUT_1_SOURCE);
458
459ARIZONA_MIXER_ENUMS(DSP3L, ARIZONA_DSP3LMIX_INPUT_1_SOURCE);
460ARIZONA_MIXER_ENUMS(DSP3R, ARIZONA_DSP3RMIX_INPUT_1_SOURCE);
461ARIZONA_DSP_AUX_ENUMS(DSP3, ARIZONA_DSP3AUX1MIX_INPUT_1_SOURCE);
462
463ARIZONA_MIXER_ENUMS(DSP4L, ARIZONA_DSP4LMIX_INPUT_1_SOURCE);
464ARIZONA_MIXER_ENUMS(DSP4R, ARIZONA_DSP4RMIX_INPUT_1_SOURCE);
465ARIZONA_DSP_AUX_ENUMS(DSP4, ARIZONA_DSP4AUX1MIX_INPUT_1_SOURCE);
466
Mark Brown5c6af632012-07-09 19:09:41 +0100467ARIZONA_MIXER_ENUMS(Mic, ARIZONA_MICMIX_INPUT_1_SOURCE);
468ARIZONA_MIXER_ENUMS(Noise, ARIZONA_NOISEMIX_INPUT_1_SOURCE);
469
470ARIZONA_MIXER_ENUMS(PWM1, ARIZONA_PWM1MIX_INPUT_1_SOURCE);
471ARIZONA_MIXER_ENUMS(PWM2, ARIZONA_PWM2MIX_INPUT_1_SOURCE);
472
473ARIZONA_MIXER_ENUMS(OUT1L, ARIZONA_OUT1LMIX_INPUT_1_SOURCE);
474ARIZONA_MIXER_ENUMS(OUT1R, ARIZONA_OUT1RMIX_INPUT_1_SOURCE);
475ARIZONA_MIXER_ENUMS(OUT2L, ARIZONA_OUT2LMIX_INPUT_1_SOURCE);
476ARIZONA_MIXER_ENUMS(OUT2R, ARIZONA_OUT2RMIX_INPUT_1_SOURCE);
Mark Brown35d38892012-08-26 13:50:48 -0700477ARIZONA_MIXER_ENUMS(OUT3L, ARIZONA_OUT3LMIX_INPUT_1_SOURCE);
478ARIZONA_MIXER_ENUMS(OUT3R, ARIZONA_OUT3RMIX_INPUT_1_SOURCE);
Mark Brown5c6af632012-07-09 19:09:41 +0100479ARIZONA_MIXER_ENUMS(SPKOUTL, ARIZONA_OUT4LMIX_INPUT_1_SOURCE);
480ARIZONA_MIXER_ENUMS(SPKOUTR, ARIZONA_OUT4RMIX_INPUT_1_SOURCE);
481ARIZONA_MIXER_ENUMS(SPKDAT1L, ARIZONA_OUT5LMIX_INPUT_1_SOURCE);
482ARIZONA_MIXER_ENUMS(SPKDAT1R, ARIZONA_OUT5RMIX_INPUT_1_SOURCE);
483ARIZONA_MIXER_ENUMS(SPKDAT2L, ARIZONA_OUT6LMIX_INPUT_1_SOURCE);
484ARIZONA_MIXER_ENUMS(SPKDAT2R, ARIZONA_OUT6RMIX_INPUT_1_SOURCE);
485
486ARIZONA_MIXER_ENUMS(AIF1TX1, ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE);
487ARIZONA_MIXER_ENUMS(AIF1TX2, ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE);
488ARIZONA_MIXER_ENUMS(AIF1TX3, ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE);
489ARIZONA_MIXER_ENUMS(AIF1TX4, ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE);
490ARIZONA_MIXER_ENUMS(AIF1TX5, ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE);
491ARIZONA_MIXER_ENUMS(AIF1TX6, ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE);
492ARIZONA_MIXER_ENUMS(AIF1TX7, ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE);
493ARIZONA_MIXER_ENUMS(AIF1TX8, ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE);
494
495ARIZONA_MIXER_ENUMS(AIF2TX1, ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE);
496ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE);
Richard Fitzgeralde64001e2013-11-20 13:17:07 +0000497ARIZONA_MIXER_ENUMS(AIF2TX3, ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE);
498ARIZONA_MIXER_ENUMS(AIF2TX4, ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE);
499ARIZONA_MIXER_ENUMS(AIF2TX5, ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE);
500ARIZONA_MIXER_ENUMS(AIF2TX6, ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE);
Mark Brown5c6af632012-07-09 19:09:41 +0100501
502ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE);
503ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE);
504
Mark Brownd217f902013-05-17 13:29:05 +0100505ARIZONA_MIXER_ENUMS(SLIMTX1, ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE);
506ARIZONA_MIXER_ENUMS(SLIMTX2, ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE);
507ARIZONA_MIXER_ENUMS(SLIMTX3, ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE);
508ARIZONA_MIXER_ENUMS(SLIMTX4, ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE);
509ARIZONA_MIXER_ENUMS(SLIMTX5, ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE);
510ARIZONA_MIXER_ENUMS(SLIMTX6, ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE);
511ARIZONA_MIXER_ENUMS(SLIMTX7, ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE);
512ARIZONA_MIXER_ENUMS(SLIMTX8, ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE);
513
Charles Keepax5886c742012-11-13 16:40:34 +0000514ARIZONA_MUX_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE);
515ARIZONA_MUX_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE);
516ARIZONA_MUX_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE);
517ARIZONA_MUX_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE);
Mark Brown5c6af632012-07-09 19:09:41 +0100518
Charles Keepax0da2e5b2013-11-19 16:04:02 +0000519ARIZONA_MUX_ENUMS(ISRC1INT1, ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE);
520ARIZONA_MUX_ENUMS(ISRC1INT2, ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE);
521ARIZONA_MUX_ENUMS(ISRC1INT3, ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE);
522ARIZONA_MUX_ENUMS(ISRC1INT4, ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE);
523
524ARIZONA_MUX_ENUMS(ISRC1DEC1, ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE);
525ARIZONA_MUX_ENUMS(ISRC1DEC2, ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE);
526ARIZONA_MUX_ENUMS(ISRC1DEC3, ARIZONA_ISRC1DEC3MIX_INPUT_1_SOURCE);
527ARIZONA_MUX_ENUMS(ISRC1DEC4, ARIZONA_ISRC1DEC4MIX_INPUT_1_SOURCE);
528
529ARIZONA_MUX_ENUMS(ISRC2INT1, ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE);
530ARIZONA_MUX_ENUMS(ISRC2INT2, ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE);
531ARIZONA_MUX_ENUMS(ISRC2INT3, ARIZONA_ISRC2INT3MIX_INPUT_1_SOURCE);
532ARIZONA_MUX_ENUMS(ISRC2INT4, ARIZONA_ISRC2INT4MIX_INPUT_1_SOURCE);
533
534ARIZONA_MUX_ENUMS(ISRC2DEC1, ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE);
535ARIZONA_MUX_ENUMS(ISRC2DEC2, ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE);
536ARIZONA_MUX_ENUMS(ISRC2DEC3, ARIZONA_ISRC2DEC3MIX_INPUT_1_SOURCE);
537ARIZONA_MUX_ENUMS(ISRC2DEC4, ARIZONA_ISRC2DEC4MIX_INPUT_1_SOURCE);
538
539ARIZONA_MUX_ENUMS(ISRC3INT1, ARIZONA_ISRC3INT1MIX_INPUT_1_SOURCE);
540ARIZONA_MUX_ENUMS(ISRC3INT2, ARIZONA_ISRC3INT2MIX_INPUT_1_SOURCE);
541ARIZONA_MUX_ENUMS(ISRC3INT3, ARIZONA_ISRC3INT3MIX_INPUT_1_SOURCE);
542ARIZONA_MUX_ENUMS(ISRC3INT4, ARIZONA_ISRC3INT4MIX_INPUT_1_SOURCE);
543
544ARIZONA_MUX_ENUMS(ISRC3DEC1, ARIZONA_ISRC3DEC1MIX_INPUT_1_SOURCE);
545ARIZONA_MUX_ENUMS(ISRC3DEC2, ARIZONA_ISRC3DEC2MIX_INPUT_1_SOURCE);
546ARIZONA_MUX_ENUMS(ISRC3DEC3, ARIZONA_ISRC3DEC3MIX_INPUT_1_SOURCE);
547ARIZONA_MUX_ENUMS(ISRC3DEC4, ARIZONA_ISRC3DEC4MIX_INPUT_1_SOURCE);
548
Mark Browndac8f1c2012-08-26 13:51:27 -0700549static const char *wm5110_aec_loopback_texts[] = {
550 "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R",
551 "SPKOUTL", "SPKOUTR", "SPKDAT1L", "SPKDAT1R", "SPKDAT2L", "SPKDAT2R",
552};
553
554static const unsigned int wm5110_aec_loopback_values[] = {
555 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
556};
557
558static const struct soc_enum wm5110_aec_loopback =
559 SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1,
Mark Brown7d5cb4f2013-01-11 13:32:00 +0000560 ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf,
Mark Browndac8f1c2012-08-26 13:51:27 -0700561 ARRAY_SIZE(wm5110_aec_loopback_texts),
562 wm5110_aec_loopback_texts,
563 wm5110_aec_loopback_values);
564
565static const struct snd_kcontrol_new wm5110_aec_loopback_mux =
566 SOC_DAPM_VALUE_ENUM("AEC Loopback", wm5110_aec_loopback);
567
Mark Brown5c6af632012-07-09 19:09:41 +0100568static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = {
569SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT,
Charles Keepaxf69f86b2013-11-19 10:51:29 +0000570 0, wm5110_sysclk_ev, SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100571SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1,
572 ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0),
Mark Brown94237f82012-08-09 19:14:43 +0100573SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK,
574 ARIZONA_OPCLK_ENA_SHIFT, 0, NULL, 0),
575SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", ARIZONA_OUTPUT_ASYNC_CLOCK,
576 ARIZONA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0),
Mark Brown5c6af632012-07-09 19:09:41 +0100577
Mark Brown822b4b82012-09-07 10:54:32 +0800578SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0),
579SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD3", 0, 0),
580SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD", 20, 0),
Mark Brown76dbd2a2012-09-07 12:58:54 +0800581SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS),
Mark Brown822b4b82012-09-07 10:54:32 +0800582SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDL", 0, 0),
583SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0),
Mark Brown5c6af632012-07-09 19:09:41 +0100584
585SND_SOC_DAPM_SIGGEN("TONE"),
586SND_SOC_DAPM_SIGGEN("NOISE"),
Mark Brown2f76e682012-11-26 21:18:18 +0000587SND_SOC_DAPM_SIGGEN("HAPTICS"),
Mark Brown5c6af632012-07-09 19:09:41 +0100588
589SND_SOC_DAPM_INPUT("IN1L"),
590SND_SOC_DAPM_INPUT("IN1R"),
591SND_SOC_DAPM_INPUT("IN2L"),
592SND_SOC_DAPM_INPUT("IN2R"),
593SND_SOC_DAPM_INPUT("IN3L"),
594SND_SOC_DAPM_INPUT("IN3R"),
595SND_SOC_DAPM_INPUT("IN4L"),
596SND_SOC_DAPM_INPUT("IN4R"),
597
Charles Keepaxb63144e2013-07-04 08:56:28 +0100598SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"),
599SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"),
600
Mark Brown5c6af632012-07-09 19:09:41 +0100601SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT,
602 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000603 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
604 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100605SND_SOC_DAPM_PGA_E("IN1R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1R_ENA_SHIFT,
606 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000607 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
608 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100609SND_SOC_DAPM_PGA_E("IN2L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2L_ENA_SHIFT,
610 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000611 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
612 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100613SND_SOC_DAPM_PGA_E("IN2R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2R_ENA_SHIFT,
614 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000615 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
616 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100617SND_SOC_DAPM_PGA_E("IN3L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3L_ENA_SHIFT,
618 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000619 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
620 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100621SND_SOC_DAPM_PGA_E("IN3R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3R_ENA_SHIFT,
622 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000623 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
624 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100625SND_SOC_DAPM_PGA_E("IN4L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4L_ENA_SHIFT,
626 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000627 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
628 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100629SND_SOC_DAPM_PGA_E("IN4R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4R_ENA_SHIFT,
630 0, NULL, 0, arizona_in_ev,
Mark Brownddbce972013-02-15 17:27:22 +0000631 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD |
632 SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100633
634SND_SOC_DAPM_SUPPLY("MICBIAS1", ARIZONA_MIC_BIAS_CTRL_1,
635 ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
636SND_SOC_DAPM_SUPPLY("MICBIAS2", ARIZONA_MIC_BIAS_CTRL_2,
637 ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
638SND_SOC_DAPM_SUPPLY("MICBIAS3", ARIZONA_MIC_BIAS_CTRL_3,
639 ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0),
640
641SND_SOC_DAPM_PGA("Noise Generator", ARIZONA_COMFORT_NOISE_GENERATOR,
642 ARIZONA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0),
643
644SND_SOC_DAPM_PGA("Tone Generator 1", ARIZONA_TONE_GENERATOR_1,
645 ARIZONA_TONE1_ENA_SHIFT, 0, NULL, 0),
646SND_SOC_DAPM_PGA("Tone Generator 2", ARIZONA_TONE_GENERATOR_1,
647 ARIZONA_TONE2_ENA_SHIFT, 0, NULL, 0),
648
649SND_SOC_DAPM_PGA("Mic Mute Mixer", ARIZONA_MIC_NOISE_MIX_CONTROL_1,
650 ARIZONA_MICMUTE_MIX_ENA_SHIFT, 0, NULL, 0),
651
652SND_SOC_DAPM_PGA("EQ1", ARIZONA_EQ1_1, ARIZONA_EQ1_ENA_SHIFT, 0, NULL, 0),
653SND_SOC_DAPM_PGA("EQ2", ARIZONA_EQ2_1, ARIZONA_EQ2_ENA_SHIFT, 0, NULL, 0),
654SND_SOC_DAPM_PGA("EQ3", ARIZONA_EQ3_1, ARIZONA_EQ3_ENA_SHIFT, 0, NULL, 0),
655SND_SOC_DAPM_PGA("EQ4", ARIZONA_EQ4_1, ARIZONA_EQ4_ENA_SHIFT, 0, NULL, 0),
656
657SND_SOC_DAPM_PGA("DRC1L", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1L_ENA_SHIFT, 0,
658 NULL, 0),
659SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0,
660 NULL, 0),
661SND_SOC_DAPM_PGA("DRC2L", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2L_ENA_SHIFT, 0,
662 NULL, 0),
663SND_SOC_DAPM_PGA("DRC2R", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2R_ENA_SHIFT, 0,
664 NULL, 0),
665
666SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0,
667 NULL, 0),
668SND_SOC_DAPM_PGA("LHPF2", ARIZONA_HPLPF2_1, ARIZONA_LHPF2_ENA_SHIFT, 0,
669 NULL, 0),
670SND_SOC_DAPM_PGA("LHPF3", ARIZONA_HPLPF3_1, ARIZONA_LHPF3_ENA_SHIFT, 0,
671 NULL, 0),
672SND_SOC_DAPM_PGA("LHPF4", ARIZONA_HPLPF4_1, ARIZONA_LHPF4_ENA_SHIFT, 0,
673 NULL, 0),
674
675SND_SOC_DAPM_PGA("PWM1 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM1_ENA_SHIFT,
676 0, NULL, 0),
677SND_SOC_DAPM_PGA("PWM2 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM2_ENA_SHIFT,
678 0, NULL, 0),
679
680SND_SOC_DAPM_PGA("ASRC1L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1L_ENA_SHIFT, 0,
681 NULL, 0),
682SND_SOC_DAPM_PGA("ASRC1R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1R_ENA_SHIFT, 0,
683 NULL, 0),
684SND_SOC_DAPM_PGA("ASRC2L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2L_ENA_SHIFT, 0,
685 NULL, 0),
686SND_SOC_DAPM_PGA("ASRC2R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2R_ENA_SHIFT, 0,
687 NULL, 0),
688
Mark Brown9a3e1b82013-11-19 16:04:01 +0000689WM_ADSP2("DSP1", 0),
690WM_ADSP2("DSP2", 1),
691WM_ADSP2("DSP3", 2),
692WM_ADSP2("DSP4", 3),
693
Charles Keepax0da2e5b2013-11-19 16:04:02 +0000694SND_SOC_DAPM_PGA("ISRC1INT1", ARIZONA_ISRC_1_CTRL_3,
695 ARIZONA_ISRC1_INT0_ENA_SHIFT, 0, NULL, 0),
696SND_SOC_DAPM_PGA("ISRC1INT2", ARIZONA_ISRC_1_CTRL_3,
697 ARIZONA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0),
698SND_SOC_DAPM_PGA("ISRC1INT3", ARIZONA_ISRC_1_CTRL_3,
699 ARIZONA_ISRC1_INT2_ENA_SHIFT, 0, NULL, 0),
700SND_SOC_DAPM_PGA("ISRC1INT4", ARIZONA_ISRC_1_CTRL_3,
701 ARIZONA_ISRC1_INT3_ENA_SHIFT, 0, NULL, 0),
702
703SND_SOC_DAPM_PGA("ISRC1DEC1", ARIZONA_ISRC_1_CTRL_3,
704 ARIZONA_ISRC1_DEC0_ENA_SHIFT, 0, NULL, 0),
705SND_SOC_DAPM_PGA("ISRC1DEC2", ARIZONA_ISRC_1_CTRL_3,
706 ARIZONA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0),
707SND_SOC_DAPM_PGA("ISRC1DEC3", ARIZONA_ISRC_1_CTRL_3,
708 ARIZONA_ISRC1_DEC2_ENA_SHIFT, 0, NULL, 0),
709SND_SOC_DAPM_PGA("ISRC1DEC4", ARIZONA_ISRC_1_CTRL_3,
710 ARIZONA_ISRC1_DEC3_ENA_SHIFT, 0, NULL, 0),
711
712SND_SOC_DAPM_PGA("ISRC2INT1", ARIZONA_ISRC_2_CTRL_3,
713 ARIZONA_ISRC2_INT0_ENA_SHIFT, 0, NULL, 0),
714SND_SOC_DAPM_PGA("ISRC2INT2", ARIZONA_ISRC_2_CTRL_3,
715 ARIZONA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0),
716SND_SOC_DAPM_PGA("ISRC2INT3", ARIZONA_ISRC_2_CTRL_3,
717 ARIZONA_ISRC2_INT2_ENA_SHIFT, 0, NULL, 0),
718SND_SOC_DAPM_PGA("ISRC2INT4", ARIZONA_ISRC_2_CTRL_3,
719 ARIZONA_ISRC2_INT3_ENA_SHIFT, 0, NULL, 0),
720
721SND_SOC_DAPM_PGA("ISRC2DEC1", ARIZONA_ISRC_2_CTRL_3,
722 ARIZONA_ISRC2_DEC0_ENA_SHIFT, 0, NULL, 0),
723SND_SOC_DAPM_PGA("ISRC2DEC2", ARIZONA_ISRC_2_CTRL_3,
724 ARIZONA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0),
725SND_SOC_DAPM_PGA("ISRC2DEC3", ARIZONA_ISRC_2_CTRL_3,
726 ARIZONA_ISRC2_DEC2_ENA_SHIFT, 0, NULL, 0),
727SND_SOC_DAPM_PGA("ISRC2DEC4", ARIZONA_ISRC_2_CTRL_3,
728 ARIZONA_ISRC2_DEC3_ENA_SHIFT, 0, NULL, 0),
729
730SND_SOC_DAPM_PGA("ISRC3INT1", ARIZONA_ISRC_3_CTRL_3,
731 ARIZONA_ISRC3_INT0_ENA_SHIFT, 0, NULL, 0),
732SND_SOC_DAPM_PGA("ISRC3INT2", ARIZONA_ISRC_3_CTRL_3,
733 ARIZONA_ISRC3_INT1_ENA_SHIFT, 0, NULL, 0),
734SND_SOC_DAPM_PGA("ISRC3INT3", ARIZONA_ISRC_3_CTRL_3,
735 ARIZONA_ISRC3_INT2_ENA_SHIFT, 0, NULL, 0),
736SND_SOC_DAPM_PGA("ISRC3INT4", ARIZONA_ISRC_3_CTRL_3,
737 ARIZONA_ISRC3_INT3_ENA_SHIFT, 0, NULL, 0),
738
739SND_SOC_DAPM_PGA("ISRC3DEC1", ARIZONA_ISRC_3_CTRL_3,
740 ARIZONA_ISRC3_DEC0_ENA_SHIFT, 0, NULL, 0),
741SND_SOC_DAPM_PGA("ISRC3DEC2", ARIZONA_ISRC_3_CTRL_3,
742 ARIZONA_ISRC3_DEC1_ENA_SHIFT, 0, NULL, 0),
743SND_SOC_DAPM_PGA("ISRC3DEC3", ARIZONA_ISRC_3_CTRL_3,
744 ARIZONA_ISRC3_DEC2_ENA_SHIFT, 0, NULL, 0),
745SND_SOC_DAPM_PGA("ISRC3DEC4", ARIZONA_ISRC_3_CTRL_3,
746 ARIZONA_ISRC3_DEC3_ENA_SHIFT, 0, NULL, 0),
747
Mark Browndac8f1c2012-08-26 13:51:27 -0700748SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1,
Charles Keepaxee4b7c72013-06-05 14:51:30 +0100749 ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0,
750 &wm5110_aec_loopback_mux),
Mark Browndac8f1c2012-08-26 13:51:27 -0700751
Mark Brown5c6af632012-07-09 19:09:41 +0100752SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0,
753 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0),
754SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0,
755 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX2_ENA_SHIFT, 0),
756SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0,
757 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX3_ENA_SHIFT, 0),
758SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0,
759 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX4_ENA_SHIFT, 0),
760SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0,
761 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX5_ENA_SHIFT, 0),
762SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0,
763 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX6_ENA_SHIFT, 0),
764SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0,
765 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX7_ENA_SHIFT, 0),
766SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0,
767 ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX8_ENA_SHIFT, 0),
768
769SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0,
770 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX1_ENA_SHIFT, 0),
771SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0,
772 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX2_ENA_SHIFT, 0),
773SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0,
774 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX3_ENA_SHIFT, 0),
775SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0,
776 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX4_ENA_SHIFT, 0),
777SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0,
778 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX5_ENA_SHIFT, 0),
779SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0,
780 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX6_ENA_SHIFT, 0),
781SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0,
782 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX7_ENA_SHIFT, 0),
783SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0,
784 ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX8_ENA_SHIFT, 0),
785
786SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0,
787 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX1_ENA_SHIFT, 0),
788SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0,
789 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX2_ENA_SHIFT, 0),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +0000790SND_SOC_DAPM_AIF_OUT("AIF2TX3", NULL, 0,
791 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX3_ENA_SHIFT, 0),
792SND_SOC_DAPM_AIF_OUT("AIF2TX4", NULL, 0,
793 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX4_ENA_SHIFT, 0),
794SND_SOC_DAPM_AIF_OUT("AIF2TX5", NULL, 0,
795 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX5_ENA_SHIFT, 0),
796SND_SOC_DAPM_AIF_OUT("AIF2TX6", NULL, 0,
797 ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX6_ENA_SHIFT, 0),
Mark Brown5c6af632012-07-09 19:09:41 +0100798
799SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0,
800 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX1_ENA_SHIFT, 0),
801SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0,
802 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX2_ENA_SHIFT, 0),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +0000803SND_SOC_DAPM_AIF_IN("AIF2RX3", NULL, 0,
804 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX3_ENA_SHIFT, 0),
805SND_SOC_DAPM_AIF_IN("AIF2RX4", NULL, 0,
806 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX4_ENA_SHIFT, 0),
807SND_SOC_DAPM_AIF_IN("AIF2RX5", NULL, 0,
808 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX5_ENA_SHIFT, 0),
809SND_SOC_DAPM_AIF_IN("AIF2RX6", NULL, 0,
810 ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX6_ENA_SHIFT, 0),
Mark Brown5c6af632012-07-09 19:09:41 +0100811
Mark Brownd217f902013-05-17 13:29:05 +0100812SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0,
813 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
814 ARIZONA_SLIMRX1_ENA_SHIFT, 0),
815SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0,
816 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
817 ARIZONA_SLIMRX2_ENA_SHIFT, 0),
818SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0,
819 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
820 ARIZONA_SLIMRX3_ENA_SHIFT, 0),
821SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0,
822 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
823 ARIZONA_SLIMRX4_ENA_SHIFT, 0),
824SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0,
825 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
826 ARIZONA_SLIMRX5_ENA_SHIFT, 0),
827SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0,
828 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
829 ARIZONA_SLIMRX6_ENA_SHIFT, 0),
830SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0,
831 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
832 ARIZONA_SLIMRX7_ENA_SHIFT, 0),
833SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0,
834 ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE,
835 ARIZONA_SLIMRX8_ENA_SHIFT, 0),
836
837SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0,
838 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
839 ARIZONA_SLIMTX1_ENA_SHIFT, 0),
840SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0,
841 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
842 ARIZONA_SLIMTX2_ENA_SHIFT, 0),
843SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0,
844 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
845 ARIZONA_SLIMTX3_ENA_SHIFT, 0),
846SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0,
847 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
848 ARIZONA_SLIMTX4_ENA_SHIFT, 0),
849SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0,
850 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
851 ARIZONA_SLIMTX5_ENA_SHIFT, 0),
852SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0,
853 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
854 ARIZONA_SLIMTX6_ENA_SHIFT, 0),
855SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0,
856 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
857 ARIZONA_SLIMTX7_ENA_SHIFT, 0),
858SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0,
859 ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE,
860 ARIZONA_SLIMTX8_ENA_SHIFT, 0),
861
Mark Brown5c6af632012-07-09 19:09:41 +0100862SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0,
863 ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX1_ENA_SHIFT, 0),
864SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 0,
865 ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX2_ENA_SHIFT, 0),
866
867SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0,
868 ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX1_ENA_SHIFT, 0),
869SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0,
870 ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX2_ENA_SHIFT, 0),
871
Mark Brownf607e312013-02-22 18:36:53 +0000872SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM,
873 ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev,
Mark Brown5c6af632012-07-09 19:09:41 +0100874 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
Mark Brownf607e312013-02-22 18:36:53 +0000875SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM,
876 ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev,
Mark Brown5c6af632012-07-09 19:09:41 +0100877 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
878SND_SOC_DAPM_PGA_E("OUT2L", ARIZONA_OUTPUT_ENABLES_1,
879 ARIZONA_OUT2L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
880 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
881SND_SOC_DAPM_PGA_E("OUT2R", ARIZONA_OUTPUT_ENABLES_1,
882 ARIZONA_OUT2R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
883 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
884SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1,
885 ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
886 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
Mark Brown20bf6912012-09-26 17:52:36 +0100887SND_SOC_DAPM_PGA_E("OUT3R", ARIZONA_OUTPUT_ENABLES_1,
888 ARIZONA_OUT3R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
889 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
Mark Brown5c6af632012-07-09 19:09:41 +0100890SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1,
891 ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
892 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
893SND_SOC_DAPM_PGA_E("OUT5R", ARIZONA_OUTPUT_ENABLES_1,
894 ARIZONA_OUT5R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
895 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
896SND_SOC_DAPM_PGA_E("OUT6L", ARIZONA_OUTPUT_ENABLES_1,
897 ARIZONA_OUT6L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
898 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
899SND_SOC_DAPM_PGA_E("OUT6R", ARIZONA_OUTPUT_ENABLES_1,
900 ARIZONA_OUT6R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev,
901 SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
902
903ARIZONA_MIXER_WIDGETS(EQ1, "EQ1"),
904ARIZONA_MIXER_WIDGETS(EQ2, "EQ2"),
905ARIZONA_MIXER_WIDGETS(EQ3, "EQ3"),
906ARIZONA_MIXER_WIDGETS(EQ4, "EQ4"),
907
908ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"),
909ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"),
910ARIZONA_MIXER_WIDGETS(DRC2L, "DRC2L"),
911ARIZONA_MIXER_WIDGETS(DRC2R, "DRC2R"),
912
913ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"),
914ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"),
915ARIZONA_MIXER_WIDGETS(LHPF3, "LHPF3"),
916ARIZONA_MIXER_WIDGETS(LHPF4, "LHPF4"),
917
918ARIZONA_MIXER_WIDGETS(Mic, "Mic"),
919ARIZONA_MIXER_WIDGETS(Noise, "Noise"),
920
921ARIZONA_MIXER_WIDGETS(PWM1, "PWM1"),
922ARIZONA_MIXER_WIDGETS(PWM2, "PWM2"),
923
924ARIZONA_MIXER_WIDGETS(OUT1L, "HPOUT1L"),
925ARIZONA_MIXER_WIDGETS(OUT1R, "HPOUT1R"),
926ARIZONA_MIXER_WIDGETS(OUT2L, "HPOUT2L"),
927ARIZONA_MIXER_WIDGETS(OUT2R, "HPOUT2R"),
Mark Brown35d38892012-08-26 13:50:48 -0700928ARIZONA_MIXER_WIDGETS(OUT3L, "HPOUT3L"),
929ARIZONA_MIXER_WIDGETS(OUT3R, "HPOUT3R"),
Mark Brown5c6af632012-07-09 19:09:41 +0100930ARIZONA_MIXER_WIDGETS(SPKOUTL, "SPKOUTL"),
931ARIZONA_MIXER_WIDGETS(SPKOUTR, "SPKOUTR"),
932ARIZONA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"),
933ARIZONA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"),
934ARIZONA_MIXER_WIDGETS(SPKDAT2L, "SPKDAT2L"),
935ARIZONA_MIXER_WIDGETS(SPKDAT2R, "SPKDAT2R"),
936
937ARIZONA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"),
938ARIZONA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"),
939ARIZONA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"),
940ARIZONA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"),
941ARIZONA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"),
942ARIZONA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"),
943ARIZONA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"),
944ARIZONA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"),
945
946ARIZONA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"),
947ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +0000948ARIZONA_MIXER_WIDGETS(AIF2TX3, "AIF2TX3"),
949ARIZONA_MIXER_WIDGETS(AIF2TX4, "AIF2TX4"),
950ARIZONA_MIXER_WIDGETS(AIF2TX5, "AIF2TX5"),
951ARIZONA_MIXER_WIDGETS(AIF2TX6, "AIF2TX6"),
Mark Brown5c6af632012-07-09 19:09:41 +0100952
953ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"),
954ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"),
955
Mark Brownd217f902013-05-17 13:29:05 +0100956ARIZONA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"),
957ARIZONA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"),
958ARIZONA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"),
959ARIZONA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"),
960ARIZONA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"),
961ARIZONA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"),
962ARIZONA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"),
963ARIZONA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"),
964
Charles Keepax5886c742012-11-13 16:40:34 +0000965ARIZONA_MUX_WIDGETS(ASRC1L, "ASRC1L"),
966ARIZONA_MUX_WIDGETS(ASRC1R, "ASRC1R"),
967ARIZONA_MUX_WIDGETS(ASRC2L, "ASRC2L"),
968ARIZONA_MUX_WIDGETS(ASRC2R, "ASRC2R"),
Mark Brown5c6af632012-07-09 19:09:41 +0100969
Mark Brown9a3e1b82013-11-19 16:04:01 +0000970ARIZONA_DSP_WIDGETS(DSP1, "DSP1"),
971ARIZONA_DSP_WIDGETS(DSP2, "DSP2"),
972ARIZONA_DSP_WIDGETS(DSP3, "DSP3"),
973ARIZONA_DSP_WIDGETS(DSP4, "DSP4"),
974
Charles Keepax0da2e5b2013-11-19 16:04:02 +0000975ARIZONA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"),
976ARIZONA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"),
977ARIZONA_MUX_WIDGETS(ISRC1DEC3, "ISRC1DEC3"),
978ARIZONA_MUX_WIDGETS(ISRC1DEC4, "ISRC1DEC4"),
979
980ARIZONA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"),
981ARIZONA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"),
982ARIZONA_MUX_WIDGETS(ISRC1INT3, "ISRC1INT3"),
983ARIZONA_MUX_WIDGETS(ISRC1INT4, "ISRC1INT4"),
984
985ARIZONA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"),
986ARIZONA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"),
987ARIZONA_MUX_WIDGETS(ISRC2DEC3, "ISRC2DEC3"),
988ARIZONA_MUX_WIDGETS(ISRC2DEC4, "ISRC2DEC4"),
989
990ARIZONA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"),
991ARIZONA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"),
992ARIZONA_MUX_WIDGETS(ISRC2INT3, "ISRC2INT3"),
993ARIZONA_MUX_WIDGETS(ISRC2INT4, "ISRC2INT4"),
994
995ARIZONA_MUX_WIDGETS(ISRC3DEC1, "ISRC3DEC1"),
996ARIZONA_MUX_WIDGETS(ISRC3DEC2, "ISRC3DEC2"),
997ARIZONA_MUX_WIDGETS(ISRC3DEC3, "ISRC3DEC3"),
998ARIZONA_MUX_WIDGETS(ISRC3DEC4, "ISRC3DEC4"),
999
1000ARIZONA_MUX_WIDGETS(ISRC3INT1, "ISRC3INT1"),
1001ARIZONA_MUX_WIDGETS(ISRC3INT2, "ISRC3INT2"),
1002ARIZONA_MUX_WIDGETS(ISRC3INT3, "ISRC3INT3"),
1003ARIZONA_MUX_WIDGETS(ISRC3INT4, "ISRC3INT4"),
1004
Mark Brown5c6af632012-07-09 19:09:41 +01001005SND_SOC_DAPM_OUTPUT("HPOUT1L"),
1006SND_SOC_DAPM_OUTPUT("HPOUT1R"),
1007SND_SOC_DAPM_OUTPUT("HPOUT2L"),
1008SND_SOC_DAPM_OUTPUT("HPOUT2R"),
Mark Brown35d38892012-08-26 13:50:48 -07001009SND_SOC_DAPM_OUTPUT("HPOUT3L"),
1010SND_SOC_DAPM_OUTPUT("HPOUT3R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001011SND_SOC_DAPM_OUTPUT("SPKOUTLN"),
1012SND_SOC_DAPM_OUTPUT("SPKOUTLP"),
1013SND_SOC_DAPM_OUTPUT("SPKOUTRN"),
1014SND_SOC_DAPM_OUTPUT("SPKOUTRP"),
1015SND_SOC_DAPM_OUTPUT("SPKDAT1L"),
1016SND_SOC_DAPM_OUTPUT("SPKDAT1R"),
1017SND_SOC_DAPM_OUTPUT("SPKDAT2L"),
1018SND_SOC_DAPM_OUTPUT("SPKDAT2R"),
Mark Brown57a10a12013-01-10 19:32:33 +00001019
1020SND_SOC_DAPM_OUTPUT("MICSUPP"),
Mark Brown5c6af632012-07-09 19:09:41 +01001021};
1022
1023#define ARIZONA_MIXER_INPUT_ROUTES(name) \
1024 { name, "Noise Generator", "Noise Generator" }, \
1025 { name, "Tone Generator 1", "Tone Generator 1" }, \
1026 { name, "Tone Generator 2", "Tone Generator 2" }, \
Mark Brown2f76e682012-11-26 21:18:18 +00001027 { name, "Haptics", "HAPTICS" }, \
Mark Browndac8f1c2012-08-26 13:51:27 -07001028 { name, "AEC", "AEC Loopback" }, \
Mark Brown5c6af632012-07-09 19:09:41 +01001029 { name, "IN1L", "IN1L PGA" }, \
1030 { name, "IN1R", "IN1R PGA" }, \
1031 { name, "IN2L", "IN2L PGA" }, \
1032 { name, "IN2R", "IN2R PGA" }, \
1033 { name, "IN3L", "IN3L PGA" }, \
1034 { name, "IN3R", "IN3R PGA" }, \
1035 { name, "IN4L", "IN4L PGA" }, \
1036 { name, "IN4R", "IN4R PGA" }, \
1037 { name, "Mic Mute Mixer", "Mic Mute Mixer" }, \
1038 { name, "AIF1RX1", "AIF1RX1" }, \
1039 { name, "AIF1RX2", "AIF1RX2" }, \
1040 { name, "AIF1RX3", "AIF1RX3" }, \
1041 { name, "AIF1RX4", "AIF1RX4" }, \
1042 { name, "AIF1RX5", "AIF1RX5" }, \
1043 { name, "AIF1RX6", "AIF1RX6" }, \
1044 { name, "AIF1RX7", "AIF1RX7" }, \
1045 { name, "AIF1RX8", "AIF1RX8" }, \
1046 { name, "AIF2RX1", "AIF2RX1" }, \
1047 { name, "AIF2RX2", "AIF2RX2" }, \
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001048 { name, "AIF2RX3", "AIF2RX3" }, \
1049 { name, "AIF2RX4", "AIF2RX4" }, \
1050 { name, "AIF2RX5", "AIF2RX5" }, \
1051 { name, "AIF2RX6", "AIF2RX6" }, \
Mark Brown5c6af632012-07-09 19:09:41 +01001052 { name, "AIF3RX1", "AIF3RX1" }, \
1053 { name, "AIF3RX2", "AIF3RX2" }, \
Mark Brownd217f902013-05-17 13:29:05 +01001054 { name, "SLIMRX1", "SLIMRX1" }, \
1055 { name, "SLIMRX2", "SLIMRX2" }, \
1056 { name, "SLIMRX3", "SLIMRX3" }, \
1057 { name, "SLIMRX4", "SLIMRX4" }, \
1058 { name, "SLIMRX5", "SLIMRX5" }, \
1059 { name, "SLIMRX6", "SLIMRX6" }, \
1060 { name, "SLIMRX7", "SLIMRX7" }, \
1061 { name, "SLIMRX8", "SLIMRX8" }, \
Mark Brown5c6af632012-07-09 19:09:41 +01001062 { name, "EQ1", "EQ1" }, \
1063 { name, "EQ2", "EQ2" }, \
1064 { name, "EQ3", "EQ3" }, \
1065 { name, "EQ4", "EQ4" }, \
1066 { name, "DRC1L", "DRC1L" }, \
1067 { name, "DRC1R", "DRC1R" }, \
1068 { name, "DRC2L", "DRC2L" }, \
1069 { name, "DRC2R", "DRC2R" }, \
1070 { name, "LHPF1", "LHPF1" }, \
1071 { name, "LHPF2", "LHPF2" }, \
1072 { name, "LHPF3", "LHPF3" }, \
1073 { name, "LHPF4", "LHPF4" }, \
1074 { name, "ASRC1L", "ASRC1L" }, \
1075 { name, "ASRC1R", "ASRC1R" }, \
1076 { name, "ASRC2L", "ASRC2L" }, \
Mark Brown9a3e1b82013-11-19 16:04:01 +00001077 { name, "ASRC2R", "ASRC2R" }, \
Charles Keepax0da2e5b2013-11-19 16:04:02 +00001078 { name, "ISRC1DEC1", "ISRC1DEC1" }, \
1079 { name, "ISRC1DEC2", "ISRC1DEC2" }, \
1080 { name, "ISRC1DEC3", "ISRC1DEC3" }, \
1081 { name, "ISRC1DEC4", "ISRC1DEC4" }, \
1082 { name, "ISRC1INT1", "ISRC1INT1" }, \
1083 { name, "ISRC1INT2", "ISRC1INT2" }, \
1084 { name, "ISRC1INT3", "ISRC1INT3" }, \
1085 { name, "ISRC1INT4", "ISRC1INT4" }, \
1086 { name, "ISRC2DEC1", "ISRC2DEC1" }, \
1087 { name, "ISRC2DEC2", "ISRC2DEC2" }, \
1088 { name, "ISRC2DEC3", "ISRC2DEC3" }, \
1089 { name, "ISRC2DEC4", "ISRC2DEC4" }, \
1090 { name, "ISRC2INT1", "ISRC2INT1" }, \
1091 { name, "ISRC2INT2", "ISRC2INT2" }, \
1092 { name, "ISRC2INT3", "ISRC2INT3" }, \
1093 { name, "ISRC2INT4", "ISRC2INT4" }, \
1094 { name, "ISRC3DEC1", "ISRC3DEC1" }, \
1095 { name, "ISRC3DEC2", "ISRC3DEC2" }, \
1096 { name, "ISRC3DEC3", "ISRC3DEC3" }, \
1097 { name, "ISRC3DEC4", "ISRC3DEC4" }, \
1098 { name, "ISRC3INT1", "ISRC3INT1" }, \
1099 { name, "ISRC3INT2", "ISRC3INT2" }, \
1100 { name, "ISRC3INT3", "ISRC3INT3" }, \
1101 { name, "ISRC3INT4", "ISRC3INT4" }, \
Mark Brown9a3e1b82013-11-19 16:04:01 +00001102 { name, "DSP1.1", "DSP1" }, \
1103 { name, "DSP1.2", "DSP1" }, \
1104 { name, "DSP1.3", "DSP1" }, \
1105 { name, "DSP1.4", "DSP1" }, \
1106 { name, "DSP1.5", "DSP1" }, \
1107 { name, "DSP1.6", "DSP1" }, \
1108 { name, "DSP2.1", "DSP2" }, \
1109 { name, "DSP2.2", "DSP2" }, \
1110 { name, "DSP2.3", "DSP2" }, \
1111 { name, "DSP2.4", "DSP2" }, \
1112 { name, "DSP2.5", "DSP2" }, \
1113 { name, "DSP2.6", "DSP2" }, \
1114 { name, "DSP3.1", "DSP3" }, \
1115 { name, "DSP3.2", "DSP3" }, \
1116 { name, "DSP3.3", "DSP3" }, \
1117 { name, "DSP3.4", "DSP3" }, \
1118 { name, "DSP3.5", "DSP3" }, \
1119 { name, "DSP3.6", "DSP3" }, \
1120 { name, "DSP4.1", "DSP4" }, \
1121 { name, "DSP4.2", "DSP4" }, \
1122 { name, "DSP4.3", "DSP4" }, \
1123 { name, "DSP4.4", "DSP4" }, \
1124 { name, "DSP4.5", "DSP4" }, \
1125 { name, "DSP4.6", "DSP4" }
Mark Brown5c6af632012-07-09 19:09:41 +01001126
1127static const struct snd_soc_dapm_route wm5110_dapm_routes[] = {
1128 { "AIF2 Capture", NULL, "DBVDD2" },
1129 { "AIF2 Playback", NULL, "DBVDD2" },
1130
1131 { "AIF3 Capture", NULL, "DBVDD3" },
1132 { "AIF3 Playback", NULL, "DBVDD3" },
1133
1134 { "OUT1L", NULL, "CPVDD" },
1135 { "OUT1R", NULL, "CPVDD" },
1136 { "OUT2L", NULL, "CPVDD" },
1137 { "OUT2R", NULL, "CPVDD" },
1138 { "OUT3L", NULL, "CPVDD" },
Mark Brown20bf6912012-09-26 17:52:36 +01001139 { "OUT3R", NULL, "CPVDD" },
Mark Brown5c6af632012-07-09 19:09:41 +01001140
1141 { "OUT4L", NULL, "SPKVDDL" },
1142 { "OUT4R", NULL, "SPKVDDR" },
1143
1144 { "OUT1L", NULL, "SYSCLK" },
1145 { "OUT1R", NULL, "SYSCLK" },
1146 { "OUT2L", NULL, "SYSCLK" },
1147 { "OUT2R", NULL, "SYSCLK" },
1148 { "OUT3L", NULL, "SYSCLK" },
1149 { "OUT4L", NULL, "SYSCLK" },
1150 { "OUT4R", NULL, "SYSCLK" },
1151 { "OUT5L", NULL, "SYSCLK" },
1152 { "OUT5R", NULL, "SYSCLK" },
1153 { "OUT6L", NULL, "SYSCLK" },
1154 { "OUT6R", NULL, "SYSCLK" },
1155
Charles Keepax6dc6a3f2013-06-05 14:51:31 +01001156 { "IN1L", NULL, "SYSCLK" },
1157 { "IN1R", NULL, "SYSCLK" },
1158 { "IN2L", NULL, "SYSCLK" },
1159 { "IN2R", NULL, "SYSCLK" },
1160 { "IN3L", NULL, "SYSCLK" },
1161 { "IN3R", NULL, "SYSCLK" },
1162 { "IN4L", NULL, "SYSCLK" },
1163 { "IN4R", NULL, "SYSCLK" },
1164
Mark Brown5c6af632012-07-09 19:09:41 +01001165 { "MICBIAS1", NULL, "MICVDD" },
1166 { "MICBIAS2", NULL, "MICVDD" },
1167 { "MICBIAS3", NULL, "MICVDD" },
1168
Charles Keepax6dc6a3f2013-06-05 14:51:31 +01001169 { "Noise Generator", NULL, "SYSCLK" },
1170 { "Tone Generator 1", NULL, "SYSCLK" },
1171 { "Tone Generator 2", NULL, "SYSCLK" },
1172
Mark Brown5c6af632012-07-09 19:09:41 +01001173 { "Noise Generator", NULL, "NOISE" },
1174 { "Tone Generator 1", NULL, "TONE" },
1175 { "Tone Generator 2", NULL, "TONE" },
1176
Mark Brown5c6af632012-07-09 19:09:41 +01001177 { "AIF1 Capture", NULL, "AIF1TX1" },
1178 { "AIF1 Capture", NULL, "AIF1TX2" },
1179 { "AIF1 Capture", NULL, "AIF1TX3" },
1180 { "AIF1 Capture", NULL, "AIF1TX4" },
1181 { "AIF1 Capture", NULL, "AIF1TX5" },
1182 { "AIF1 Capture", NULL, "AIF1TX6" },
1183 { "AIF1 Capture", NULL, "AIF1TX7" },
1184 { "AIF1 Capture", NULL, "AIF1TX8" },
1185
1186 { "AIF1RX1", NULL, "AIF1 Playback" },
1187 { "AIF1RX2", NULL, "AIF1 Playback" },
1188 { "AIF1RX3", NULL, "AIF1 Playback" },
1189 { "AIF1RX4", NULL, "AIF1 Playback" },
1190 { "AIF1RX5", NULL, "AIF1 Playback" },
1191 { "AIF1RX6", NULL, "AIF1 Playback" },
1192 { "AIF1RX7", NULL, "AIF1 Playback" },
1193 { "AIF1RX8", NULL, "AIF1 Playback" },
1194
1195 { "AIF2 Capture", NULL, "AIF2TX1" },
1196 { "AIF2 Capture", NULL, "AIF2TX2" },
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001197 { "AIF2 Capture", NULL, "AIF2TX3" },
1198 { "AIF2 Capture", NULL, "AIF2TX4" },
1199 { "AIF2 Capture", NULL, "AIF2TX5" },
1200 { "AIF2 Capture", NULL, "AIF2TX6" },
Mark Brown5c6af632012-07-09 19:09:41 +01001201
1202 { "AIF2RX1", NULL, "AIF2 Playback" },
1203 { "AIF2RX2", NULL, "AIF2 Playback" },
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001204 { "AIF2RX3", NULL, "AIF2 Playback" },
1205 { "AIF2RX4", NULL, "AIF2 Playback" },
1206 { "AIF2RX5", NULL, "AIF2 Playback" },
1207 { "AIF2RX6", NULL, "AIF2 Playback" },
Mark Brown5c6af632012-07-09 19:09:41 +01001208
1209 { "AIF3 Capture", NULL, "AIF3TX1" },
1210 { "AIF3 Capture", NULL, "AIF3TX2" },
1211
1212 { "AIF3RX1", NULL, "AIF3 Playback" },
1213 { "AIF3RX2", NULL, "AIF3 Playback" },
1214
Mark Brownd217f902013-05-17 13:29:05 +01001215 { "Slim1 Capture", NULL, "SLIMTX1" },
1216 { "Slim1 Capture", NULL, "SLIMTX2" },
1217 { "Slim1 Capture", NULL, "SLIMTX3" },
1218 { "Slim1 Capture", NULL, "SLIMTX4" },
1219
1220 { "SLIMRX1", NULL, "Slim1 Playback" },
1221 { "SLIMRX2", NULL, "Slim1 Playback" },
1222 { "SLIMRX3", NULL, "Slim1 Playback" },
1223 { "SLIMRX4", NULL, "Slim1 Playback" },
1224
1225 { "Slim2 Capture", NULL, "SLIMTX5" },
1226 { "Slim2 Capture", NULL, "SLIMTX6" },
1227
1228 { "SLIMRX5", NULL, "Slim2 Playback" },
1229 { "SLIMRX6", NULL, "Slim2 Playback" },
1230
1231 { "Slim3 Capture", NULL, "SLIMTX7" },
1232 { "Slim3 Capture", NULL, "SLIMTX8" },
1233
1234 { "SLIMRX7", NULL, "Slim3 Playback" },
1235 { "SLIMRX8", NULL, "Slim3 Playback" },
1236
Mark Brown5c6af632012-07-09 19:09:41 +01001237 { "AIF1 Playback", NULL, "SYSCLK" },
1238 { "AIF2 Playback", NULL, "SYSCLK" },
1239 { "AIF3 Playback", NULL, "SYSCLK" },
Mark Brownd217f902013-05-17 13:29:05 +01001240 { "Slim1 Playback", NULL, "SYSCLK" },
1241 { "Slim2 Playback", NULL, "SYSCLK" },
1242 { "Slim3 Playback", NULL, "SYSCLK" },
Mark Brown5c6af632012-07-09 19:09:41 +01001243
1244 { "AIF1 Capture", NULL, "SYSCLK" },
1245 { "AIF2 Capture", NULL, "SYSCLK" },
1246 { "AIF3 Capture", NULL, "SYSCLK" },
Mark Brownd217f902013-05-17 13:29:05 +01001247 { "Slim1 Capture", NULL, "SYSCLK" },
1248 { "Slim2 Capture", NULL, "SYSCLK" },
1249 { "Slim3 Capture", NULL, "SYSCLK" },
Mark Brown5c6af632012-07-09 19:09:41 +01001250
Mark Brown17c3f7e2012-08-10 15:40:22 +01001251 { "IN1L PGA", NULL, "IN1L" },
1252 { "IN1R PGA", NULL, "IN1R" },
1253
1254 { "IN2L PGA", NULL, "IN2L" },
1255 { "IN2R PGA", NULL, "IN2R" },
1256
1257 { "IN3L PGA", NULL, "IN3L" },
1258 { "IN3R PGA", NULL, "IN3R" },
1259
1260 { "IN4L PGA", NULL, "IN4L" },
1261 { "IN4R PGA", NULL, "IN4R" },
1262
Mark Brown5c6af632012-07-09 19:09:41 +01001263 ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"),
1264 ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"),
1265 ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"),
1266 ARIZONA_MIXER_ROUTES("OUT2R", "HPOUT2R"),
Mark Brown35d38892012-08-26 13:50:48 -07001267 ARIZONA_MIXER_ROUTES("OUT3L", "HPOUT3L"),
1268 ARIZONA_MIXER_ROUTES("OUT3R", "HPOUT3R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001269
1270 ARIZONA_MIXER_ROUTES("OUT4L", "SPKOUTL"),
1271 ARIZONA_MIXER_ROUTES("OUT4R", "SPKOUTR"),
1272 ARIZONA_MIXER_ROUTES("OUT5L", "SPKDAT1L"),
1273 ARIZONA_MIXER_ROUTES("OUT5R", "SPKDAT1R"),
1274 ARIZONA_MIXER_ROUTES("OUT6L", "SPKDAT2L"),
1275 ARIZONA_MIXER_ROUTES("OUT6R", "SPKDAT2R"),
1276
1277 ARIZONA_MIXER_ROUTES("PWM1 Driver", "PWM1"),
1278 ARIZONA_MIXER_ROUTES("PWM2 Driver", "PWM2"),
1279
1280 ARIZONA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"),
1281 ARIZONA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"),
1282 ARIZONA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"),
1283 ARIZONA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"),
1284 ARIZONA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"),
1285 ARIZONA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"),
1286 ARIZONA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"),
1287 ARIZONA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"),
1288
1289 ARIZONA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"),
1290 ARIZONA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"),
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001291 ARIZONA_MIXER_ROUTES("AIF2TX3", "AIF2TX3"),
1292 ARIZONA_MIXER_ROUTES("AIF2TX4", "AIF2TX4"),
1293 ARIZONA_MIXER_ROUTES("AIF2TX5", "AIF2TX5"),
1294 ARIZONA_MIXER_ROUTES("AIF2TX6", "AIF2TX6"),
Mark Brown5c6af632012-07-09 19:09:41 +01001295
1296 ARIZONA_MIXER_ROUTES("AIF3TX1", "AIF3TX1"),
1297 ARIZONA_MIXER_ROUTES("AIF3TX2", "AIF3TX2"),
1298
Mark Brownd217f902013-05-17 13:29:05 +01001299 ARIZONA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"),
1300 ARIZONA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"),
1301 ARIZONA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"),
1302 ARIZONA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"),
1303 ARIZONA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"),
1304 ARIZONA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"),
1305 ARIZONA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"),
1306 ARIZONA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"),
1307
Mark Brown5c6af632012-07-09 19:09:41 +01001308 ARIZONA_MIXER_ROUTES("EQ1", "EQ1"),
1309 ARIZONA_MIXER_ROUTES("EQ2", "EQ2"),
1310 ARIZONA_MIXER_ROUTES("EQ3", "EQ3"),
1311 ARIZONA_MIXER_ROUTES("EQ4", "EQ4"),
1312
1313 ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"),
1314 ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"),
1315 ARIZONA_MIXER_ROUTES("DRC2L", "DRC2L"),
1316 ARIZONA_MIXER_ROUTES("DRC2R", "DRC2R"),
1317
1318 ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"),
1319 ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"),
1320 ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"),
1321 ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"),
1322
Mark Brown66e7aa22013-08-12 23:59:08 +01001323 ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Noise"),
1324 ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"),
1325
Charles Keepaxe7edb272013-08-12 11:33:32 +01001326 ARIZONA_MUX_ROUTES("ASRC1L", "ASRC1L"),
1327 ARIZONA_MUX_ROUTES("ASRC1R", "ASRC1R"),
1328 ARIZONA_MUX_ROUTES("ASRC2L", "ASRC2L"),
1329 ARIZONA_MUX_ROUTES("ASRC2R", "ASRC2R"),
Mark Brown5c6af632012-07-09 19:09:41 +01001330
Mark Brown9a3e1b82013-11-19 16:04:01 +00001331 ARIZONA_DSP_ROUTES("DSP1"),
1332 ARIZONA_DSP_ROUTES("DSP2"),
1333 ARIZONA_DSP_ROUTES("DSP3"),
1334 ARIZONA_DSP_ROUTES("DSP4"),
1335
Charles Keepax0da2e5b2013-11-19 16:04:02 +00001336 ARIZONA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"),
1337 ARIZONA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"),
1338 ARIZONA_MUX_ROUTES("ISRC1INT3", "ISRC1INT3"),
1339 ARIZONA_MUX_ROUTES("ISRC1INT4", "ISRC1INT4"),
1340
1341 ARIZONA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"),
1342 ARIZONA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"),
1343 ARIZONA_MUX_ROUTES("ISRC1DEC3", "ISRC1DEC3"),
1344 ARIZONA_MUX_ROUTES("ISRC1DEC4", "ISRC1DEC4"),
1345
1346 ARIZONA_MUX_ROUTES("ISRC2INT1", "ISRC2INT1"),
1347 ARIZONA_MUX_ROUTES("ISRC2INT2", "ISRC2INT2"),
1348 ARIZONA_MUX_ROUTES("ISRC2INT3", "ISRC2INT3"),
1349 ARIZONA_MUX_ROUTES("ISRC2INT4", "ISRC2INT4"),
1350
1351 ARIZONA_MUX_ROUTES("ISRC2DEC1", "ISRC2DEC1"),
1352 ARIZONA_MUX_ROUTES("ISRC2DEC2", "ISRC2DEC2"),
1353 ARIZONA_MUX_ROUTES("ISRC2DEC3", "ISRC2DEC3"),
1354 ARIZONA_MUX_ROUTES("ISRC2DEC4", "ISRC2DEC4"),
1355
1356 ARIZONA_MUX_ROUTES("ISRC3INT1", "ISRC3INT1"),
1357 ARIZONA_MUX_ROUTES("ISRC3INT2", "ISRC3INT2"),
1358 ARIZONA_MUX_ROUTES("ISRC3INT3", "ISRC3INT3"),
1359 ARIZONA_MUX_ROUTES("ISRC3INT4", "ISRC3INT4"),
1360
1361 ARIZONA_MUX_ROUTES("ISRC3DEC1", "ISRC3DEC1"),
1362 ARIZONA_MUX_ROUTES("ISRC3DEC2", "ISRC3DEC2"),
1363 ARIZONA_MUX_ROUTES("ISRC3DEC3", "ISRC3DEC3"),
1364 ARIZONA_MUX_ROUTES("ISRC3DEC4", "ISRC3DEC4"),
1365
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001366 { "AEC Loopback", "HPOUT1L", "OUT1L" },
1367 { "AEC Loopback", "HPOUT1R", "OUT1R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001368 { "HPOUT1L", NULL, "OUT1L" },
1369 { "HPOUT1R", NULL, "OUT1R" },
1370
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001371 { "AEC Loopback", "HPOUT2L", "OUT2L" },
1372 { "AEC Loopback", "HPOUT2R", "OUT2R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001373 { "HPOUT2L", NULL, "OUT2L" },
1374 { "HPOUT2R", NULL, "OUT2R" },
1375
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001376 { "AEC Loopback", "HPOUT3L", "OUT3L" },
1377 { "AEC Loopback", "HPOUT3R", "OUT3R" },
Mark Brown35d38892012-08-26 13:50:48 -07001378 { "HPOUT3L", NULL, "OUT3L" },
1379 { "HPOUT3R", NULL, "OUT3L" },
Mark Brown5c6af632012-07-09 19:09:41 +01001380
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001381 { "AEC Loopback", "SPKOUTL", "OUT4L" },
Mark Brown5c6af632012-07-09 19:09:41 +01001382 { "SPKOUTLN", NULL, "OUT4L" },
1383 { "SPKOUTLP", NULL, "OUT4L" },
1384
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001385 { "AEC Loopback", "SPKOUTR", "OUT4R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001386 { "SPKOUTRN", NULL, "OUT4R" },
1387 { "SPKOUTRP", NULL, "OUT4R" },
1388
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001389 { "AEC Loopback", "SPKDAT1L", "OUT5L" },
1390 { "AEC Loopback", "SPKDAT1R", "OUT5R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001391 { "SPKDAT1L", NULL, "OUT5L" },
1392 { "SPKDAT1R", NULL, "OUT5R" },
1393
Charles Keepaxa9c9caf2013-10-26 15:31:26 +01001394 { "AEC Loopback", "SPKDAT2L", "OUT6L" },
1395 { "AEC Loopback", "SPKDAT2R", "OUT6R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001396 { "SPKDAT2L", NULL, "OUT6L" },
1397 { "SPKDAT2R", NULL, "OUT6R" },
Mark Brown57a10a12013-01-10 19:32:33 +00001398
1399 { "MICSUPP", NULL, "SYSCLK" },
Charles Keepaxb63144e2013-07-04 08:56:28 +01001400
1401 { "DRC1 Signal Activity", NULL, "DRC1L" },
1402 { "DRC1 Signal Activity", NULL, "DRC1R" },
1403 { "DRC2 Signal Activity", NULL, "DRC2L" },
1404 { "DRC2 Signal Activity", NULL, "DRC2R" },
Mark Brown5c6af632012-07-09 19:09:41 +01001405};
1406
1407static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source,
1408 unsigned int Fref, unsigned int Fout)
1409{
1410 struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec);
1411
1412 switch (fll_id) {
1413 case WM5110_FLL1:
1414 return arizona_set_fll(&wm5110->fll[0], source, Fref, Fout);
1415 case WM5110_FLL2:
1416 return arizona_set_fll(&wm5110->fll[1], source, Fref, Fout);
Charles Keepaxee929a92013-02-20 17:28:40 +00001417 case WM5110_FLL1_REFCLK:
1418 return arizona_set_fll_refclk(&wm5110->fll[0], source, Fref,
1419 Fout);
1420 case WM5110_FLL2_REFCLK:
1421 return arizona_set_fll_refclk(&wm5110->fll[1], source, Fref,
1422 Fout);
Mark Brown5c6af632012-07-09 19:09:41 +01001423 default:
1424 return -EINVAL;
1425 }
1426}
1427
1428#define WM5110_RATES SNDRV_PCM_RATE_8000_192000
1429
1430#define WM5110_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
1431 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
1432
1433static struct snd_soc_dai_driver wm5110_dai[] = {
1434 {
1435 .name = "wm5110-aif1",
1436 .id = 1,
1437 .base = ARIZONA_AIF1_BCLK_CTRL,
1438 .playback = {
1439 .stream_name = "AIF1 Playback",
1440 .channels_min = 1,
1441 .channels_max = 8,
1442 .rates = WM5110_RATES,
1443 .formats = WM5110_FORMATS,
1444 },
1445 .capture = {
1446 .stream_name = "AIF1 Capture",
1447 .channels_min = 1,
1448 .channels_max = 8,
1449 .rates = WM5110_RATES,
1450 .formats = WM5110_FORMATS,
1451 },
1452 .ops = &arizona_dai_ops,
1453 .symmetric_rates = 1,
1454 },
1455 {
1456 .name = "wm5110-aif2",
1457 .id = 2,
1458 .base = ARIZONA_AIF2_BCLK_CTRL,
1459 .playback = {
1460 .stream_name = "AIF2 Playback",
1461 .channels_min = 1,
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001462 .channels_max = 6,
Mark Brown5c6af632012-07-09 19:09:41 +01001463 .rates = WM5110_RATES,
1464 .formats = WM5110_FORMATS,
1465 },
1466 .capture = {
1467 .stream_name = "AIF2 Capture",
1468 .channels_min = 1,
Richard Fitzgeralde64001e2013-11-20 13:17:07 +00001469 .channels_max = 6,
Mark Brown5c6af632012-07-09 19:09:41 +01001470 .rates = WM5110_RATES,
1471 .formats = WM5110_FORMATS,
1472 },
1473 .ops = &arizona_dai_ops,
1474 .symmetric_rates = 1,
1475 },
1476 {
1477 .name = "wm5110-aif3",
1478 .id = 3,
1479 .base = ARIZONA_AIF3_BCLK_CTRL,
1480 .playback = {
1481 .stream_name = "AIF3 Playback",
1482 .channels_min = 1,
1483 .channels_max = 2,
1484 .rates = WM5110_RATES,
1485 .formats = WM5110_FORMATS,
1486 },
1487 .capture = {
1488 .stream_name = "AIF3 Capture",
1489 .channels_min = 1,
1490 .channels_max = 2,
1491 .rates = WM5110_RATES,
1492 .formats = WM5110_FORMATS,
1493 },
1494 .ops = &arizona_dai_ops,
1495 .symmetric_rates = 1,
1496 },
Mark Brownd217f902013-05-17 13:29:05 +01001497 {
1498 .name = "wm5110-slim1",
1499 .id = 4,
1500 .playback = {
1501 .stream_name = "Slim1 Playback",
1502 .channels_min = 1,
1503 .channels_max = 4,
1504 .rates = WM5110_RATES,
1505 .formats = WM5110_FORMATS,
1506 },
1507 .capture = {
1508 .stream_name = "Slim1 Capture",
1509 .channels_min = 1,
1510 .channels_max = 4,
1511 .rates = WM5110_RATES,
1512 .formats = WM5110_FORMATS,
1513 },
1514 .ops = &arizona_simple_dai_ops,
1515 },
1516 {
1517 .name = "wm5110-slim2",
1518 .id = 5,
1519 .playback = {
1520 .stream_name = "Slim2 Playback",
1521 .channels_min = 1,
1522 .channels_max = 2,
1523 .rates = WM5110_RATES,
1524 .formats = WM5110_FORMATS,
1525 },
1526 .capture = {
1527 .stream_name = "Slim2 Capture",
1528 .channels_min = 1,
1529 .channels_max = 2,
1530 .rates = WM5110_RATES,
1531 .formats = WM5110_FORMATS,
1532 },
1533 .ops = &arizona_simple_dai_ops,
1534 },
1535 {
1536 .name = "wm5110-slim3",
1537 .id = 6,
1538 .playback = {
1539 .stream_name = "Slim3 Playback",
1540 .channels_min = 1,
1541 .channels_max = 2,
1542 .rates = WM5110_RATES,
1543 .formats = WM5110_FORMATS,
1544 },
1545 .capture = {
1546 .stream_name = "Slim3 Capture",
1547 .channels_min = 1,
1548 .channels_max = 2,
1549 .rates = WM5110_RATES,
1550 .formats = WM5110_FORMATS,
1551 },
1552 .ops = &arizona_simple_dai_ops,
1553 },
Mark Brown5c6af632012-07-09 19:09:41 +01001554};
1555
1556static int wm5110_codec_probe(struct snd_soc_codec *codec)
1557{
1558 struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);
Mark Brown2f76e682012-11-26 21:18:18 +00001559 int ret;
Mark Brown5c6af632012-07-09 19:09:41 +01001560
1561 codec->control_data = priv->core.arizona->regmap;
Mark Brown2f76e682012-11-26 21:18:18 +00001562 priv->core.arizona->dapm = &codec->dapm;
1563
1564 ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP);
1565 if (ret != 0)
1566 return ret;
1567
Mark Brown62cc4d52013-05-20 11:28:35 -05001568 arizona_init_spk(codec);
Charles Keepaxb63144e2013-07-04 08:56:28 +01001569 arizona_init_gpio(codec);
Mark Brown62cc4d52013-05-20 11:28:35 -05001570
Mark Brown9a3e1b82013-11-19 16:04:01 +00001571 ret = snd_soc_add_codec_controls(codec, wm_adsp2_fw_controls, 8);
1572 if (ret != 0)
1573 return ret;
1574
Mark Brown2f76e682012-11-26 21:18:18 +00001575 snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS");
1576
1577 priv->core.arizona->dapm = &codec->dapm;
1578
1579 return 0;
1580}
1581
1582static int wm5110_codec_remove(struct snd_soc_codec *codec)
1583{
1584 struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec);
1585
1586 priv->core.arizona->dapm = NULL;
1587
1588 return 0;
Mark Brown5c6af632012-07-09 19:09:41 +01001589}
1590
1591#define WM5110_DIG_VU 0x0200
1592
1593static unsigned int wm5110_digital_vu[] = {
Mark Brown5c6af632012-07-09 19:09:41 +01001594 ARIZONA_DAC_DIGITAL_VOLUME_1L,
1595 ARIZONA_DAC_DIGITAL_VOLUME_1R,
1596 ARIZONA_DAC_DIGITAL_VOLUME_2L,
1597 ARIZONA_DAC_DIGITAL_VOLUME_2R,
1598 ARIZONA_DAC_DIGITAL_VOLUME_3L,
1599 ARIZONA_DAC_DIGITAL_VOLUME_3R,
1600 ARIZONA_DAC_DIGITAL_VOLUME_4L,
1601 ARIZONA_DAC_DIGITAL_VOLUME_4R,
1602 ARIZONA_DAC_DIGITAL_VOLUME_5L,
1603 ARIZONA_DAC_DIGITAL_VOLUME_5R,
Charles Keepaxae605032012-09-27 13:21:48 +01001604 ARIZONA_DAC_DIGITAL_VOLUME_6L,
1605 ARIZONA_DAC_DIGITAL_VOLUME_6R,
Mark Brown5c6af632012-07-09 19:09:41 +01001606};
1607
1608static struct snd_soc_codec_driver soc_codec_dev_wm5110 = {
1609 .probe = wm5110_codec_probe,
Mark Brown2f76e682012-11-26 21:18:18 +00001610 .remove = wm5110_codec_remove,
Mark Brown5c6af632012-07-09 19:09:41 +01001611
1612 .idle_bias_off = true,
1613
1614 .set_sysclk = arizona_set_sysclk,
1615 .set_pll = wm5110_set_fll,
1616
1617 .controls = wm5110_snd_controls,
1618 .num_controls = ARRAY_SIZE(wm5110_snd_controls),
1619 .dapm_widgets = wm5110_dapm_widgets,
1620 .num_dapm_widgets = ARRAY_SIZE(wm5110_dapm_widgets),
1621 .dapm_routes = wm5110_dapm_routes,
1622 .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes),
1623};
1624
Bill Pemberton7a79e942012-12-07 09:26:37 -05001625static int wm5110_probe(struct platform_device *pdev)
Mark Brown5c6af632012-07-09 19:09:41 +01001626{
1627 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
1628 struct wm5110_priv *wm5110;
Mark Brown9a3e1b82013-11-19 16:04:01 +00001629 int i, ret;
Mark Brown5c6af632012-07-09 19:09:41 +01001630
1631 wm5110 = devm_kzalloc(&pdev->dev, sizeof(struct wm5110_priv),
1632 GFP_KERNEL);
1633 if (wm5110 == NULL)
1634 return -ENOMEM;
1635 platform_set_drvdata(pdev, wm5110);
1636
1637 wm5110->core.arizona = arizona;
Mark Brownddbce972013-02-15 17:27:22 +00001638 wm5110->core.num_inputs = 8;
Mark Brown5c6af632012-07-09 19:09:41 +01001639
Mark Brown9a3e1b82013-11-19 16:04:01 +00001640 for (i = 0; i < WM5110_NUM_ADSP; i++) {
1641 wm5110->core.adsp[i].part = "wm5110";
1642 wm5110->core.adsp[i].num = i + 1;
1643 wm5110->core.adsp[i].type = WMFW_ADSP2;
1644 wm5110->core.adsp[i].dev = arizona->dev;
1645 wm5110->core.adsp[i].regmap = arizona->regmap;
1646
1647 wm5110->core.adsp[i].base = ARIZONA_DSP1_CONTROL_1
1648 + (0x100 * i);
1649 wm5110->core.adsp[i].mem = wm5110_dsp_regions[i];
1650 wm5110->core.adsp[i].num_mems
1651 = ARRAY_SIZE(wm5110_dsp1_regions);
1652
1653 ret = wm_adsp2_init(&wm5110->core.adsp[i], false);
1654 if (ret != 0)
1655 return ret;
1656 }
1657
Mark Brown5c6af632012-07-09 19:09:41 +01001658 for (i = 0; i < ARRAY_SIZE(wm5110->fll); i++)
1659 wm5110->fll[i].vco_mult = 3;
1660
1661 arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1,
1662 ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK,
1663 &wm5110->fll[0]);
1664 arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1,
1665 ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK,
1666 &wm5110->fll[1]);
1667
Charles Keepax0da2e5b2013-11-19 16:04:02 +00001668 /* SR2 fixed at 8kHz, SR3 fixed at 16kHz */
1669 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2,
1670 ARIZONA_SAMPLE_RATE_2_MASK, 0x11);
1671 regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3,
1672 ARIZONA_SAMPLE_RATE_3_MASK, 0x12);
1673
Mark Brown5c6af632012-07-09 19:09:41 +01001674 for (i = 0; i < ARRAY_SIZE(wm5110_dai); i++)
1675 arizona_init_dai(&wm5110->core, i);
1676
1677 /* Latch volume update bits */
1678 for (i = 0; i < ARRAY_SIZE(wm5110_digital_vu); i++)
1679 regmap_update_bits(arizona->regmap, wm5110_digital_vu[i],
1680 WM5110_DIG_VU, WM5110_DIG_VU);
1681
1682 pm_runtime_enable(&pdev->dev);
1683 pm_runtime_idle(&pdev->dev);
1684
1685 return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm5110,
1686 wm5110_dai, ARRAY_SIZE(wm5110_dai));
1687}
1688
Bill Pemberton7a79e942012-12-07 09:26:37 -05001689static int wm5110_remove(struct platform_device *pdev)
Mark Brown5c6af632012-07-09 19:09:41 +01001690{
1691 snd_soc_unregister_codec(&pdev->dev);
1692 pm_runtime_disable(&pdev->dev);
1693
1694 return 0;
1695}
1696
1697static struct platform_driver wm5110_codec_driver = {
1698 .driver = {
1699 .name = "wm5110-codec",
1700 .owner = THIS_MODULE,
1701 },
1702 .probe = wm5110_probe,
Bill Pemberton7a79e942012-12-07 09:26:37 -05001703 .remove = wm5110_remove,
Mark Brown5c6af632012-07-09 19:09:41 +01001704};
1705
1706module_platform_driver(wm5110_codec_driver);
1707
1708MODULE_DESCRIPTION("ASoC WM5110 driver");
1709MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
1710MODULE_LICENSE("GPL");
1711MODULE_ALIAS("platform:wm5110-codec");