Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1 | /* |
| 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" |
| 33 | #include "wm5110.h" |
| 34 | |
| 35 | struct wm5110_priv { |
| 36 | struct arizona_priv core; |
| 37 | struct arizona_fll fll[2]; |
| 38 | }; |
| 39 | |
| 40 | static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); |
| 41 | static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); |
| 42 | static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); |
| 43 | static DECLARE_TLV_DB_SCALE(noise_tlv, 0, 600, 0); |
Mark Brown | bd7fe24 | 2012-12-18 13:53:26 +0000 | [diff] [blame] | 44 | static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0); |
| 45 | |
| 46 | #define WM5110_NG_SRC(name, base) \ |
| 47 | SOC_SINGLE(name " NG HPOUT1L Switch", base, 0, 1, 0), \ |
| 48 | SOC_SINGLE(name " NG HPOUT1R Switch", base, 1, 1, 0), \ |
| 49 | SOC_SINGLE(name " NG HPOUT2L Switch", base, 2, 1, 0), \ |
| 50 | SOC_SINGLE(name " NG HPOUT2R Switch", base, 3, 1, 0), \ |
| 51 | SOC_SINGLE(name " NG HPOUT3L Switch", base, 4, 1, 0), \ |
| 52 | SOC_SINGLE(name " NG HPOUT3R Switch", base, 5, 1, 0), \ |
| 53 | SOC_SINGLE(name " NG SPKOUTL Switch", base, 6, 1, 0), \ |
| 54 | SOC_SINGLE(name " NG SPKOUTR Switch", base, 7, 1, 0), \ |
| 55 | SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \ |
| 56 | SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0), \ |
| 57 | SOC_SINGLE(name " NG SPKDAT2L Switch", base, 10, 1, 0), \ |
| 58 | SOC_SINGLE(name " NG SPKDAT2R Switch", base, 11, 1, 0) |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 59 | |
| 60 | static const struct snd_kcontrol_new wm5110_snd_controls[] = { |
Charles Keepax | c7f3843 | 2013-08-06 17:03:55 +0100 | [diff] [blame] | 61 | SOC_ENUM("IN1 OSR", arizona_in_dmic_osr[0]), |
| 62 | SOC_ENUM("IN2 OSR", arizona_in_dmic_osr[1]), |
| 63 | SOC_ENUM("IN3 OSR", arizona_in_dmic_osr[2]), |
| 64 | SOC_ENUM("IN4 OSR", arizona_in_dmic_osr[3]), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 65 | |
Mark Brown | 02482da | 2012-12-14 15:18:30 +0900 | [diff] [blame] | 66 | SOC_SINGLE_RANGE_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL, |
| 67 | ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv), |
| 68 | SOC_SINGLE_RANGE_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL, |
| 69 | ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv), |
| 70 | SOC_SINGLE_RANGE_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL, |
| 71 | ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv), |
| 72 | SOC_SINGLE_RANGE_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL, |
| 73 | ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv), |
| 74 | SOC_SINGLE_RANGE_TLV("IN3L Volume", ARIZONA_IN3L_CONTROL, |
| 75 | ARIZONA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv), |
| 76 | SOC_SINGLE_RANGE_TLV("IN3R Volume", ARIZONA_IN3R_CONTROL, |
| 77 | ARIZONA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, ana_tlv), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 78 | |
Mark Brown | 02482da | 2012-12-14 15:18:30 +0900 | [diff] [blame] | 79 | SOC_SINGLE_TLV("IN1L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1L, |
| 80 | ARIZONA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 81 | SOC_SINGLE_TLV("IN1R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1R, |
| 82 | ARIZONA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 83 | SOC_SINGLE_TLV("IN2L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2L, |
| 84 | ARIZONA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 85 | SOC_SINGLE_TLV("IN2R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2R, |
| 86 | ARIZONA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 87 | SOC_SINGLE_TLV("IN3L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3L, |
| 88 | ARIZONA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 89 | SOC_SINGLE_TLV("IN3R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3R, |
| 90 | ARIZONA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 91 | SOC_SINGLE_TLV("IN4L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4L, |
| 92 | ARIZONA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 93 | SOC_SINGLE_TLV("IN4R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4R, |
| 94 | ARIZONA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 95 | |
Mark Brown | a1abfa8 | 2012-12-09 12:50:05 +0900 | [diff] [blame] | 96 | SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp), |
| 97 | SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp), |
| 98 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 99 | ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE), |
| 100 | ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE), |
| 101 | ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), |
| 102 | ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), |
| 103 | |
Mark Brown | 56fd460 | 2012-12-05 16:38:12 +0900 | [diff] [blame] | 104 | SND_SOC_BYTES_MASK("EQ1 Coefficeints", ARIZONA_EQ1_1, 21, |
| 105 | ARIZONA_EQ1_ENA_MASK), |
| 106 | SND_SOC_BYTES_MASK("EQ2 Coefficeints", ARIZONA_EQ2_1, 21, |
| 107 | ARIZONA_EQ2_ENA_MASK), |
| 108 | SND_SOC_BYTES_MASK("EQ3 Coefficeints", ARIZONA_EQ3_1, 21, |
| 109 | ARIZONA_EQ3_ENA_MASK), |
| 110 | SND_SOC_BYTES_MASK("EQ4 Coefficeints", ARIZONA_EQ4_1, 21, |
| 111 | ARIZONA_EQ4_ENA_MASK), |
| 112 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 113 | SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, |
| 114 | 24, 0, eq_tlv), |
| 115 | SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT, |
| 116 | 24, 0, eq_tlv), |
| 117 | SOC_SINGLE_TLV("EQ1 B3 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B3_GAIN_SHIFT, |
| 118 | 24, 0, eq_tlv), |
| 119 | SOC_SINGLE_TLV("EQ1 B4 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B4_GAIN_SHIFT, |
| 120 | 24, 0, eq_tlv), |
| 121 | SOC_SINGLE_TLV("EQ1 B5 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B5_GAIN_SHIFT, |
| 122 | 24, 0, eq_tlv), |
| 123 | |
| 124 | SOC_SINGLE_TLV("EQ2 B1 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B1_GAIN_SHIFT, |
| 125 | 24, 0, eq_tlv), |
| 126 | SOC_SINGLE_TLV("EQ2 B2 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B2_GAIN_SHIFT, |
| 127 | 24, 0, eq_tlv), |
| 128 | SOC_SINGLE_TLV("EQ2 B3 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B3_GAIN_SHIFT, |
| 129 | 24, 0, eq_tlv), |
| 130 | SOC_SINGLE_TLV("EQ2 B4 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B4_GAIN_SHIFT, |
| 131 | 24, 0, eq_tlv), |
| 132 | SOC_SINGLE_TLV("EQ2 B5 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B5_GAIN_SHIFT, |
| 133 | 24, 0, eq_tlv), |
| 134 | |
| 135 | SOC_SINGLE_TLV("EQ3 B1 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B1_GAIN_SHIFT, |
| 136 | 24, 0, eq_tlv), |
| 137 | SOC_SINGLE_TLV("EQ3 B2 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B2_GAIN_SHIFT, |
| 138 | 24, 0, eq_tlv), |
| 139 | SOC_SINGLE_TLV("EQ3 B3 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B3_GAIN_SHIFT, |
| 140 | 24, 0, eq_tlv), |
| 141 | SOC_SINGLE_TLV("EQ3 B4 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B4_GAIN_SHIFT, |
| 142 | 24, 0, eq_tlv), |
| 143 | SOC_SINGLE_TLV("EQ3 B5 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B5_GAIN_SHIFT, |
| 144 | 24, 0, eq_tlv), |
| 145 | |
| 146 | SOC_SINGLE_TLV("EQ4 B1 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B1_GAIN_SHIFT, |
| 147 | 24, 0, eq_tlv), |
| 148 | SOC_SINGLE_TLV("EQ4 B2 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B2_GAIN_SHIFT, |
| 149 | 24, 0, eq_tlv), |
| 150 | SOC_SINGLE_TLV("EQ4 B3 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B3_GAIN_SHIFT, |
| 151 | 24, 0, eq_tlv), |
| 152 | SOC_SINGLE_TLV("EQ4 B4 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B4_GAIN_SHIFT, |
| 153 | 24, 0, eq_tlv), |
| 154 | SOC_SINGLE_TLV("EQ4 B5 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B5_GAIN_SHIFT, |
| 155 | 24, 0, eq_tlv), |
| 156 | |
| 157 | ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE), |
| 158 | ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE), |
| 159 | ARIZONA_MIXER_CONTROLS("DRC2L", ARIZONA_DRC2LMIX_INPUT_1_SOURCE), |
| 160 | ARIZONA_MIXER_CONTROLS("DRC2R", ARIZONA_DRC2RMIX_INPUT_1_SOURCE), |
| 161 | |
| 162 | SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5, |
| 163 | ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA), |
| 164 | SND_SOC_BYTES_MASK("DRC2", ARIZONA_DRC2_CTRL1, 5, |
| 165 | ARIZONA_DRC2R_ENA | ARIZONA_DRC2L_ENA), |
| 166 | |
| 167 | ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE), |
| 168 | ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE), |
| 169 | ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE), |
| 170 | ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE), |
| 171 | |
Mark Brown | d4d1eaa | 2012-12-05 16:38:30 +0900 | [diff] [blame] | 172 | SND_SOC_BYTES("LHPF1 Coefficients", ARIZONA_HPLPF1_2, 1), |
| 173 | SND_SOC_BYTES("LHPF2 Coefficients", ARIZONA_HPLPF2_2, 1), |
| 174 | SND_SOC_BYTES("LHPF3 Coefficients", ARIZONA_HPLPF3_2, 1), |
| 175 | SND_SOC_BYTES("LHPF4 Coefficients", ARIZONA_HPLPF4_2, 1), |
| 176 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 177 | SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode), |
| 178 | SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode), |
| 179 | SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode), |
| 180 | SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode), |
| 181 | |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 182 | ARIZONA_MIXER_CONTROLS("DSP1L", ARIZONA_DSP1LMIX_INPUT_1_SOURCE), |
| 183 | ARIZONA_MIXER_CONTROLS("DSP1R", ARIZONA_DSP1RMIX_INPUT_1_SOURCE), |
| 184 | ARIZONA_MIXER_CONTROLS("DSP2L", ARIZONA_DSP2LMIX_INPUT_1_SOURCE), |
| 185 | ARIZONA_MIXER_CONTROLS("DSP2R", ARIZONA_DSP2RMIX_INPUT_1_SOURCE), |
| 186 | ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE), |
| 187 | ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE), |
| 188 | ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE), |
Charles Keepax | 39d4ecd | 2013-05-24 11:38:24 +0100 | [diff] [blame] | 189 | ARIZONA_MIXER_CONTROLS("DSP4R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 190 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 191 | ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE), |
| 192 | ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE), |
| 193 | |
| 194 | SOC_SINGLE_TLV("Noise Generator Volume", ARIZONA_COMFORT_NOISE_GENERATOR, |
| 195 | ARIZONA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, noise_tlv), |
| 196 | |
| 197 | ARIZONA_MIXER_CONTROLS("HPOUT1L", ARIZONA_OUT1LMIX_INPUT_1_SOURCE), |
| 198 | ARIZONA_MIXER_CONTROLS("HPOUT1R", ARIZONA_OUT1RMIX_INPUT_1_SOURCE), |
| 199 | ARIZONA_MIXER_CONTROLS("HPOUT2L", ARIZONA_OUT2LMIX_INPUT_1_SOURCE), |
| 200 | ARIZONA_MIXER_CONTROLS("HPOUT2R", ARIZONA_OUT2RMIX_INPUT_1_SOURCE), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 201 | ARIZONA_MIXER_CONTROLS("HPOUT3L", ARIZONA_OUT3LMIX_INPUT_1_SOURCE), |
| 202 | ARIZONA_MIXER_CONTROLS("HPOUT3R", ARIZONA_OUT3RMIX_INPUT_1_SOURCE), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 203 | ARIZONA_MIXER_CONTROLS("SPKOUTL", ARIZONA_OUT4LMIX_INPUT_1_SOURCE), |
| 204 | ARIZONA_MIXER_CONTROLS("SPKOUTR", ARIZONA_OUT4RMIX_INPUT_1_SOURCE), |
| 205 | ARIZONA_MIXER_CONTROLS("SPKDAT1L", ARIZONA_OUT5LMIX_INPUT_1_SOURCE), |
| 206 | ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE), |
| 207 | ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE), |
| 208 | ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE), |
| 209 | |
| 210 | SOC_SINGLE("HPOUT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_1L, |
| 211 | ARIZONA_OUT1_OSR_SHIFT, 1, 0), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 212 | SOC_SINGLE("HPOUT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_2L, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 213 | ARIZONA_OUT2_OSR_SHIFT, 1, 0), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 214 | SOC_SINGLE("HPOUT3 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_3L, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 215 | ARIZONA_OUT3_OSR_SHIFT, 1, 0), |
| 216 | SOC_SINGLE("Speaker High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_4L, |
| 217 | ARIZONA_OUT4_OSR_SHIFT, 1, 0), |
| 218 | SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L, |
| 219 | ARIZONA_OUT5_OSR_SHIFT, 1, 0), |
| 220 | SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L, |
| 221 | ARIZONA_OUT6_OSR_SHIFT, 1, 0), |
| 222 | |
| 223 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
| 224 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 225 | SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 226 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 227 | SOC_DOUBLE_R("HPOUT3 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 228 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_MUTE_SHIFT, 1, 1), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 229 | SOC_DOUBLE_R("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L, |
| 230 | ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_MUTE_SHIFT, 1, 1), |
| 231 | SOC_DOUBLE_R("SPKDAT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_5L, |
| 232 | ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_MUTE_SHIFT, 1, 1), |
| 233 | SOC_DOUBLE_R("SPKDAT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_6L, |
| 234 | ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_MUTE_SHIFT, 1, 1), |
| 235 | |
| 236 | SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
| 237 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT, |
| 238 | 0xbf, 0, digital_tlv), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 239 | SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 240 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT, |
| 241 | 0xbf, 0, digital_tlv), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 242 | SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 243 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_VOL_SHIFT, |
| 244 | 0xbf, 0, digital_tlv), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 245 | SOC_DOUBLE_R_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L, |
| 246 | ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_VOL_SHIFT, |
| 247 | 0xbf, 0, digital_tlv), |
| 248 | SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_5L, |
| 249 | ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_VOL_SHIFT, |
| 250 | 0xbf, 0, digital_tlv), |
| 251 | SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_6L, |
| 252 | ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT, |
| 253 | 0xbf, 0, digital_tlv), |
| 254 | |
| 255 | SOC_DOUBLE_R_RANGE_TLV("HPOUT1 Volume", ARIZONA_OUTPUT_PATH_CONFIG_1L, |
| 256 | ARIZONA_OUTPUT_PATH_CONFIG_1R, |
| 257 | ARIZONA_OUT1L_PGA_VOL_SHIFT, |
| 258 | 0x34, 0x40, 0, ana_tlv), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 259 | SOC_DOUBLE_R_RANGE_TLV("HPOUT2 Volume", ARIZONA_OUTPUT_PATH_CONFIG_2L, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 260 | ARIZONA_OUTPUT_PATH_CONFIG_2R, |
| 261 | ARIZONA_OUT2L_PGA_VOL_SHIFT, |
| 262 | 0x34, 0x40, 0, ana_tlv), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 263 | SOC_DOUBLE_R_RANGE_TLV("HPOUT3 Volume", ARIZONA_OUTPUT_PATH_CONFIG_3L, |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 264 | ARIZONA_OUTPUT_PATH_CONFIG_3R, |
| 265 | ARIZONA_OUT3L_PGA_VOL_SHIFT, 0x34, 0x40, 0, ana_tlv), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 266 | |
| 267 | SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT, |
| 268 | ARIZONA_SPK1R_MUTE_SHIFT, 1, 1), |
| 269 | SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, |
| 270 | ARIZONA_SPK2R_MUTE_SHIFT, 1, 1), |
| 271 | |
Mark Brown | a1abfa8 | 2012-12-09 12:50:05 +0900 | [diff] [blame] | 272 | SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp), |
| 273 | SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp), |
| 274 | |
Mark Brown | bd7fe24 | 2012-12-18 13:53:26 +0000 | [diff] [blame] | 275 | SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL, |
| 276 | ARIZONA_NGATE_ENA_SHIFT, 1, 0), |
| 277 | SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL, |
| 278 | ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv), |
| 279 | SOC_ENUM("Noise Gate Hold", arizona_ng_hold), |
| 280 | |
| 281 | WM5110_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L), |
| 282 | WM5110_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R), |
| 283 | WM5110_NG_SRC("HPOUT2L", ARIZONA_NOISE_GATE_SELECT_2L), |
| 284 | WM5110_NG_SRC("HPOUT2R", ARIZONA_NOISE_GATE_SELECT_2R), |
| 285 | WM5110_NG_SRC("HPOUT3L", ARIZONA_NOISE_GATE_SELECT_3L), |
| 286 | WM5110_NG_SRC("HPOUT3R", ARIZONA_NOISE_GATE_SELECT_3R), |
| 287 | WM5110_NG_SRC("SPKOUTL", ARIZONA_NOISE_GATE_SELECT_4L), |
| 288 | WM5110_NG_SRC("SPKOUTR", ARIZONA_NOISE_GATE_SELECT_4R), |
| 289 | WM5110_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L), |
| 290 | WM5110_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R), |
| 291 | WM5110_NG_SRC("SPKDAT2L", ARIZONA_NOISE_GATE_SELECT_6L), |
| 292 | WM5110_NG_SRC("SPKDAT2R", ARIZONA_NOISE_GATE_SELECT_6R), |
| 293 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 294 | ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), |
| 295 | ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), |
| 296 | ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), |
| 297 | ARIZONA_MIXER_CONTROLS("AIF1TX4", ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE), |
| 298 | ARIZONA_MIXER_CONTROLS("AIF1TX5", ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE), |
| 299 | ARIZONA_MIXER_CONTROLS("AIF1TX6", ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE), |
| 300 | ARIZONA_MIXER_CONTROLS("AIF1TX7", ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE), |
| 301 | ARIZONA_MIXER_CONTROLS("AIF1TX8", ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE), |
| 302 | |
| 303 | ARIZONA_MIXER_CONTROLS("AIF2TX1", ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE), |
| 304 | ARIZONA_MIXER_CONTROLS("AIF2TX2", ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE), |
| 305 | |
| 306 | ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE), |
| 307 | ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE), |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 308 | |
| 309 | ARIZONA_MIXER_CONTROLS("SLIMTX1", ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE), |
| 310 | ARIZONA_MIXER_CONTROLS("SLIMTX2", ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE), |
| 311 | ARIZONA_MIXER_CONTROLS("SLIMTX3", ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE), |
| 312 | ARIZONA_MIXER_CONTROLS("SLIMTX4", ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE), |
| 313 | ARIZONA_MIXER_CONTROLS("SLIMTX5", ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE), |
| 314 | ARIZONA_MIXER_CONTROLS("SLIMTX6", ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE), |
| 315 | ARIZONA_MIXER_CONTROLS("SLIMTX7", ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE), |
| 316 | ARIZONA_MIXER_CONTROLS("SLIMTX8", ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 317 | }; |
| 318 | |
| 319 | ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE); |
| 320 | ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE); |
| 321 | ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE); |
| 322 | ARIZONA_MIXER_ENUMS(EQ4, ARIZONA_EQ4MIX_INPUT_1_SOURCE); |
| 323 | |
| 324 | ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE); |
| 325 | ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE); |
| 326 | ARIZONA_MIXER_ENUMS(DRC2L, ARIZONA_DRC2LMIX_INPUT_1_SOURCE); |
| 327 | ARIZONA_MIXER_ENUMS(DRC2R, ARIZONA_DRC2RMIX_INPUT_1_SOURCE); |
| 328 | |
| 329 | ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE); |
| 330 | ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE); |
| 331 | ARIZONA_MIXER_ENUMS(LHPF3, ARIZONA_HPLP3MIX_INPUT_1_SOURCE); |
| 332 | ARIZONA_MIXER_ENUMS(LHPF4, ARIZONA_HPLP4MIX_INPUT_1_SOURCE); |
| 333 | |
| 334 | ARIZONA_MIXER_ENUMS(Mic, ARIZONA_MICMIX_INPUT_1_SOURCE); |
| 335 | ARIZONA_MIXER_ENUMS(Noise, ARIZONA_NOISEMIX_INPUT_1_SOURCE); |
| 336 | |
| 337 | ARIZONA_MIXER_ENUMS(PWM1, ARIZONA_PWM1MIX_INPUT_1_SOURCE); |
| 338 | ARIZONA_MIXER_ENUMS(PWM2, ARIZONA_PWM2MIX_INPUT_1_SOURCE); |
| 339 | |
| 340 | ARIZONA_MIXER_ENUMS(OUT1L, ARIZONA_OUT1LMIX_INPUT_1_SOURCE); |
| 341 | ARIZONA_MIXER_ENUMS(OUT1R, ARIZONA_OUT1RMIX_INPUT_1_SOURCE); |
| 342 | ARIZONA_MIXER_ENUMS(OUT2L, ARIZONA_OUT2LMIX_INPUT_1_SOURCE); |
| 343 | ARIZONA_MIXER_ENUMS(OUT2R, ARIZONA_OUT2RMIX_INPUT_1_SOURCE); |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 344 | ARIZONA_MIXER_ENUMS(OUT3L, ARIZONA_OUT3LMIX_INPUT_1_SOURCE); |
| 345 | ARIZONA_MIXER_ENUMS(OUT3R, ARIZONA_OUT3RMIX_INPUT_1_SOURCE); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 346 | ARIZONA_MIXER_ENUMS(SPKOUTL, ARIZONA_OUT4LMIX_INPUT_1_SOURCE); |
| 347 | ARIZONA_MIXER_ENUMS(SPKOUTR, ARIZONA_OUT4RMIX_INPUT_1_SOURCE); |
| 348 | ARIZONA_MIXER_ENUMS(SPKDAT1L, ARIZONA_OUT5LMIX_INPUT_1_SOURCE); |
| 349 | ARIZONA_MIXER_ENUMS(SPKDAT1R, ARIZONA_OUT5RMIX_INPUT_1_SOURCE); |
| 350 | ARIZONA_MIXER_ENUMS(SPKDAT2L, ARIZONA_OUT6LMIX_INPUT_1_SOURCE); |
| 351 | ARIZONA_MIXER_ENUMS(SPKDAT2R, ARIZONA_OUT6RMIX_INPUT_1_SOURCE); |
| 352 | |
| 353 | ARIZONA_MIXER_ENUMS(AIF1TX1, ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE); |
| 354 | ARIZONA_MIXER_ENUMS(AIF1TX2, ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE); |
| 355 | ARIZONA_MIXER_ENUMS(AIF1TX3, ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE); |
| 356 | ARIZONA_MIXER_ENUMS(AIF1TX4, ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE); |
| 357 | ARIZONA_MIXER_ENUMS(AIF1TX5, ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE); |
| 358 | ARIZONA_MIXER_ENUMS(AIF1TX6, ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE); |
| 359 | ARIZONA_MIXER_ENUMS(AIF1TX7, ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE); |
| 360 | ARIZONA_MIXER_ENUMS(AIF1TX8, ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE); |
| 361 | |
| 362 | ARIZONA_MIXER_ENUMS(AIF2TX1, ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE); |
| 363 | ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE); |
| 364 | |
| 365 | ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE); |
| 366 | ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE); |
| 367 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 368 | ARIZONA_MIXER_ENUMS(SLIMTX1, ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE); |
| 369 | ARIZONA_MIXER_ENUMS(SLIMTX2, ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE); |
| 370 | ARIZONA_MIXER_ENUMS(SLIMTX3, ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE); |
| 371 | ARIZONA_MIXER_ENUMS(SLIMTX4, ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE); |
| 372 | ARIZONA_MIXER_ENUMS(SLIMTX5, ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE); |
| 373 | ARIZONA_MIXER_ENUMS(SLIMTX6, ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE); |
| 374 | ARIZONA_MIXER_ENUMS(SLIMTX7, ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE); |
| 375 | ARIZONA_MIXER_ENUMS(SLIMTX8, ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE); |
| 376 | |
Charles Keepax | 5886c74 | 2012-11-13 16:40:34 +0000 | [diff] [blame] | 377 | ARIZONA_MUX_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE); |
| 378 | ARIZONA_MUX_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE); |
| 379 | ARIZONA_MUX_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE); |
| 380 | ARIZONA_MUX_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 381 | |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 382 | static const char *wm5110_aec_loopback_texts[] = { |
| 383 | "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R", |
| 384 | "SPKOUTL", "SPKOUTR", "SPKDAT1L", "SPKDAT1R", "SPKDAT2L", "SPKDAT2R", |
| 385 | }; |
| 386 | |
| 387 | static const unsigned int wm5110_aec_loopback_values[] = { |
| 388 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, |
| 389 | }; |
| 390 | |
| 391 | static const struct soc_enum wm5110_aec_loopback = |
| 392 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, |
Mark Brown | 7d5cb4f | 2013-01-11 13:32:00 +0000 | [diff] [blame] | 393 | ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 394 | ARRAY_SIZE(wm5110_aec_loopback_texts), |
| 395 | wm5110_aec_loopback_texts, |
| 396 | wm5110_aec_loopback_values); |
| 397 | |
| 398 | static const struct snd_kcontrol_new wm5110_aec_loopback_mux = |
| 399 | SOC_DAPM_VALUE_ENUM("AEC Loopback", wm5110_aec_loopback); |
| 400 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 401 | static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = { |
| 402 | SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT, |
| 403 | 0, NULL, 0), |
| 404 | SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1, |
| 405 | ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0), |
Mark Brown | 94237f8 | 2012-08-09 19:14:43 +0100 | [diff] [blame] | 406 | SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK, |
| 407 | ARIZONA_OPCLK_ENA_SHIFT, 0, NULL, 0), |
| 408 | SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", ARIZONA_OUTPUT_ASYNC_CLOCK, |
| 409 | ARIZONA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 410 | |
Mark Brown | 822b4b8 | 2012-09-07 10:54:32 +0800 | [diff] [blame] | 411 | SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0), |
| 412 | SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD3", 0, 0), |
| 413 | SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD", 20, 0), |
Mark Brown | 76dbd2a | 2012-09-07 12:58:54 +0800 | [diff] [blame] | 414 | SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS), |
Mark Brown | 822b4b8 | 2012-09-07 10:54:32 +0800 | [diff] [blame] | 415 | SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDL", 0, 0), |
| 416 | SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 417 | |
| 418 | SND_SOC_DAPM_SIGGEN("TONE"), |
| 419 | SND_SOC_DAPM_SIGGEN("NOISE"), |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 420 | SND_SOC_DAPM_SIGGEN("HAPTICS"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 421 | |
| 422 | SND_SOC_DAPM_INPUT("IN1L"), |
| 423 | SND_SOC_DAPM_INPUT("IN1R"), |
| 424 | SND_SOC_DAPM_INPUT("IN2L"), |
| 425 | SND_SOC_DAPM_INPUT("IN2R"), |
| 426 | SND_SOC_DAPM_INPUT("IN3L"), |
| 427 | SND_SOC_DAPM_INPUT("IN3R"), |
| 428 | SND_SOC_DAPM_INPUT("IN4L"), |
| 429 | SND_SOC_DAPM_INPUT("IN4R"), |
| 430 | |
Charles Keepax | b63144e | 2013-07-04 08:56:28 +0100 | [diff] [blame] | 431 | SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"), |
| 432 | SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"), |
| 433 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 434 | SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT, |
| 435 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 436 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 437 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 438 | SND_SOC_DAPM_PGA_E("IN1R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1R_ENA_SHIFT, |
| 439 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 440 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 441 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 442 | SND_SOC_DAPM_PGA_E("IN2L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2L_ENA_SHIFT, |
| 443 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 444 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 445 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 446 | SND_SOC_DAPM_PGA_E("IN2R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2R_ENA_SHIFT, |
| 447 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 448 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 449 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 450 | SND_SOC_DAPM_PGA_E("IN3L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3L_ENA_SHIFT, |
| 451 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 452 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 453 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 454 | SND_SOC_DAPM_PGA_E("IN3R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3R_ENA_SHIFT, |
| 455 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 456 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 457 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 458 | SND_SOC_DAPM_PGA_E("IN4L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4L_ENA_SHIFT, |
| 459 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 460 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 461 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 462 | SND_SOC_DAPM_PGA_E("IN4R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4R_ENA_SHIFT, |
| 463 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 464 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 465 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 466 | |
| 467 | SND_SOC_DAPM_SUPPLY("MICBIAS1", ARIZONA_MIC_BIAS_CTRL_1, |
| 468 | ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0), |
| 469 | SND_SOC_DAPM_SUPPLY("MICBIAS2", ARIZONA_MIC_BIAS_CTRL_2, |
| 470 | ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0), |
| 471 | SND_SOC_DAPM_SUPPLY("MICBIAS3", ARIZONA_MIC_BIAS_CTRL_3, |
| 472 | ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0), |
| 473 | |
| 474 | SND_SOC_DAPM_PGA("Noise Generator", ARIZONA_COMFORT_NOISE_GENERATOR, |
| 475 | ARIZONA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0), |
| 476 | |
| 477 | SND_SOC_DAPM_PGA("Tone Generator 1", ARIZONA_TONE_GENERATOR_1, |
| 478 | ARIZONA_TONE1_ENA_SHIFT, 0, NULL, 0), |
| 479 | SND_SOC_DAPM_PGA("Tone Generator 2", ARIZONA_TONE_GENERATOR_1, |
| 480 | ARIZONA_TONE2_ENA_SHIFT, 0, NULL, 0), |
| 481 | |
| 482 | SND_SOC_DAPM_PGA("Mic Mute Mixer", ARIZONA_MIC_NOISE_MIX_CONTROL_1, |
| 483 | ARIZONA_MICMUTE_MIX_ENA_SHIFT, 0, NULL, 0), |
| 484 | |
| 485 | SND_SOC_DAPM_PGA("EQ1", ARIZONA_EQ1_1, ARIZONA_EQ1_ENA_SHIFT, 0, NULL, 0), |
| 486 | SND_SOC_DAPM_PGA("EQ2", ARIZONA_EQ2_1, ARIZONA_EQ2_ENA_SHIFT, 0, NULL, 0), |
| 487 | SND_SOC_DAPM_PGA("EQ3", ARIZONA_EQ3_1, ARIZONA_EQ3_ENA_SHIFT, 0, NULL, 0), |
| 488 | SND_SOC_DAPM_PGA("EQ4", ARIZONA_EQ4_1, ARIZONA_EQ4_ENA_SHIFT, 0, NULL, 0), |
| 489 | |
| 490 | SND_SOC_DAPM_PGA("DRC1L", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1L_ENA_SHIFT, 0, |
| 491 | NULL, 0), |
| 492 | SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0, |
| 493 | NULL, 0), |
| 494 | SND_SOC_DAPM_PGA("DRC2L", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2L_ENA_SHIFT, 0, |
| 495 | NULL, 0), |
| 496 | SND_SOC_DAPM_PGA("DRC2R", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2R_ENA_SHIFT, 0, |
| 497 | NULL, 0), |
| 498 | |
| 499 | SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0, |
| 500 | NULL, 0), |
| 501 | SND_SOC_DAPM_PGA("LHPF2", ARIZONA_HPLPF2_1, ARIZONA_LHPF2_ENA_SHIFT, 0, |
| 502 | NULL, 0), |
| 503 | SND_SOC_DAPM_PGA("LHPF3", ARIZONA_HPLPF3_1, ARIZONA_LHPF3_ENA_SHIFT, 0, |
| 504 | NULL, 0), |
| 505 | SND_SOC_DAPM_PGA("LHPF4", ARIZONA_HPLPF4_1, ARIZONA_LHPF4_ENA_SHIFT, 0, |
| 506 | NULL, 0), |
| 507 | |
| 508 | SND_SOC_DAPM_PGA("PWM1 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM1_ENA_SHIFT, |
| 509 | 0, NULL, 0), |
| 510 | SND_SOC_DAPM_PGA("PWM2 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM2_ENA_SHIFT, |
| 511 | 0, NULL, 0), |
| 512 | |
| 513 | SND_SOC_DAPM_PGA("ASRC1L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1L_ENA_SHIFT, 0, |
| 514 | NULL, 0), |
| 515 | SND_SOC_DAPM_PGA("ASRC1R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1R_ENA_SHIFT, 0, |
| 516 | NULL, 0), |
| 517 | SND_SOC_DAPM_PGA("ASRC2L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2L_ENA_SHIFT, 0, |
| 518 | NULL, 0), |
| 519 | SND_SOC_DAPM_PGA("ASRC2R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2R_ENA_SHIFT, 0, |
| 520 | NULL, 0), |
| 521 | |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 522 | SND_SOC_DAPM_VALUE_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1, |
Charles Keepax | ee4b7c7 | 2013-06-05 14:51:30 +0100 | [diff] [blame] | 523 | ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0, |
| 524 | &wm5110_aec_loopback_mux), |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 525 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 526 | SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0, |
| 527 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0), |
| 528 | SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0, |
| 529 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX2_ENA_SHIFT, 0), |
| 530 | SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0, |
| 531 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX3_ENA_SHIFT, 0), |
| 532 | SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0, |
| 533 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX4_ENA_SHIFT, 0), |
| 534 | SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0, |
| 535 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX5_ENA_SHIFT, 0), |
| 536 | SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0, |
| 537 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX6_ENA_SHIFT, 0), |
| 538 | SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0, |
| 539 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX7_ENA_SHIFT, 0), |
| 540 | SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0, |
| 541 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX8_ENA_SHIFT, 0), |
| 542 | |
| 543 | SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0, |
| 544 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX1_ENA_SHIFT, 0), |
| 545 | SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0, |
| 546 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX2_ENA_SHIFT, 0), |
| 547 | SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0, |
| 548 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX3_ENA_SHIFT, 0), |
| 549 | SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0, |
| 550 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX4_ENA_SHIFT, 0), |
| 551 | SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0, |
| 552 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX5_ENA_SHIFT, 0), |
| 553 | SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0, |
| 554 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX6_ENA_SHIFT, 0), |
| 555 | SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0, |
| 556 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX7_ENA_SHIFT, 0), |
| 557 | SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0, |
| 558 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX8_ENA_SHIFT, 0), |
| 559 | |
| 560 | SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0, |
| 561 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX1_ENA_SHIFT, 0), |
| 562 | SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0, |
| 563 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX2_ENA_SHIFT, 0), |
| 564 | |
| 565 | SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0, |
| 566 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX1_ENA_SHIFT, 0), |
| 567 | SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0, |
| 568 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX2_ENA_SHIFT, 0), |
| 569 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 570 | SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0, |
| 571 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 572 | ARIZONA_SLIMRX1_ENA_SHIFT, 0), |
| 573 | SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0, |
| 574 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 575 | ARIZONA_SLIMRX2_ENA_SHIFT, 0), |
| 576 | SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0, |
| 577 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 578 | ARIZONA_SLIMRX3_ENA_SHIFT, 0), |
| 579 | SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0, |
| 580 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 581 | ARIZONA_SLIMRX4_ENA_SHIFT, 0), |
| 582 | SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0, |
| 583 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 584 | ARIZONA_SLIMRX5_ENA_SHIFT, 0), |
| 585 | SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0, |
| 586 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 587 | ARIZONA_SLIMRX6_ENA_SHIFT, 0), |
| 588 | SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0, |
| 589 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 590 | ARIZONA_SLIMRX7_ENA_SHIFT, 0), |
| 591 | SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0, |
| 592 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 593 | ARIZONA_SLIMRX8_ENA_SHIFT, 0), |
| 594 | |
| 595 | SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0, |
| 596 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 597 | ARIZONA_SLIMTX1_ENA_SHIFT, 0), |
| 598 | SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0, |
| 599 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 600 | ARIZONA_SLIMTX2_ENA_SHIFT, 0), |
| 601 | SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0, |
| 602 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 603 | ARIZONA_SLIMTX3_ENA_SHIFT, 0), |
| 604 | SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0, |
| 605 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 606 | ARIZONA_SLIMTX4_ENA_SHIFT, 0), |
| 607 | SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0, |
| 608 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 609 | ARIZONA_SLIMTX5_ENA_SHIFT, 0), |
| 610 | SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0, |
| 611 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 612 | ARIZONA_SLIMTX6_ENA_SHIFT, 0), |
| 613 | SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0, |
| 614 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 615 | ARIZONA_SLIMTX7_ENA_SHIFT, 0), |
| 616 | SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0, |
| 617 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 618 | ARIZONA_SLIMTX8_ENA_SHIFT, 0), |
| 619 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 620 | SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0, |
| 621 | ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX1_ENA_SHIFT, 0), |
| 622 | SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 0, |
| 623 | ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX2_ENA_SHIFT, 0), |
| 624 | |
| 625 | SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0, |
| 626 | ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX1_ENA_SHIFT, 0), |
| 627 | SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0, |
| 628 | ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX2_ENA_SHIFT, 0), |
| 629 | |
Mark Brown | f607e31 | 2013-02-22 18:36:53 +0000 | [diff] [blame] | 630 | SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM, |
| 631 | ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 632 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
Mark Brown | f607e31 | 2013-02-22 18:36:53 +0000 | [diff] [blame] | 633 | SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM, |
| 634 | ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, arizona_hp_ev, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 635 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 636 | SND_SOC_DAPM_PGA_E("OUT2L", ARIZONA_OUTPUT_ENABLES_1, |
| 637 | ARIZONA_OUT2L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 638 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 639 | SND_SOC_DAPM_PGA_E("OUT2R", ARIZONA_OUTPUT_ENABLES_1, |
| 640 | ARIZONA_OUT2R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 641 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 642 | SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1, |
| 643 | ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 644 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 20bf691 | 2012-09-26 17:52:36 +0100 | [diff] [blame] | 645 | SND_SOC_DAPM_PGA_E("OUT3R", ARIZONA_OUTPUT_ENABLES_1, |
| 646 | ARIZONA_OUT3R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 647 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 648 | SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1, |
| 649 | ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 650 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 651 | SND_SOC_DAPM_PGA_E("OUT5R", ARIZONA_OUTPUT_ENABLES_1, |
| 652 | ARIZONA_OUT5R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 653 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 654 | SND_SOC_DAPM_PGA_E("OUT6L", ARIZONA_OUTPUT_ENABLES_1, |
| 655 | ARIZONA_OUT6L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 656 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 657 | SND_SOC_DAPM_PGA_E("OUT6R", ARIZONA_OUTPUT_ENABLES_1, |
| 658 | ARIZONA_OUT6R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 659 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 660 | |
| 661 | ARIZONA_MIXER_WIDGETS(EQ1, "EQ1"), |
| 662 | ARIZONA_MIXER_WIDGETS(EQ2, "EQ2"), |
| 663 | ARIZONA_MIXER_WIDGETS(EQ3, "EQ3"), |
| 664 | ARIZONA_MIXER_WIDGETS(EQ4, "EQ4"), |
| 665 | |
| 666 | ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"), |
| 667 | ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"), |
| 668 | ARIZONA_MIXER_WIDGETS(DRC2L, "DRC2L"), |
| 669 | ARIZONA_MIXER_WIDGETS(DRC2R, "DRC2R"), |
| 670 | |
| 671 | ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"), |
| 672 | ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"), |
| 673 | ARIZONA_MIXER_WIDGETS(LHPF3, "LHPF3"), |
| 674 | ARIZONA_MIXER_WIDGETS(LHPF4, "LHPF4"), |
| 675 | |
| 676 | ARIZONA_MIXER_WIDGETS(Mic, "Mic"), |
| 677 | ARIZONA_MIXER_WIDGETS(Noise, "Noise"), |
| 678 | |
| 679 | ARIZONA_MIXER_WIDGETS(PWM1, "PWM1"), |
| 680 | ARIZONA_MIXER_WIDGETS(PWM2, "PWM2"), |
| 681 | |
| 682 | ARIZONA_MIXER_WIDGETS(OUT1L, "HPOUT1L"), |
| 683 | ARIZONA_MIXER_WIDGETS(OUT1R, "HPOUT1R"), |
| 684 | ARIZONA_MIXER_WIDGETS(OUT2L, "HPOUT2L"), |
| 685 | ARIZONA_MIXER_WIDGETS(OUT2R, "HPOUT2R"), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 686 | ARIZONA_MIXER_WIDGETS(OUT3L, "HPOUT3L"), |
| 687 | ARIZONA_MIXER_WIDGETS(OUT3R, "HPOUT3R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 688 | ARIZONA_MIXER_WIDGETS(SPKOUTL, "SPKOUTL"), |
| 689 | ARIZONA_MIXER_WIDGETS(SPKOUTR, "SPKOUTR"), |
| 690 | ARIZONA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"), |
| 691 | ARIZONA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"), |
| 692 | ARIZONA_MIXER_WIDGETS(SPKDAT2L, "SPKDAT2L"), |
| 693 | ARIZONA_MIXER_WIDGETS(SPKDAT2R, "SPKDAT2R"), |
| 694 | |
| 695 | ARIZONA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"), |
| 696 | ARIZONA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"), |
| 697 | ARIZONA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"), |
| 698 | ARIZONA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"), |
| 699 | ARIZONA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"), |
| 700 | ARIZONA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"), |
| 701 | ARIZONA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"), |
| 702 | ARIZONA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"), |
| 703 | |
| 704 | ARIZONA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"), |
| 705 | ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"), |
| 706 | |
| 707 | ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"), |
| 708 | ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"), |
| 709 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 710 | ARIZONA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"), |
| 711 | ARIZONA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"), |
| 712 | ARIZONA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"), |
| 713 | ARIZONA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"), |
| 714 | ARIZONA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"), |
| 715 | ARIZONA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"), |
| 716 | ARIZONA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"), |
| 717 | ARIZONA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"), |
| 718 | |
Charles Keepax | 5886c74 | 2012-11-13 16:40:34 +0000 | [diff] [blame] | 719 | ARIZONA_MUX_WIDGETS(ASRC1L, "ASRC1L"), |
| 720 | ARIZONA_MUX_WIDGETS(ASRC1R, "ASRC1R"), |
| 721 | ARIZONA_MUX_WIDGETS(ASRC2L, "ASRC2L"), |
| 722 | ARIZONA_MUX_WIDGETS(ASRC2R, "ASRC2R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 723 | |
| 724 | SND_SOC_DAPM_OUTPUT("HPOUT1L"), |
| 725 | SND_SOC_DAPM_OUTPUT("HPOUT1R"), |
| 726 | SND_SOC_DAPM_OUTPUT("HPOUT2L"), |
| 727 | SND_SOC_DAPM_OUTPUT("HPOUT2R"), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 728 | SND_SOC_DAPM_OUTPUT("HPOUT3L"), |
| 729 | SND_SOC_DAPM_OUTPUT("HPOUT3R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 730 | SND_SOC_DAPM_OUTPUT("SPKOUTLN"), |
| 731 | SND_SOC_DAPM_OUTPUT("SPKOUTLP"), |
| 732 | SND_SOC_DAPM_OUTPUT("SPKOUTRN"), |
| 733 | SND_SOC_DAPM_OUTPUT("SPKOUTRP"), |
| 734 | SND_SOC_DAPM_OUTPUT("SPKDAT1L"), |
| 735 | SND_SOC_DAPM_OUTPUT("SPKDAT1R"), |
| 736 | SND_SOC_DAPM_OUTPUT("SPKDAT2L"), |
| 737 | SND_SOC_DAPM_OUTPUT("SPKDAT2R"), |
Mark Brown | 57a10a1 | 2013-01-10 19:32:33 +0000 | [diff] [blame] | 738 | |
| 739 | SND_SOC_DAPM_OUTPUT("MICSUPP"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 740 | }; |
| 741 | |
| 742 | #define ARIZONA_MIXER_INPUT_ROUTES(name) \ |
| 743 | { name, "Noise Generator", "Noise Generator" }, \ |
| 744 | { name, "Tone Generator 1", "Tone Generator 1" }, \ |
| 745 | { name, "Tone Generator 2", "Tone Generator 2" }, \ |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 746 | { name, "Haptics", "HAPTICS" }, \ |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 747 | { name, "AEC", "AEC Loopback" }, \ |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 748 | { name, "IN1L", "IN1L PGA" }, \ |
| 749 | { name, "IN1R", "IN1R PGA" }, \ |
| 750 | { name, "IN2L", "IN2L PGA" }, \ |
| 751 | { name, "IN2R", "IN2R PGA" }, \ |
| 752 | { name, "IN3L", "IN3L PGA" }, \ |
| 753 | { name, "IN3R", "IN3R PGA" }, \ |
| 754 | { name, "IN4L", "IN4L PGA" }, \ |
| 755 | { name, "IN4R", "IN4R PGA" }, \ |
| 756 | { name, "Mic Mute Mixer", "Mic Mute Mixer" }, \ |
| 757 | { name, "AIF1RX1", "AIF1RX1" }, \ |
| 758 | { name, "AIF1RX2", "AIF1RX2" }, \ |
| 759 | { name, "AIF1RX3", "AIF1RX3" }, \ |
| 760 | { name, "AIF1RX4", "AIF1RX4" }, \ |
| 761 | { name, "AIF1RX5", "AIF1RX5" }, \ |
| 762 | { name, "AIF1RX6", "AIF1RX6" }, \ |
| 763 | { name, "AIF1RX7", "AIF1RX7" }, \ |
| 764 | { name, "AIF1RX8", "AIF1RX8" }, \ |
| 765 | { name, "AIF2RX1", "AIF2RX1" }, \ |
| 766 | { name, "AIF2RX2", "AIF2RX2" }, \ |
| 767 | { name, "AIF3RX1", "AIF3RX1" }, \ |
| 768 | { name, "AIF3RX2", "AIF3RX2" }, \ |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 769 | { name, "SLIMRX1", "SLIMRX1" }, \ |
| 770 | { name, "SLIMRX2", "SLIMRX2" }, \ |
| 771 | { name, "SLIMRX3", "SLIMRX3" }, \ |
| 772 | { name, "SLIMRX4", "SLIMRX4" }, \ |
| 773 | { name, "SLIMRX5", "SLIMRX5" }, \ |
| 774 | { name, "SLIMRX6", "SLIMRX6" }, \ |
| 775 | { name, "SLIMRX7", "SLIMRX7" }, \ |
| 776 | { name, "SLIMRX8", "SLIMRX8" }, \ |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 777 | { name, "EQ1", "EQ1" }, \ |
| 778 | { name, "EQ2", "EQ2" }, \ |
| 779 | { name, "EQ3", "EQ3" }, \ |
| 780 | { name, "EQ4", "EQ4" }, \ |
| 781 | { name, "DRC1L", "DRC1L" }, \ |
| 782 | { name, "DRC1R", "DRC1R" }, \ |
| 783 | { name, "DRC2L", "DRC2L" }, \ |
| 784 | { name, "DRC2R", "DRC2R" }, \ |
| 785 | { name, "LHPF1", "LHPF1" }, \ |
| 786 | { name, "LHPF2", "LHPF2" }, \ |
| 787 | { name, "LHPF3", "LHPF3" }, \ |
| 788 | { name, "LHPF4", "LHPF4" }, \ |
| 789 | { name, "ASRC1L", "ASRC1L" }, \ |
| 790 | { name, "ASRC1R", "ASRC1R" }, \ |
| 791 | { name, "ASRC2L", "ASRC2L" }, \ |
| 792 | { name, "ASRC2R", "ASRC2R" } |
| 793 | |
| 794 | static const struct snd_soc_dapm_route wm5110_dapm_routes[] = { |
| 795 | { "AIF2 Capture", NULL, "DBVDD2" }, |
| 796 | { "AIF2 Playback", NULL, "DBVDD2" }, |
| 797 | |
| 798 | { "AIF3 Capture", NULL, "DBVDD3" }, |
| 799 | { "AIF3 Playback", NULL, "DBVDD3" }, |
| 800 | |
| 801 | { "OUT1L", NULL, "CPVDD" }, |
| 802 | { "OUT1R", NULL, "CPVDD" }, |
| 803 | { "OUT2L", NULL, "CPVDD" }, |
| 804 | { "OUT2R", NULL, "CPVDD" }, |
| 805 | { "OUT3L", NULL, "CPVDD" }, |
Mark Brown | 20bf691 | 2012-09-26 17:52:36 +0100 | [diff] [blame] | 806 | { "OUT3R", NULL, "CPVDD" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 807 | |
| 808 | { "OUT4L", NULL, "SPKVDDL" }, |
| 809 | { "OUT4R", NULL, "SPKVDDR" }, |
| 810 | |
| 811 | { "OUT1L", NULL, "SYSCLK" }, |
| 812 | { "OUT1R", NULL, "SYSCLK" }, |
| 813 | { "OUT2L", NULL, "SYSCLK" }, |
| 814 | { "OUT2R", NULL, "SYSCLK" }, |
| 815 | { "OUT3L", NULL, "SYSCLK" }, |
| 816 | { "OUT4L", NULL, "SYSCLK" }, |
| 817 | { "OUT4R", NULL, "SYSCLK" }, |
| 818 | { "OUT5L", NULL, "SYSCLK" }, |
| 819 | { "OUT5R", NULL, "SYSCLK" }, |
| 820 | { "OUT6L", NULL, "SYSCLK" }, |
| 821 | { "OUT6R", NULL, "SYSCLK" }, |
| 822 | |
Charles Keepax | 6dc6a3f | 2013-06-05 14:51:31 +0100 | [diff] [blame] | 823 | { "IN1L", NULL, "SYSCLK" }, |
| 824 | { "IN1R", NULL, "SYSCLK" }, |
| 825 | { "IN2L", NULL, "SYSCLK" }, |
| 826 | { "IN2R", NULL, "SYSCLK" }, |
| 827 | { "IN3L", NULL, "SYSCLK" }, |
| 828 | { "IN3R", NULL, "SYSCLK" }, |
| 829 | { "IN4L", NULL, "SYSCLK" }, |
| 830 | { "IN4R", NULL, "SYSCLK" }, |
| 831 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 832 | { "MICBIAS1", NULL, "MICVDD" }, |
| 833 | { "MICBIAS2", NULL, "MICVDD" }, |
| 834 | { "MICBIAS3", NULL, "MICVDD" }, |
| 835 | |
Charles Keepax | 6dc6a3f | 2013-06-05 14:51:31 +0100 | [diff] [blame] | 836 | { "Noise Generator", NULL, "SYSCLK" }, |
| 837 | { "Tone Generator 1", NULL, "SYSCLK" }, |
| 838 | { "Tone Generator 2", NULL, "SYSCLK" }, |
| 839 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 840 | { "Noise Generator", NULL, "NOISE" }, |
| 841 | { "Tone Generator 1", NULL, "TONE" }, |
| 842 | { "Tone Generator 2", NULL, "TONE" }, |
| 843 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 844 | { "AIF1 Capture", NULL, "AIF1TX1" }, |
| 845 | { "AIF1 Capture", NULL, "AIF1TX2" }, |
| 846 | { "AIF1 Capture", NULL, "AIF1TX3" }, |
| 847 | { "AIF1 Capture", NULL, "AIF1TX4" }, |
| 848 | { "AIF1 Capture", NULL, "AIF1TX5" }, |
| 849 | { "AIF1 Capture", NULL, "AIF1TX6" }, |
| 850 | { "AIF1 Capture", NULL, "AIF1TX7" }, |
| 851 | { "AIF1 Capture", NULL, "AIF1TX8" }, |
| 852 | |
| 853 | { "AIF1RX1", NULL, "AIF1 Playback" }, |
| 854 | { "AIF1RX2", NULL, "AIF1 Playback" }, |
| 855 | { "AIF1RX3", NULL, "AIF1 Playback" }, |
| 856 | { "AIF1RX4", NULL, "AIF1 Playback" }, |
| 857 | { "AIF1RX5", NULL, "AIF1 Playback" }, |
| 858 | { "AIF1RX6", NULL, "AIF1 Playback" }, |
| 859 | { "AIF1RX7", NULL, "AIF1 Playback" }, |
| 860 | { "AIF1RX8", NULL, "AIF1 Playback" }, |
| 861 | |
| 862 | { "AIF2 Capture", NULL, "AIF2TX1" }, |
| 863 | { "AIF2 Capture", NULL, "AIF2TX2" }, |
| 864 | |
| 865 | { "AIF2RX1", NULL, "AIF2 Playback" }, |
| 866 | { "AIF2RX2", NULL, "AIF2 Playback" }, |
| 867 | |
| 868 | { "AIF3 Capture", NULL, "AIF3TX1" }, |
| 869 | { "AIF3 Capture", NULL, "AIF3TX2" }, |
| 870 | |
| 871 | { "AIF3RX1", NULL, "AIF3 Playback" }, |
| 872 | { "AIF3RX2", NULL, "AIF3 Playback" }, |
| 873 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 874 | { "Slim1 Capture", NULL, "SLIMTX1" }, |
| 875 | { "Slim1 Capture", NULL, "SLIMTX2" }, |
| 876 | { "Slim1 Capture", NULL, "SLIMTX3" }, |
| 877 | { "Slim1 Capture", NULL, "SLIMTX4" }, |
| 878 | |
| 879 | { "SLIMRX1", NULL, "Slim1 Playback" }, |
| 880 | { "SLIMRX2", NULL, "Slim1 Playback" }, |
| 881 | { "SLIMRX3", NULL, "Slim1 Playback" }, |
| 882 | { "SLIMRX4", NULL, "Slim1 Playback" }, |
| 883 | |
| 884 | { "Slim2 Capture", NULL, "SLIMTX5" }, |
| 885 | { "Slim2 Capture", NULL, "SLIMTX6" }, |
| 886 | |
| 887 | { "SLIMRX5", NULL, "Slim2 Playback" }, |
| 888 | { "SLIMRX6", NULL, "Slim2 Playback" }, |
| 889 | |
| 890 | { "Slim3 Capture", NULL, "SLIMTX7" }, |
| 891 | { "Slim3 Capture", NULL, "SLIMTX8" }, |
| 892 | |
| 893 | { "SLIMRX7", NULL, "Slim3 Playback" }, |
| 894 | { "SLIMRX8", NULL, "Slim3 Playback" }, |
| 895 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 896 | { "AIF1 Playback", NULL, "SYSCLK" }, |
| 897 | { "AIF2 Playback", NULL, "SYSCLK" }, |
| 898 | { "AIF3 Playback", NULL, "SYSCLK" }, |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 899 | { "Slim1 Playback", NULL, "SYSCLK" }, |
| 900 | { "Slim2 Playback", NULL, "SYSCLK" }, |
| 901 | { "Slim3 Playback", NULL, "SYSCLK" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 902 | |
| 903 | { "AIF1 Capture", NULL, "SYSCLK" }, |
| 904 | { "AIF2 Capture", NULL, "SYSCLK" }, |
| 905 | { "AIF3 Capture", NULL, "SYSCLK" }, |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 906 | { "Slim1 Capture", NULL, "SYSCLK" }, |
| 907 | { "Slim2 Capture", NULL, "SYSCLK" }, |
| 908 | { "Slim3 Capture", NULL, "SYSCLK" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 909 | |
Mark Brown | 17c3f7e | 2012-08-10 15:40:22 +0100 | [diff] [blame] | 910 | { "IN1L PGA", NULL, "IN1L" }, |
| 911 | { "IN1R PGA", NULL, "IN1R" }, |
| 912 | |
| 913 | { "IN2L PGA", NULL, "IN2L" }, |
| 914 | { "IN2R PGA", NULL, "IN2R" }, |
| 915 | |
| 916 | { "IN3L PGA", NULL, "IN3L" }, |
| 917 | { "IN3R PGA", NULL, "IN3R" }, |
| 918 | |
| 919 | { "IN4L PGA", NULL, "IN4L" }, |
| 920 | { "IN4R PGA", NULL, "IN4R" }, |
| 921 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 922 | ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"), |
| 923 | ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"), |
| 924 | ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"), |
| 925 | ARIZONA_MIXER_ROUTES("OUT2R", "HPOUT2R"), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 926 | ARIZONA_MIXER_ROUTES("OUT3L", "HPOUT3L"), |
| 927 | ARIZONA_MIXER_ROUTES("OUT3R", "HPOUT3R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 928 | |
| 929 | ARIZONA_MIXER_ROUTES("OUT4L", "SPKOUTL"), |
| 930 | ARIZONA_MIXER_ROUTES("OUT4R", "SPKOUTR"), |
| 931 | ARIZONA_MIXER_ROUTES("OUT5L", "SPKDAT1L"), |
| 932 | ARIZONA_MIXER_ROUTES("OUT5R", "SPKDAT1R"), |
| 933 | ARIZONA_MIXER_ROUTES("OUT6L", "SPKDAT2L"), |
| 934 | ARIZONA_MIXER_ROUTES("OUT6R", "SPKDAT2R"), |
| 935 | |
| 936 | ARIZONA_MIXER_ROUTES("PWM1 Driver", "PWM1"), |
| 937 | ARIZONA_MIXER_ROUTES("PWM2 Driver", "PWM2"), |
| 938 | |
| 939 | ARIZONA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"), |
| 940 | ARIZONA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"), |
| 941 | ARIZONA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"), |
| 942 | ARIZONA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"), |
| 943 | ARIZONA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"), |
| 944 | ARIZONA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"), |
| 945 | ARIZONA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"), |
| 946 | ARIZONA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"), |
| 947 | |
| 948 | ARIZONA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"), |
| 949 | ARIZONA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"), |
| 950 | |
| 951 | ARIZONA_MIXER_ROUTES("AIF3TX1", "AIF3TX1"), |
| 952 | ARIZONA_MIXER_ROUTES("AIF3TX2", "AIF3TX2"), |
| 953 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 954 | ARIZONA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"), |
| 955 | ARIZONA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"), |
| 956 | ARIZONA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"), |
| 957 | ARIZONA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"), |
| 958 | ARIZONA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"), |
| 959 | ARIZONA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"), |
| 960 | ARIZONA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"), |
| 961 | ARIZONA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"), |
| 962 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 963 | ARIZONA_MIXER_ROUTES("EQ1", "EQ1"), |
| 964 | ARIZONA_MIXER_ROUTES("EQ2", "EQ2"), |
| 965 | ARIZONA_MIXER_ROUTES("EQ3", "EQ3"), |
| 966 | ARIZONA_MIXER_ROUTES("EQ4", "EQ4"), |
| 967 | |
| 968 | ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"), |
| 969 | ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"), |
| 970 | ARIZONA_MIXER_ROUTES("DRC2L", "DRC2L"), |
| 971 | ARIZONA_MIXER_ROUTES("DRC2R", "DRC2R"), |
| 972 | |
| 973 | ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"), |
| 974 | ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"), |
| 975 | ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"), |
| 976 | ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"), |
| 977 | |
Mark Brown | 66e7aa2 | 2013-08-12 23:59:08 +0100 | [diff] [blame] | 978 | ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Noise"), |
| 979 | ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"), |
| 980 | |
Charles Keepax | e7edb27 | 2013-08-12 11:33:32 +0100 | [diff] [blame] | 981 | ARIZONA_MUX_ROUTES("ASRC1L", "ASRC1L"), |
| 982 | ARIZONA_MUX_ROUTES("ASRC1R", "ASRC1R"), |
| 983 | ARIZONA_MUX_ROUTES("ASRC2L", "ASRC2L"), |
| 984 | ARIZONA_MUX_ROUTES("ASRC2R", "ASRC2R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 985 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 986 | { "AEC Loopback", "HPOUT1L", "OUT1L" }, |
| 987 | { "AEC Loopback", "HPOUT1R", "OUT1R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 988 | { "HPOUT1L", NULL, "OUT1L" }, |
| 989 | { "HPOUT1R", NULL, "OUT1R" }, |
| 990 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 991 | { "AEC Loopback", "HPOUT2L", "OUT2L" }, |
| 992 | { "AEC Loopback", "HPOUT2R", "OUT2R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 993 | { "HPOUT2L", NULL, "OUT2L" }, |
| 994 | { "HPOUT2R", NULL, "OUT2R" }, |
| 995 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 996 | { "AEC Loopback", "HPOUT3L", "OUT3L" }, |
| 997 | { "AEC Loopback", "HPOUT3R", "OUT3R" }, |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 998 | { "HPOUT3L", NULL, "OUT3L" }, |
| 999 | { "HPOUT3R", NULL, "OUT3L" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1000 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1001 | { "AEC Loopback", "SPKOUTL", "OUT4L" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1002 | { "SPKOUTLN", NULL, "OUT4L" }, |
| 1003 | { "SPKOUTLP", NULL, "OUT4L" }, |
| 1004 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1005 | { "AEC Loopback", "SPKOUTR", "OUT4R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1006 | { "SPKOUTRN", NULL, "OUT4R" }, |
| 1007 | { "SPKOUTRP", NULL, "OUT4R" }, |
| 1008 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1009 | { "AEC Loopback", "SPKDAT1L", "OUT5L" }, |
| 1010 | { "AEC Loopback", "SPKDAT1R", "OUT5R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1011 | { "SPKDAT1L", NULL, "OUT5L" }, |
| 1012 | { "SPKDAT1R", NULL, "OUT5R" }, |
| 1013 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1014 | { "AEC Loopback", "SPKDAT2L", "OUT6L" }, |
| 1015 | { "AEC Loopback", "SPKDAT2R", "OUT6R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1016 | { "SPKDAT2L", NULL, "OUT6L" }, |
| 1017 | { "SPKDAT2R", NULL, "OUT6R" }, |
Mark Brown | 57a10a1 | 2013-01-10 19:32:33 +0000 | [diff] [blame] | 1018 | |
| 1019 | { "MICSUPP", NULL, "SYSCLK" }, |
Charles Keepax | b63144e | 2013-07-04 08:56:28 +0100 | [diff] [blame] | 1020 | |
| 1021 | { "DRC1 Signal Activity", NULL, "DRC1L" }, |
| 1022 | { "DRC1 Signal Activity", NULL, "DRC1R" }, |
| 1023 | { "DRC2 Signal Activity", NULL, "DRC2L" }, |
| 1024 | { "DRC2 Signal Activity", NULL, "DRC2R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1025 | }; |
| 1026 | |
| 1027 | static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source, |
| 1028 | unsigned int Fref, unsigned int Fout) |
| 1029 | { |
| 1030 | struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec); |
| 1031 | |
| 1032 | switch (fll_id) { |
| 1033 | case WM5110_FLL1: |
| 1034 | return arizona_set_fll(&wm5110->fll[0], source, Fref, Fout); |
| 1035 | case WM5110_FLL2: |
| 1036 | return arizona_set_fll(&wm5110->fll[1], source, Fref, Fout); |
Charles Keepax | ee929a9 | 2013-02-20 17:28:40 +0000 | [diff] [blame] | 1037 | case WM5110_FLL1_REFCLK: |
| 1038 | return arizona_set_fll_refclk(&wm5110->fll[0], source, Fref, |
| 1039 | Fout); |
| 1040 | case WM5110_FLL2_REFCLK: |
| 1041 | return arizona_set_fll_refclk(&wm5110->fll[1], source, Fref, |
| 1042 | Fout); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1043 | default: |
| 1044 | return -EINVAL; |
| 1045 | } |
| 1046 | } |
| 1047 | |
| 1048 | #define WM5110_RATES SNDRV_PCM_RATE_8000_192000 |
| 1049 | |
| 1050 | #define WM5110_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
| 1051 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
| 1052 | |
| 1053 | static struct snd_soc_dai_driver wm5110_dai[] = { |
| 1054 | { |
| 1055 | .name = "wm5110-aif1", |
| 1056 | .id = 1, |
| 1057 | .base = ARIZONA_AIF1_BCLK_CTRL, |
| 1058 | .playback = { |
| 1059 | .stream_name = "AIF1 Playback", |
| 1060 | .channels_min = 1, |
| 1061 | .channels_max = 8, |
| 1062 | .rates = WM5110_RATES, |
| 1063 | .formats = WM5110_FORMATS, |
| 1064 | }, |
| 1065 | .capture = { |
| 1066 | .stream_name = "AIF1 Capture", |
| 1067 | .channels_min = 1, |
| 1068 | .channels_max = 8, |
| 1069 | .rates = WM5110_RATES, |
| 1070 | .formats = WM5110_FORMATS, |
| 1071 | }, |
| 1072 | .ops = &arizona_dai_ops, |
| 1073 | .symmetric_rates = 1, |
| 1074 | }, |
| 1075 | { |
| 1076 | .name = "wm5110-aif2", |
| 1077 | .id = 2, |
| 1078 | .base = ARIZONA_AIF2_BCLK_CTRL, |
| 1079 | .playback = { |
| 1080 | .stream_name = "AIF2 Playback", |
| 1081 | .channels_min = 1, |
| 1082 | .channels_max = 2, |
| 1083 | .rates = WM5110_RATES, |
| 1084 | .formats = WM5110_FORMATS, |
| 1085 | }, |
| 1086 | .capture = { |
| 1087 | .stream_name = "AIF2 Capture", |
| 1088 | .channels_min = 1, |
| 1089 | .channels_max = 2, |
| 1090 | .rates = WM5110_RATES, |
| 1091 | .formats = WM5110_FORMATS, |
| 1092 | }, |
| 1093 | .ops = &arizona_dai_ops, |
| 1094 | .symmetric_rates = 1, |
| 1095 | }, |
| 1096 | { |
| 1097 | .name = "wm5110-aif3", |
| 1098 | .id = 3, |
| 1099 | .base = ARIZONA_AIF3_BCLK_CTRL, |
| 1100 | .playback = { |
| 1101 | .stream_name = "AIF3 Playback", |
| 1102 | .channels_min = 1, |
| 1103 | .channels_max = 2, |
| 1104 | .rates = WM5110_RATES, |
| 1105 | .formats = WM5110_FORMATS, |
| 1106 | }, |
| 1107 | .capture = { |
| 1108 | .stream_name = "AIF3 Capture", |
| 1109 | .channels_min = 1, |
| 1110 | .channels_max = 2, |
| 1111 | .rates = WM5110_RATES, |
| 1112 | .formats = WM5110_FORMATS, |
| 1113 | }, |
| 1114 | .ops = &arizona_dai_ops, |
| 1115 | .symmetric_rates = 1, |
| 1116 | }, |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1117 | { |
| 1118 | .name = "wm5110-slim1", |
| 1119 | .id = 4, |
| 1120 | .playback = { |
| 1121 | .stream_name = "Slim1 Playback", |
| 1122 | .channels_min = 1, |
| 1123 | .channels_max = 4, |
| 1124 | .rates = WM5110_RATES, |
| 1125 | .formats = WM5110_FORMATS, |
| 1126 | }, |
| 1127 | .capture = { |
| 1128 | .stream_name = "Slim1 Capture", |
| 1129 | .channels_min = 1, |
| 1130 | .channels_max = 4, |
| 1131 | .rates = WM5110_RATES, |
| 1132 | .formats = WM5110_FORMATS, |
| 1133 | }, |
| 1134 | .ops = &arizona_simple_dai_ops, |
| 1135 | }, |
| 1136 | { |
| 1137 | .name = "wm5110-slim2", |
| 1138 | .id = 5, |
| 1139 | .playback = { |
| 1140 | .stream_name = "Slim2 Playback", |
| 1141 | .channels_min = 1, |
| 1142 | .channels_max = 2, |
| 1143 | .rates = WM5110_RATES, |
| 1144 | .formats = WM5110_FORMATS, |
| 1145 | }, |
| 1146 | .capture = { |
| 1147 | .stream_name = "Slim2 Capture", |
| 1148 | .channels_min = 1, |
| 1149 | .channels_max = 2, |
| 1150 | .rates = WM5110_RATES, |
| 1151 | .formats = WM5110_FORMATS, |
| 1152 | }, |
| 1153 | .ops = &arizona_simple_dai_ops, |
| 1154 | }, |
| 1155 | { |
| 1156 | .name = "wm5110-slim3", |
| 1157 | .id = 6, |
| 1158 | .playback = { |
| 1159 | .stream_name = "Slim3 Playback", |
| 1160 | .channels_min = 1, |
| 1161 | .channels_max = 2, |
| 1162 | .rates = WM5110_RATES, |
| 1163 | .formats = WM5110_FORMATS, |
| 1164 | }, |
| 1165 | .capture = { |
| 1166 | .stream_name = "Slim3 Capture", |
| 1167 | .channels_min = 1, |
| 1168 | .channels_max = 2, |
| 1169 | .rates = WM5110_RATES, |
| 1170 | .formats = WM5110_FORMATS, |
| 1171 | }, |
| 1172 | .ops = &arizona_simple_dai_ops, |
| 1173 | }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1174 | }; |
| 1175 | |
| 1176 | static int wm5110_codec_probe(struct snd_soc_codec *codec) |
| 1177 | { |
| 1178 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 1179 | int ret; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1180 | |
| 1181 | codec->control_data = priv->core.arizona->regmap; |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 1182 | priv->core.arizona->dapm = &codec->dapm; |
| 1183 | |
| 1184 | ret = snd_soc_codec_set_cache_io(codec, 32, 16, SND_SOC_REGMAP); |
| 1185 | if (ret != 0) |
| 1186 | return ret; |
| 1187 | |
Mark Brown | 62cc4d5 | 2013-05-20 11:28:35 -0500 | [diff] [blame] | 1188 | arizona_init_spk(codec); |
Charles Keepax | b63144e | 2013-07-04 08:56:28 +0100 | [diff] [blame] | 1189 | arizona_init_gpio(codec); |
Mark Brown | 62cc4d5 | 2013-05-20 11:28:35 -0500 | [diff] [blame] | 1190 | |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 1191 | snd_soc_dapm_disable_pin(&codec->dapm, "HAPTICS"); |
| 1192 | |
| 1193 | priv->core.arizona->dapm = &codec->dapm; |
| 1194 | |
| 1195 | return 0; |
| 1196 | } |
| 1197 | |
| 1198 | static int wm5110_codec_remove(struct snd_soc_codec *codec) |
| 1199 | { |
| 1200 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); |
| 1201 | |
| 1202 | priv->core.arizona->dapm = NULL; |
| 1203 | |
| 1204 | return 0; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1205 | } |
| 1206 | |
| 1207 | #define WM5110_DIG_VU 0x0200 |
| 1208 | |
| 1209 | static unsigned int wm5110_digital_vu[] = { |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1210 | ARIZONA_DAC_DIGITAL_VOLUME_1L, |
| 1211 | ARIZONA_DAC_DIGITAL_VOLUME_1R, |
| 1212 | ARIZONA_DAC_DIGITAL_VOLUME_2L, |
| 1213 | ARIZONA_DAC_DIGITAL_VOLUME_2R, |
| 1214 | ARIZONA_DAC_DIGITAL_VOLUME_3L, |
| 1215 | ARIZONA_DAC_DIGITAL_VOLUME_3R, |
| 1216 | ARIZONA_DAC_DIGITAL_VOLUME_4L, |
| 1217 | ARIZONA_DAC_DIGITAL_VOLUME_4R, |
| 1218 | ARIZONA_DAC_DIGITAL_VOLUME_5L, |
| 1219 | ARIZONA_DAC_DIGITAL_VOLUME_5R, |
Charles Keepax | ae60503 | 2012-09-27 13:21:48 +0100 | [diff] [blame] | 1220 | ARIZONA_DAC_DIGITAL_VOLUME_6L, |
| 1221 | ARIZONA_DAC_DIGITAL_VOLUME_6R, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1222 | }; |
| 1223 | |
| 1224 | static struct snd_soc_codec_driver soc_codec_dev_wm5110 = { |
| 1225 | .probe = wm5110_codec_probe, |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 1226 | .remove = wm5110_codec_remove, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1227 | |
| 1228 | .idle_bias_off = true, |
| 1229 | |
| 1230 | .set_sysclk = arizona_set_sysclk, |
| 1231 | .set_pll = wm5110_set_fll, |
| 1232 | |
| 1233 | .controls = wm5110_snd_controls, |
| 1234 | .num_controls = ARRAY_SIZE(wm5110_snd_controls), |
| 1235 | .dapm_widgets = wm5110_dapm_widgets, |
| 1236 | .num_dapm_widgets = ARRAY_SIZE(wm5110_dapm_widgets), |
| 1237 | .dapm_routes = wm5110_dapm_routes, |
| 1238 | .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes), |
| 1239 | }; |
| 1240 | |
Bill Pemberton | 7a79e94 | 2012-12-07 09:26:37 -0500 | [diff] [blame] | 1241 | static int wm5110_probe(struct platform_device *pdev) |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1242 | { |
| 1243 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); |
| 1244 | struct wm5110_priv *wm5110; |
| 1245 | int i; |
| 1246 | |
| 1247 | wm5110 = devm_kzalloc(&pdev->dev, sizeof(struct wm5110_priv), |
| 1248 | GFP_KERNEL); |
| 1249 | if (wm5110 == NULL) |
| 1250 | return -ENOMEM; |
| 1251 | platform_set_drvdata(pdev, wm5110); |
| 1252 | |
| 1253 | wm5110->core.arizona = arizona; |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1254 | wm5110->core.num_inputs = 8; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1255 | |
| 1256 | for (i = 0; i < ARRAY_SIZE(wm5110->fll); i++) |
| 1257 | wm5110->fll[i].vco_mult = 3; |
| 1258 | |
| 1259 | arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1, |
| 1260 | ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK, |
| 1261 | &wm5110->fll[0]); |
| 1262 | arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1, |
| 1263 | ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK, |
| 1264 | &wm5110->fll[1]); |
| 1265 | |
| 1266 | for (i = 0; i < ARRAY_SIZE(wm5110_dai); i++) |
| 1267 | arizona_init_dai(&wm5110->core, i); |
| 1268 | |
| 1269 | /* Latch volume update bits */ |
| 1270 | for (i = 0; i < ARRAY_SIZE(wm5110_digital_vu); i++) |
| 1271 | regmap_update_bits(arizona->regmap, wm5110_digital_vu[i], |
| 1272 | WM5110_DIG_VU, WM5110_DIG_VU); |
| 1273 | |
| 1274 | pm_runtime_enable(&pdev->dev); |
| 1275 | pm_runtime_idle(&pdev->dev); |
| 1276 | |
| 1277 | return snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm5110, |
| 1278 | wm5110_dai, ARRAY_SIZE(wm5110_dai)); |
| 1279 | } |
| 1280 | |
Bill Pemberton | 7a79e94 | 2012-12-07 09:26:37 -0500 | [diff] [blame] | 1281 | static int wm5110_remove(struct platform_device *pdev) |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1282 | { |
| 1283 | snd_soc_unregister_codec(&pdev->dev); |
| 1284 | pm_runtime_disable(&pdev->dev); |
| 1285 | |
| 1286 | return 0; |
| 1287 | } |
| 1288 | |
| 1289 | static struct platform_driver wm5110_codec_driver = { |
| 1290 | .driver = { |
| 1291 | .name = "wm5110-codec", |
| 1292 | .owner = THIS_MODULE, |
| 1293 | }, |
| 1294 | .probe = wm5110_probe, |
Bill Pemberton | 7a79e94 | 2012-12-07 09:26:37 -0500 | [diff] [blame] | 1295 | .remove = wm5110_remove, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1296 | }; |
| 1297 | |
| 1298 | module_platform_driver(wm5110_codec_driver); |
| 1299 | |
| 1300 | MODULE_DESCRIPTION("ASoC WM5110 driver"); |
| 1301 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
| 1302 | MODULE_LICENSE("GPL"); |
| 1303 | MODULE_ALIAS("platform:wm5110-codec"); |