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" |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 33 | #include "wm_adsp.h" |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 34 | #include "wm5110.h" |
| 35 | |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 36 | #define WM5110_NUM_ADSP 4 |
| 37 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 38 | struct wm5110_priv { |
| 39 | struct arizona_priv core; |
| 40 | struct arizona_fll fll[2]; |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 41 | |
| 42 | unsigned int in_value; |
| 43 | int in_pre_pending; |
| 44 | int in_post_pending; |
| 45 | |
| 46 | unsigned int in_pga_cache[6]; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 47 | }; |
| 48 | |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 49 | static const struct wm_adsp_region wm5110_dsp1_regions[] = { |
| 50 | { .type = WMFW_ADSP2_PM, .base = 0x100000 }, |
| 51 | { .type = WMFW_ADSP2_ZM, .base = 0x180000 }, |
| 52 | { .type = WMFW_ADSP2_XM, .base = 0x190000 }, |
| 53 | { .type = WMFW_ADSP2_YM, .base = 0x1a8000 }, |
| 54 | }; |
| 55 | |
| 56 | static const struct wm_adsp_region wm5110_dsp2_regions[] = { |
| 57 | { .type = WMFW_ADSP2_PM, .base = 0x200000 }, |
| 58 | { .type = WMFW_ADSP2_ZM, .base = 0x280000 }, |
| 59 | { .type = WMFW_ADSP2_XM, .base = 0x290000 }, |
| 60 | { .type = WMFW_ADSP2_YM, .base = 0x2a8000 }, |
| 61 | }; |
| 62 | |
| 63 | static const struct wm_adsp_region wm5110_dsp3_regions[] = { |
| 64 | { .type = WMFW_ADSP2_PM, .base = 0x300000 }, |
| 65 | { .type = WMFW_ADSP2_ZM, .base = 0x380000 }, |
| 66 | { .type = WMFW_ADSP2_XM, .base = 0x390000 }, |
| 67 | { .type = WMFW_ADSP2_YM, .base = 0x3a8000 }, |
| 68 | }; |
| 69 | |
| 70 | static const struct wm_adsp_region wm5110_dsp4_regions[] = { |
| 71 | { .type = WMFW_ADSP2_PM, .base = 0x400000 }, |
| 72 | { .type = WMFW_ADSP2_ZM, .base = 0x480000 }, |
| 73 | { .type = WMFW_ADSP2_XM, .base = 0x490000 }, |
| 74 | { .type = WMFW_ADSP2_YM, .base = 0x4a8000 }, |
| 75 | }; |
| 76 | |
| 77 | static const struct wm_adsp_region *wm5110_dsp_regions[] = { |
| 78 | wm5110_dsp1_regions, |
| 79 | wm5110_dsp2_regions, |
| 80 | wm5110_dsp3_regions, |
| 81 | wm5110_dsp4_regions, |
| 82 | }; |
| 83 | |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 84 | static const struct reg_default wm5110_sysclk_revd_patch[] = { |
| 85 | { 0x3093, 0x1001 }, |
| 86 | { 0x30E3, 0x1301 }, |
| 87 | { 0x3133, 0x1201 }, |
| 88 | { 0x3183, 0x1501 }, |
| 89 | { 0x31D3, 0x1401 }, |
Charles Keepax | 3435479 | 2014-01-21 16:27:51 +0000 | [diff] [blame] | 90 | { 0x0049, 0x01ea }, |
| 91 | { 0x004a, 0x01f2 }, |
| 92 | { 0x0057, 0x01e7 }, |
| 93 | { 0x0058, 0x01fb }, |
| 94 | { 0x33ce, 0xc4f5 }, |
| 95 | { 0x33cf, 0x1361 }, |
| 96 | { 0x33d0, 0x0402 }, |
| 97 | { 0x33d1, 0x4700 }, |
| 98 | { 0x33d2, 0x026d }, |
| 99 | { 0x33d3, 0xff00 }, |
| 100 | { 0x33d4, 0x026d }, |
| 101 | { 0x33d5, 0x0101 }, |
| 102 | { 0x33d6, 0xc4f5 }, |
| 103 | { 0x33d7, 0x0361 }, |
| 104 | { 0x33d8, 0x0402 }, |
| 105 | { 0x33d9, 0x6701 }, |
| 106 | { 0x33da, 0xc4f5 }, |
| 107 | { 0x33db, 0x136f }, |
| 108 | { 0x33dc, 0xc4f5 }, |
| 109 | { 0x33dd, 0x134f }, |
| 110 | { 0x33de, 0xc4f5 }, |
| 111 | { 0x33df, 0x131f }, |
| 112 | { 0x33e0, 0x026d }, |
| 113 | { 0x33e1, 0x4f01 }, |
| 114 | { 0x33e2, 0x026d }, |
| 115 | { 0x33e3, 0xf100 }, |
| 116 | { 0x33e4, 0x026d }, |
| 117 | { 0x33e5, 0x0001 }, |
| 118 | { 0x33e6, 0xc4f5 }, |
| 119 | { 0x33e7, 0x0361 }, |
| 120 | { 0x33e8, 0x0402 }, |
| 121 | { 0x33e9, 0x6601 }, |
| 122 | { 0x33ea, 0xc4f5 }, |
| 123 | { 0x33eb, 0x136f }, |
| 124 | { 0x33ec, 0xc4f5 }, |
| 125 | { 0x33ed, 0x134f }, |
| 126 | { 0x33ee, 0xc4f5 }, |
| 127 | { 0x33ef, 0x131f }, |
| 128 | { 0x33f0, 0x026d }, |
| 129 | { 0x33f1, 0x4e01 }, |
| 130 | { 0x33f2, 0x026d }, |
| 131 | { 0x33f3, 0xf000 }, |
| 132 | { 0x33f6, 0xc4f5 }, |
| 133 | { 0x33f7, 0x1361 }, |
| 134 | { 0x33f8, 0x0402 }, |
| 135 | { 0x33f9, 0x4600 }, |
| 136 | { 0x33fa, 0x026d }, |
| 137 | { 0x33fb, 0xfe00 }, |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 138 | }; |
| 139 | |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 140 | static const struct reg_default wm5110_sysclk_reve_patch[] = { |
| 141 | { 0x3270, 0xE410 }, |
| 142 | { 0x3271, 0x3078 }, |
| 143 | { 0x3272, 0xE410 }, |
| 144 | { 0x3273, 0x3070 }, |
| 145 | { 0x3274, 0xE410 }, |
| 146 | { 0x3275, 0x3066 }, |
| 147 | { 0x3276, 0xE410 }, |
| 148 | { 0x3277, 0x3056 }, |
| 149 | { 0x327A, 0xE414 }, |
| 150 | { 0x327B, 0x3078 }, |
| 151 | { 0x327C, 0xE414 }, |
| 152 | { 0x327D, 0x3070 }, |
| 153 | { 0x327E, 0xE414 }, |
| 154 | { 0x327F, 0x3066 }, |
| 155 | { 0x3280, 0xE414 }, |
| 156 | { 0x3281, 0x3056 }, |
| 157 | }; |
| 158 | |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 159 | static int wm5110_sysclk_ev(struct snd_soc_dapm_widget *w, |
| 160 | struct snd_kcontrol *kcontrol, int event) |
| 161 | { |
Lars-Peter Clausen | cf53380 | 2015-01-13 10:27:11 +0100 | [diff] [blame] | 162 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 163 | struct arizona *arizona = dev_get_drvdata(codec->dev->parent); |
Lars-Peter Clausen | 055bbe2 | 2014-03-01 13:45:32 +0100 | [diff] [blame] | 164 | struct regmap *regmap = arizona->regmap; |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 165 | const struct reg_default *patch = NULL; |
| 166 | int i, patch_size; |
| 167 | |
| 168 | switch (arizona->rev) { |
| 169 | case 3: |
| 170 | patch = wm5110_sysclk_revd_patch; |
| 171 | patch_size = ARRAY_SIZE(wm5110_sysclk_revd_patch); |
| 172 | break; |
| 173 | default: |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 174 | patch = wm5110_sysclk_reve_patch; |
| 175 | patch_size = ARRAY_SIZE(wm5110_sysclk_reve_patch); |
| 176 | break; |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | switch (event) { |
| 180 | case SND_SOC_DAPM_POST_PMU: |
| 181 | if (patch) |
| 182 | for (i = 0; i < patch_size; i++) |
Mark Brown | 959e408 | 2013-12-12 00:49:56 +0000 | [diff] [blame] | 183 | regmap_write_async(regmap, patch[i].reg, |
| 184 | patch[i].def); |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 185 | break; |
| 186 | |
| 187 | default: |
| 188 | break; |
| 189 | } |
| 190 | |
| 191 | return 0; |
| 192 | } |
| 193 | |
Charles Keepax | d82d767 | 2016-01-21 17:53:02 +0000 | [diff] [blame] | 194 | static int wm5110_adsp_power_ev(struct snd_soc_dapm_widget *w, |
| 195 | struct snd_kcontrol *kcontrol, int event) |
| 196 | { |
| 197 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 198 | struct arizona *arizona = dev_get_drvdata(codec->dev->parent); |
| 199 | unsigned int v; |
| 200 | int ret; |
| 201 | |
| 202 | ret = regmap_read(arizona->regmap, ARIZONA_SYSTEM_CLOCK_1, &v); |
| 203 | if (ret != 0) { |
| 204 | dev_err(codec->dev, "Failed to read SYSCLK state: %d\n", ret); |
| 205 | return ret; |
| 206 | } |
| 207 | |
| 208 | v = (v & ARIZONA_SYSCLK_FREQ_MASK) >> ARIZONA_SYSCLK_FREQ_SHIFT; |
| 209 | |
| 210 | return wm_adsp2_early_event(w, kcontrol, event, v); |
| 211 | } |
| 212 | |
Nariman Poushin | dc606e05 | 2015-07-17 15:11:10 +0100 | [diff] [blame] | 213 | static const struct reg_sequence wm5110_no_dre_left_enable[] = { |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 214 | { 0x3024, 0xE410 }, |
| 215 | { 0x3025, 0x0056 }, |
| 216 | { 0x301B, 0x0224 }, |
| 217 | { 0x301F, 0x4263 }, |
| 218 | { 0x3021, 0x5291 }, |
| 219 | { 0x3030, 0xE410 }, |
| 220 | { 0x3031, 0x3066 }, |
| 221 | { 0x3032, 0xE410 }, |
| 222 | { 0x3033, 0x3070 }, |
| 223 | { 0x3034, 0xE410 }, |
| 224 | { 0x3035, 0x3078 }, |
| 225 | { 0x3036, 0xE410 }, |
| 226 | { 0x3037, 0x3080 }, |
| 227 | { 0x3038, 0xE410 }, |
| 228 | { 0x3039, 0x3080 }, |
| 229 | }; |
| 230 | |
Nariman Poushin | dc606e05 | 2015-07-17 15:11:10 +0100 | [diff] [blame] | 231 | static const struct reg_sequence wm5110_dre_left_enable[] = { |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 232 | { 0x3024, 0x0231 }, |
| 233 | { 0x3025, 0x0B00 }, |
| 234 | { 0x301B, 0x0227 }, |
| 235 | { 0x301F, 0x4266 }, |
| 236 | { 0x3021, 0x5294 }, |
| 237 | { 0x3030, 0xE231 }, |
| 238 | { 0x3031, 0x0266 }, |
| 239 | { 0x3032, 0x8231 }, |
| 240 | { 0x3033, 0x4B15 }, |
| 241 | { 0x3034, 0x8231 }, |
| 242 | { 0x3035, 0x0B15 }, |
| 243 | { 0x3036, 0xE231 }, |
| 244 | { 0x3037, 0x5294 }, |
| 245 | { 0x3038, 0x0231 }, |
| 246 | { 0x3039, 0x0B00 }, |
| 247 | }; |
| 248 | |
Nariman Poushin | dc606e05 | 2015-07-17 15:11:10 +0100 | [diff] [blame] | 249 | static const struct reg_sequence wm5110_no_dre_right_enable[] = { |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 250 | { 0x3074, 0xE414 }, |
| 251 | { 0x3075, 0x0056 }, |
| 252 | { 0x306B, 0x0224 }, |
| 253 | { 0x306F, 0x4263 }, |
| 254 | { 0x3071, 0x5291 }, |
| 255 | { 0x3080, 0xE414 }, |
| 256 | { 0x3081, 0x3066 }, |
| 257 | { 0x3082, 0xE414 }, |
| 258 | { 0x3083, 0x3070 }, |
| 259 | { 0x3084, 0xE414 }, |
| 260 | { 0x3085, 0x3078 }, |
| 261 | { 0x3086, 0xE414 }, |
| 262 | { 0x3087, 0x3080 }, |
| 263 | { 0x3088, 0xE414 }, |
| 264 | { 0x3089, 0x3080 }, |
| 265 | }; |
| 266 | |
Nariman Poushin | dc606e05 | 2015-07-17 15:11:10 +0100 | [diff] [blame] | 267 | static const struct reg_sequence wm5110_dre_right_enable[] = { |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 268 | { 0x3074, 0x0231 }, |
| 269 | { 0x3075, 0x0B00 }, |
| 270 | { 0x306B, 0x0227 }, |
| 271 | { 0x306F, 0x4266 }, |
| 272 | { 0x3071, 0x5294 }, |
| 273 | { 0x3080, 0xE231 }, |
| 274 | { 0x3081, 0x0266 }, |
| 275 | { 0x3082, 0x8231 }, |
| 276 | { 0x3083, 0x4B17 }, |
| 277 | { 0x3084, 0x8231 }, |
| 278 | { 0x3085, 0x0B17 }, |
| 279 | { 0x3086, 0xE231 }, |
| 280 | { 0x3087, 0x5294 }, |
| 281 | { 0x3088, 0x0231 }, |
| 282 | { 0x3089, 0x0B00 }, |
| 283 | }; |
| 284 | |
| 285 | static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w) |
| 286 | { |
| 287 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 288 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); |
| 289 | struct arizona *arizona = priv->arizona; |
| 290 | unsigned int val = snd_soc_read(codec, ARIZONA_DRE_ENABLE); |
Nariman Poushin | dc606e05 | 2015-07-17 15:11:10 +0100 | [diff] [blame] | 291 | const struct reg_sequence *wseq; |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 292 | int nregs; |
| 293 | |
| 294 | switch (w->shift) { |
| 295 | case ARIZONA_OUT1L_ENA_SHIFT: |
| 296 | if (val & ARIZONA_DRE1L_ENA_MASK) { |
| 297 | wseq = wm5110_dre_left_enable; |
| 298 | nregs = ARRAY_SIZE(wm5110_dre_left_enable); |
| 299 | } else { |
| 300 | wseq = wm5110_no_dre_left_enable; |
| 301 | nregs = ARRAY_SIZE(wm5110_no_dre_left_enable); |
| 302 | priv->out_up_delay += 10; |
| 303 | } |
| 304 | break; |
| 305 | case ARIZONA_OUT1R_ENA_SHIFT: |
| 306 | if (val & ARIZONA_DRE1R_ENA_MASK) { |
| 307 | wseq = wm5110_dre_right_enable; |
| 308 | nregs = ARRAY_SIZE(wm5110_dre_right_enable); |
| 309 | } else { |
| 310 | wseq = wm5110_no_dre_right_enable; |
| 311 | nregs = ARRAY_SIZE(wm5110_no_dre_right_enable); |
| 312 | priv->out_up_delay += 10; |
| 313 | } |
| 314 | break; |
| 315 | default: |
| 316 | return 0; |
| 317 | } |
| 318 | |
| 319 | return regmap_multi_reg_write(arizona->regmap, wseq, nregs); |
| 320 | } |
| 321 | |
| 322 | static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w) |
| 323 | { |
| 324 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 325 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); |
| 326 | unsigned int val = snd_soc_read(codec, ARIZONA_DRE_ENABLE); |
| 327 | |
| 328 | switch (w->shift) { |
| 329 | case ARIZONA_OUT1L_ENA_SHIFT: |
| 330 | if (!(val & ARIZONA_DRE1L_ENA_MASK)) { |
| 331 | snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS, |
| 332 | ARIZONA_WS_TRG1, ARIZONA_WS_TRG1); |
| 333 | snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS, |
| 334 | ARIZONA_WS_TRG1, 0); |
| 335 | priv->out_down_delay += 27; |
| 336 | } |
| 337 | break; |
| 338 | case ARIZONA_OUT1R_ENA_SHIFT: |
| 339 | if (!(val & ARIZONA_DRE1R_ENA_MASK)) { |
| 340 | snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS, |
| 341 | ARIZONA_WS_TRG2, ARIZONA_WS_TRG2); |
| 342 | snd_soc_update_bits(codec, ARIZONA_SPARE_TRIGGERS, |
| 343 | ARIZONA_WS_TRG2, 0); |
| 344 | priv->out_down_delay += 27; |
| 345 | } |
| 346 | break; |
| 347 | default: |
| 348 | break; |
| 349 | } |
| 350 | |
| 351 | return 0; |
| 352 | } |
| 353 | |
| 354 | static int wm5110_hp_ev(struct snd_soc_dapm_widget *w, |
| 355 | struct snd_kcontrol *kcontrol, int event) |
| 356 | { |
| 357 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 358 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); |
| 359 | |
| 360 | switch (priv->arizona->rev) { |
| 361 | case 0 ... 3: |
| 362 | break; |
| 363 | default: |
| 364 | switch (event) { |
| 365 | case SND_SOC_DAPM_PRE_PMU: |
| 366 | wm5110_hp_pre_enable(w); |
| 367 | break; |
| 368 | case SND_SOC_DAPM_PRE_PMD: |
| 369 | wm5110_hp_pre_disable(w); |
| 370 | break; |
| 371 | default: |
| 372 | break; |
| 373 | } |
| 374 | break; |
| 375 | } |
| 376 | |
| 377 | return arizona_hp_ev(w, kcontrol, event); |
| 378 | } |
| 379 | |
| 380 | static int wm5110_clear_pga_volume(struct arizona *arizona, int output) |
| 381 | { |
Charles Keepax | 2433872 | 2016-01-06 15:15:37 +0000 | [diff] [blame] | 382 | unsigned int reg = ARIZONA_OUTPUT_PATH_CONFIG_1L + output * 4; |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 383 | int ret; |
| 384 | |
Charles Keepax | 2433872 | 2016-01-06 15:15:37 +0000 | [diff] [blame] | 385 | ret = regmap_write(arizona->regmap, reg, 0x80); |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 386 | if (ret) |
| 387 | dev_err(arizona->dev, "Failed to clear PGA (0x%x): %d\n", |
Charles Keepax | 2433872 | 2016-01-06 15:15:37 +0000 | [diff] [blame] | 388 | reg, ret); |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 389 | |
| 390 | return ret; |
| 391 | } |
| 392 | |
| 393 | static int wm5110_put_dre(struct snd_kcontrol *kcontrol, |
| 394 | struct snd_ctl_elem_value *ucontrol) |
| 395 | { |
| 396 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
| 397 | struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); |
| 398 | struct arizona *arizona = dev_get_drvdata(codec->dev->parent); |
| 399 | struct soc_mixer_control *mc = |
| 400 | (struct soc_mixer_control *)kcontrol->private_value; |
| 401 | unsigned int ena, dre; |
| 402 | unsigned int mask = (0x1 << mc->shift) | (0x1 << mc->rshift); |
| 403 | unsigned int lnew = (!!ucontrol->value.integer.value[0]) << mc->shift; |
| 404 | unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift; |
| 405 | unsigned int lold, rold; |
| 406 | unsigned int lena, rena; |
| 407 | int ret; |
| 408 | |
| 409 | snd_soc_dapm_mutex_lock(dapm); |
| 410 | |
| 411 | ret = regmap_read(arizona->regmap, ARIZONA_OUTPUT_ENABLES_1, &ena); |
| 412 | if (ret) { |
| 413 | dev_err(arizona->dev, "Failed to read output state: %d\n", ret); |
| 414 | goto err; |
| 415 | } |
| 416 | ret = regmap_read(arizona->regmap, ARIZONA_DRE_ENABLE, &dre); |
| 417 | if (ret) { |
| 418 | dev_err(arizona->dev, "Failed to read DRE state: %d\n", ret); |
| 419 | goto err; |
| 420 | } |
| 421 | |
| 422 | lold = dre & (1 << mc->shift); |
| 423 | rold = dre & (1 << mc->rshift); |
| 424 | /* Enables are channel wise swapped from the DRE enables */ |
| 425 | lena = ena & (1 << mc->rshift); |
| 426 | rena = ena & (1 << mc->shift); |
| 427 | |
| 428 | if ((lena && lnew != lold) || (rena && rnew != rold)) { |
| 429 | dev_err(arizona->dev, "Can't change DRE on active outputs\n"); |
| 430 | ret = -EBUSY; |
| 431 | goto err; |
| 432 | } |
| 433 | |
| 434 | ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE, |
| 435 | mask, lnew | rnew); |
| 436 | if (ret) { |
| 437 | dev_err(arizona->dev, "Failed to set DRE: %d\n", ret); |
| 438 | goto err; |
| 439 | } |
| 440 | |
| 441 | /* Force reset of PGA volumes, if turning DRE off */ |
| 442 | if (!lnew && lold) |
| 443 | wm5110_clear_pga_volume(arizona, mc->shift); |
| 444 | |
| 445 | if (!rnew && rold) |
| 446 | wm5110_clear_pga_volume(arizona, mc->rshift); |
| 447 | |
| 448 | err: |
| 449 | snd_soc_dapm_mutex_unlock(dapm); |
| 450 | |
| 451 | return ret; |
| 452 | } |
| 453 | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 454 | static int wm5110_in_pga_get(struct snd_kcontrol *kcontrol, |
| 455 | struct snd_ctl_elem_value *ucontrol) |
| 456 | { |
| 457 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
| 458 | struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 459 | int ret; |
| 460 | |
| 461 | /* |
| 462 | * PGA Volume is also used as part of the enable sequence, so |
| 463 | * usage of it should be avoided whilst that is running. |
| 464 | */ |
Charles Keepax | e116615 | 2015-12-29 16:25:14 +0000 | [diff] [blame] | 465 | snd_soc_dapm_mutex_lock(dapm); |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 466 | |
| 467 | ret = snd_soc_get_volsw_range(kcontrol, ucontrol); |
| 468 | |
Charles Keepax | e116615 | 2015-12-29 16:25:14 +0000 | [diff] [blame] | 469 | snd_soc_dapm_mutex_unlock(dapm); |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 470 | |
| 471 | return ret; |
| 472 | } |
| 473 | |
| 474 | static int wm5110_in_pga_put(struct snd_kcontrol *kcontrol, |
| 475 | struct snd_ctl_elem_value *ucontrol) |
| 476 | { |
| 477 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
| 478 | struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 479 | int ret; |
| 480 | |
| 481 | /* |
| 482 | * PGA Volume is also used as part of the enable sequence, so |
| 483 | * usage of it should be avoided whilst that is running. |
| 484 | */ |
Charles Keepax | e116615 | 2015-12-29 16:25:14 +0000 | [diff] [blame] | 485 | snd_soc_dapm_mutex_lock(dapm); |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 486 | |
| 487 | ret = snd_soc_put_volsw_range(kcontrol, ucontrol); |
| 488 | |
Charles Keepax | e116615 | 2015-12-29 16:25:14 +0000 | [diff] [blame] | 489 | snd_soc_dapm_mutex_unlock(dapm); |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 490 | |
| 491 | return ret; |
| 492 | } |
| 493 | |
| 494 | static int wm5110_in_analog_ev(struct snd_soc_dapm_widget *w, |
| 495 | struct snd_kcontrol *kcontrol, int event) |
| 496 | { |
| 497 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 498 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); |
| 499 | struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec); |
| 500 | struct arizona *arizona = priv->arizona; |
| 501 | unsigned int reg, mask; |
| 502 | struct reg_sequence analog_seq[] = { |
| 503 | { 0x80, 0x3 }, |
| 504 | { 0x35d, 0 }, |
| 505 | { 0x80, 0x0 }, |
| 506 | }; |
| 507 | |
| 508 | reg = ARIZONA_IN1L_CONTROL + ((w->shift ^ 0x1) * 4); |
| 509 | mask = ARIZONA_IN1L_PGA_VOL_MASK; |
| 510 | |
| 511 | switch (event) { |
| 512 | case SND_SOC_DAPM_WILL_PMU: |
| 513 | wm5110->in_value |= 0x3 << ((w->shift ^ 0x1) * 2); |
| 514 | wm5110->in_pre_pending++; |
| 515 | wm5110->in_post_pending++; |
| 516 | return 0; |
| 517 | case SND_SOC_DAPM_PRE_PMU: |
| 518 | wm5110->in_pga_cache[w->shift] = snd_soc_read(codec, reg); |
| 519 | |
| 520 | snd_soc_update_bits(codec, reg, mask, |
| 521 | 0x40 << ARIZONA_IN1L_PGA_VOL_SHIFT); |
| 522 | |
| 523 | wm5110->in_pre_pending--; |
| 524 | if (wm5110->in_pre_pending == 0) { |
| 525 | analog_seq[1].def = wm5110->in_value; |
| 526 | regmap_multi_reg_write_bypassed(arizona->regmap, |
| 527 | analog_seq, |
| 528 | ARRAY_SIZE(analog_seq)); |
| 529 | |
| 530 | msleep(55); |
| 531 | |
| 532 | wm5110->in_value = 0; |
| 533 | } |
| 534 | |
| 535 | break; |
| 536 | case SND_SOC_DAPM_POST_PMU: |
| 537 | snd_soc_update_bits(codec, reg, mask, |
| 538 | wm5110->in_pga_cache[w->shift]); |
| 539 | |
| 540 | wm5110->in_post_pending--; |
| 541 | if (wm5110->in_post_pending == 0) |
| 542 | regmap_multi_reg_write_bypassed(arizona->regmap, |
| 543 | analog_seq, |
| 544 | ARRAY_SIZE(analog_seq)); |
| 545 | break; |
| 546 | default: |
| 547 | break; |
| 548 | } |
| 549 | |
| 550 | return 0; |
| 551 | } |
| 552 | |
| 553 | static int wm5110_in_ev(struct snd_soc_dapm_widget *w, |
| 554 | struct snd_kcontrol *kcontrol, int event) |
| 555 | { |
| 556 | struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); |
| 557 | struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec); |
| 558 | struct arizona *arizona = priv->arizona; |
| 559 | |
| 560 | switch (arizona->rev) { |
| 561 | case 0 ... 4: |
| 562 | if (arizona_input_analog(codec, w->shift)) |
| 563 | wm5110_in_analog_ev(w, kcontrol, event); |
| 564 | |
| 565 | break; |
| 566 | default: |
| 567 | break; |
| 568 | } |
| 569 | |
| 570 | return arizona_in_ev(w, kcontrol, event); |
| 571 | } |
| 572 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 573 | static DECLARE_TLV_DB_SCALE(ana_tlv, 0, 100, 0); |
| 574 | static DECLARE_TLV_DB_SCALE(eq_tlv, -1200, 100, 0); |
| 575 | static DECLARE_TLV_DB_SCALE(digital_tlv, -6400, 50, 0); |
Richard Fitzgerald | 15575ed | 2015-05-28 14:28:12 +0100 | [diff] [blame] | 576 | static DECLARE_TLV_DB_SCALE(noise_tlv, -13200, 600, 0); |
Mark Brown | bd7fe24 | 2012-12-18 13:53:26 +0000 | [diff] [blame] | 577 | static DECLARE_TLV_DB_SCALE(ng_tlv, -10200, 600, 0); |
| 578 | |
| 579 | #define WM5110_NG_SRC(name, base) \ |
| 580 | SOC_SINGLE(name " NG HPOUT1L Switch", base, 0, 1, 0), \ |
| 581 | SOC_SINGLE(name " NG HPOUT1R Switch", base, 1, 1, 0), \ |
| 582 | SOC_SINGLE(name " NG HPOUT2L Switch", base, 2, 1, 0), \ |
| 583 | SOC_SINGLE(name " NG HPOUT2R Switch", base, 3, 1, 0), \ |
| 584 | SOC_SINGLE(name " NG HPOUT3L Switch", base, 4, 1, 0), \ |
| 585 | SOC_SINGLE(name " NG HPOUT3R Switch", base, 5, 1, 0), \ |
| 586 | SOC_SINGLE(name " NG SPKOUTL Switch", base, 6, 1, 0), \ |
| 587 | SOC_SINGLE(name " NG SPKOUTR Switch", base, 7, 1, 0), \ |
| 588 | SOC_SINGLE(name " NG SPKDAT1L Switch", base, 8, 1, 0), \ |
| 589 | SOC_SINGLE(name " NG SPKDAT1R Switch", base, 9, 1, 0), \ |
| 590 | SOC_SINGLE(name " NG SPKDAT2L Switch", base, 10, 1, 0), \ |
| 591 | SOC_SINGLE(name " NG SPKDAT2R Switch", base, 11, 1, 0) |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 592 | |
Charles Keepax | d190106 | 2015-11-19 16:11:10 +0000 | [diff] [blame] | 593 | #define WM5110_RXANC_INPUT_ROUTES(widget, name) \ |
| 594 | { widget, NULL, name " NG Mux" }, \ |
| 595 | { name " NG Internal", NULL, "RXANC NG Clock" }, \ |
| 596 | { name " NG Internal", NULL, name " Channel" }, \ |
| 597 | { name " NG External", NULL, "RXANC NG External Clock" }, \ |
| 598 | { name " NG External", NULL, name " Channel" }, \ |
| 599 | { name " NG Mux", "None", name " Channel" }, \ |
| 600 | { name " NG Mux", "Internal", name " NG Internal" }, \ |
| 601 | { name " NG Mux", "External", name " NG External" }, \ |
| 602 | { name " Channel", "Left", name " Left Input" }, \ |
| 603 | { name " Channel", "Combine", name " Left Input" }, \ |
| 604 | { name " Channel", "Right", name " Right Input" }, \ |
| 605 | { name " Channel", "Combine", name " Right Input" }, \ |
| 606 | { name " Left Input", "IN1", "IN1L PGA" }, \ |
| 607 | { name " Right Input", "IN1", "IN1R PGA" }, \ |
| 608 | { name " Left Input", "IN2", "IN2L PGA" }, \ |
| 609 | { name " Right Input", "IN2", "IN2R PGA" }, \ |
| 610 | { name " Left Input", "IN3", "IN3L PGA" }, \ |
| 611 | { name " Right Input", "IN3", "IN3R PGA" }, \ |
| 612 | { name " Left Input", "IN4", "IN4L PGA" }, \ |
| 613 | { name " Right Input", "IN4", "IN4R PGA" } |
| 614 | |
| 615 | #define WM5110_RXANC_OUTPUT_ROUTES(widget, name) \ |
| 616 | { widget, NULL, name " ANC Source" }, \ |
| 617 | { name " ANC Source", "RXANCL", "RXANCL" }, \ |
| 618 | { name " ANC Source", "RXANCR", "RXANCR" } |
| 619 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 620 | static const struct snd_kcontrol_new wm5110_snd_controls[] = { |
Charles Keepax | c7f3843 | 2013-08-06 17:03:55 +0100 | [diff] [blame] | 621 | SOC_ENUM("IN1 OSR", arizona_in_dmic_osr[0]), |
| 622 | SOC_ENUM("IN2 OSR", arizona_in_dmic_osr[1]), |
| 623 | SOC_ENUM("IN3 OSR", arizona_in_dmic_osr[2]), |
| 624 | SOC_ENUM("IN4 OSR", arizona_in_dmic_osr[3]), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 625 | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 626 | SOC_SINGLE_RANGE_EXT_TLV("IN1L Volume", ARIZONA_IN1L_CONTROL, |
| 627 | ARIZONA_IN1L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, |
| 628 | wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv), |
| 629 | SOC_SINGLE_RANGE_EXT_TLV("IN1R Volume", ARIZONA_IN1R_CONTROL, |
| 630 | ARIZONA_IN1R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, |
| 631 | wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv), |
| 632 | SOC_SINGLE_RANGE_EXT_TLV("IN2L Volume", ARIZONA_IN2L_CONTROL, |
| 633 | ARIZONA_IN2L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, |
| 634 | wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv), |
| 635 | SOC_SINGLE_RANGE_EXT_TLV("IN2R Volume", ARIZONA_IN2R_CONTROL, |
| 636 | ARIZONA_IN2R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, |
| 637 | wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv), |
| 638 | SOC_SINGLE_RANGE_EXT_TLV("IN3L Volume", ARIZONA_IN3L_CONTROL, |
| 639 | ARIZONA_IN3L_PGA_VOL_SHIFT, 0x40, 0x5f, 0, |
| 640 | wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv), |
| 641 | SOC_SINGLE_RANGE_EXT_TLV("IN3R Volume", ARIZONA_IN3R_CONTROL, |
| 642 | ARIZONA_IN3R_PGA_VOL_SHIFT, 0x40, 0x5f, 0, |
| 643 | wm5110_in_pga_get, wm5110_in_pga_put, ana_tlv), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 644 | |
Charles Keepax | 254dc32 | 2013-11-19 16:04:03 +0000 | [diff] [blame] | 645 | SOC_ENUM("IN HPF Cutoff Frequency", arizona_in_hpf_cut_enum), |
| 646 | |
| 647 | SOC_SINGLE("IN1L HPF Switch", ARIZONA_IN1L_CONTROL, |
| 648 | ARIZONA_IN1L_HPF_SHIFT, 1, 0), |
| 649 | SOC_SINGLE("IN1R HPF Switch", ARIZONA_IN1R_CONTROL, |
| 650 | ARIZONA_IN1R_HPF_SHIFT, 1, 0), |
| 651 | SOC_SINGLE("IN2L HPF Switch", ARIZONA_IN2L_CONTROL, |
| 652 | ARIZONA_IN2L_HPF_SHIFT, 1, 0), |
| 653 | SOC_SINGLE("IN2R HPF Switch", ARIZONA_IN2R_CONTROL, |
| 654 | ARIZONA_IN2R_HPF_SHIFT, 1, 0), |
| 655 | SOC_SINGLE("IN3L HPF Switch", ARIZONA_IN3L_CONTROL, |
| 656 | ARIZONA_IN3L_HPF_SHIFT, 1, 0), |
| 657 | SOC_SINGLE("IN3R HPF Switch", ARIZONA_IN3R_CONTROL, |
| 658 | ARIZONA_IN3R_HPF_SHIFT, 1, 0), |
| 659 | SOC_SINGLE("IN4L HPF Switch", ARIZONA_IN4L_CONTROL, |
| 660 | ARIZONA_IN4L_HPF_SHIFT, 1, 0), |
| 661 | SOC_SINGLE("IN4R HPF Switch", ARIZONA_IN4R_CONTROL, |
| 662 | ARIZONA_IN4R_HPF_SHIFT, 1, 0), |
| 663 | |
Mark Brown | 02482da | 2012-12-14 15:18:30 +0900 | [diff] [blame] | 664 | SOC_SINGLE_TLV("IN1L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1L, |
| 665 | ARIZONA_IN1L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 666 | SOC_SINGLE_TLV("IN1R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_1R, |
| 667 | ARIZONA_IN1R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 668 | SOC_SINGLE_TLV("IN2L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2L, |
| 669 | ARIZONA_IN2L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 670 | SOC_SINGLE_TLV("IN2R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_2R, |
| 671 | ARIZONA_IN2R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 672 | SOC_SINGLE_TLV("IN3L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3L, |
| 673 | ARIZONA_IN3L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 674 | SOC_SINGLE_TLV("IN3R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_3R, |
| 675 | ARIZONA_IN3R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 676 | SOC_SINGLE_TLV("IN4L Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4L, |
| 677 | ARIZONA_IN4L_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
| 678 | SOC_SINGLE_TLV("IN4R Digital Volume", ARIZONA_ADC_DIGITAL_VOLUME_4R, |
| 679 | ARIZONA_IN4R_DIG_VOL_SHIFT, 0xbf, 0, digital_tlv), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 680 | |
Mark Brown | a1abfa8 | 2012-12-09 12:50:05 +0900 | [diff] [blame] | 681 | SOC_ENUM("Input Ramp Up", arizona_in_vi_ramp), |
| 682 | SOC_ENUM("Input Ramp Down", arizona_in_vd_ramp), |
| 683 | |
Charles Keepax | d190106 | 2015-11-19 16:11:10 +0000 | [diff] [blame] | 684 | SND_SOC_BYTES("RXANC Coefficients", ARIZONA_ANC_COEFF_START, |
| 685 | ARIZONA_ANC_COEFF_END - ARIZONA_ANC_COEFF_START + 1), |
| 686 | SND_SOC_BYTES("RXANCL Config", ARIZONA_FCL_FILTER_CONTROL, 1), |
| 687 | SND_SOC_BYTES("RXANCL Coefficients", ARIZONA_FCL_COEFF_START, |
| 688 | ARIZONA_FCL_COEFF_END - ARIZONA_FCL_COEFF_START + 1), |
| 689 | SND_SOC_BYTES("RXANCR Config", ARIZONA_FCR_FILTER_CONTROL, 1), |
| 690 | SND_SOC_BYTES("RXANCR Coefficients", ARIZONA_FCR_COEFF_START, |
| 691 | ARIZONA_FCR_COEFF_END - ARIZONA_FCR_COEFF_START + 1), |
| 692 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 693 | ARIZONA_MIXER_CONTROLS("EQ1", ARIZONA_EQ1MIX_INPUT_1_SOURCE), |
| 694 | ARIZONA_MIXER_CONTROLS("EQ2", ARIZONA_EQ2MIX_INPUT_1_SOURCE), |
| 695 | ARIZONA_MIXER_CONTROLS("EQ3", ARIZONA_EQ3MIX_INPUT_1_SOURCE), |
| 696 | ARIZONA_MIXER_CONTROLS("EQ4", ARIZONA_EQ4MIX_INPUT_1_SOURCE), |
| 697 | |
Charles Keepax | c05d9a8 | 2015-06-25 09:35:11 +0100 | [diff] [blame] | 698 | ARIZONA_EQ_CONTROL("EQ1 Coefficients", ARIZONA_EQ1_2), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 699 | SOC_SINGLE_TLV("EQ1 B1 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B1_GAIN_SHIFT, |
| 700 | 24, 0, eq_tlv), |
| 701 | SOC_SINGLE_TLV("EQ1 B2 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B2_GAIN_SHIFT, |
| 702 | 24, 0, eq_tlv), |
| 703 | SOC_SINGLE_TLV("EQ1 B3 Volume", ARIZONA_EQ1_1, ARIZONA_EQ1_B3_GAIN_SHIFT, |
| 704 | 24, 0, eq_tlv), |
| 705 | SOC_SINGLE_TLV("EQ1 B4 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B4_GAIN_SHIFT, |
| 706 | 24, 0, eq_tlv), |
| 707 | SOC_SINGLE_TLV("EQ1 B5 Volume", ARIZONA_EQ1_2, ARIZONA_EQ1_B5_GAIN_SHIFT, |
| 708 | 24, 0, eq_tlv), |
| 709 | |
Charles Keepax | c05d9a8 | 2015-06-25 09:35:11 +0100 | [diff] [blame] | 710 | ARIZONA_EQ_CONTROL("EQ2 Coefficients", ARIZONA_EQ2_2), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 711 | SOC_SINGLE_TLV("EQ2 B1 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B1_GAIN_SHIFT, |
| 712 | 24, 0, eq_tlv), |
| 713 | SOC_SINGLE_TLV("EQ2 B2 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B2_GAIN_SHIFT, |
| 714 | 24, 0, eq_tlv), |
| 715 | SOC_SINGLE_TLV("EQ2 B3 Volume", ARIZONA_EQ2_1, ARIZONA_EQ2_B3_GAIN_SHIFT, |
| 716 | 24, 0, eq_tlv), |
| 717 | SOC_SINGLE_TLV("EQ2 B4 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B4_GAIN_SHIFT, |
| 718 | 24, 0, eq_tlv), |
| 719 | SOC_SINGLE_TLV("EQ2 B5 Volume", ARIZONA_EQ2_2, ARIZONA_EQ2_B5_GAIN_SHIFT, |
| 720 | 24, 0, eq_tlv), |
| 721 | |
Charles Keepax | c05d9a8 | 2015-06-25 09:35:11 +0100 | [diff] [blame] | 722 | ARIZONA_EQ_CONTROL("EQ3 Coefficients", ARIZONA_EQ3_2), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 723 | SOC_SINGLE_TLV("EQ3 B1 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B1_GAIN_SHIFT, |
| 724 | 24, 0, eq_tlv), |
| 725 | SOC_SINGLE_TLV("EQ3 B2 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B2_GAIN_SHIFT, |
| 726 | 24, 0, eq_tlv), |
| 727 | SOC_SINGLE_TLV("EQ3 B3 Volume", ARIZONA_EQ3_1, ARIZONA_EQ3_B3_GAIN_SHIFT, |
| 728 | 24, 0, eq_tlv), |
| 729 | SOC_SINGLE_TLV("EQ3 B4 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B4_GAIN_SHIFT, |
| 730 | 24, 0, eq_tlv), |
| 731 | SOC_SINGLE_TLV("EQ3 B5 Volume", ARIZONA_EQ3_2, ARIZONA_EQ3_B5_GAIN_SHIFT, |
| 732 | 24, 0, eq_tlv), |
| 733 | |
Charles Keepax | c05d9a8 | 2015-06-25 09:35:11 +0100 | [diff] [blame] | 734 | ARIZONA_EQ_CONTROL("EQ4 Coefficients", ARIZONA_EQ4_2), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 735 | SOC_SINGLE_TLV("EQ4 B1 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B1_GAIN_SHIFT, |
| 736 | 24, 0, eq_tlv), |
| 737 | SOC_SINGLE_TLV("EQ4 B2 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B2_GAIN_SHIFT, |
| 738 | 24, 0, eq_tlv), |
| 739 | SOC_SINGLE_TLV("EQ4 B3 Volume", ARIZONA_EQ4_1, ARIZONA_EQ4_B3_GAIN_SHIFT, |
| 740 | 24, 0, eq_tlv), |
| 741 | SOC_SINGLE_TLV("EQ4 B4 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B4_GAIN_SHIFT, |
| 742 | 24, 0, eq_tlv), |
| 743 | SOC_SINGLE_TLV("EQ4 B5 Volume", ARIZONA_EQ4_2, ARIZONA_EQ4_B5_GAIN_SHIFT, |
| 744 | 24, 0, eq_tlv), |
| 745 | |
| 746 | ARIZONA_MIXER_CONTROLS("DRC1L", ARIZONA_DRC1LMIX_INPUT_1_SOURCE), |
| 747 | ARIZONA_MIXER_CONTROLS("DRC1R", ARIZONA_DRC1RMIX_INPUT_1_SOURCE), |
| 748 | ARIZONA_MIXER_CONTROLS("DRC2L", ARIZONA_DRC2LMIX_INPUT_1_SOURCE), |
| 749 | ARIZONA_MIXER_CONTROLS("DRC2R", ARIZONA_DRC2RMIX_INPUT_1_SOURCE), |
| 750 | |
| 751 | SND_SOC_BYTES_MASK("DRC1", ARIZONA_DRC1_CTRL1, 5, |
| 752 | ARIZONA_DRC1R_ENA | ARIZONA_DRC1L_ENA), |
| 753 | SND_SOC_BYTES_MASK("DRC2", ARIZONA_DRC2_CTRL1, 5, |
| 754 | ARIZONA_DRC2R_ENA | ARIZONA_DRC2L_ENA), |
| 755 | |
| 756 | ARIZONA_MIXER_CONTROLS("LHPF1", ARIZONA_HPLP1MIX_INPUT_1_SOURCE), |
| 757 | ARIZONA_MIXER_CONTROLS("LHPF2", ARIZONA_HPLP2MIX_INPUT_1_SOURCE), |
| 758 | ARIZONA_MIXER_CONTROLS("LHPF3", ARIZONA_HPLP3MIX_INPUT_1_SOURCE), |
| 759 | ARIZONA_MIXER_CONTROLS("LHPF4", ARIZONA_HPLP4MIX_INPUT_1_SOURCE), |
| 760 | |
Charles Keepax | 5f8e671 | 2015-06-25 09:35:12 +0100 | [diff] [blame] | 761 | ARIZONA_LHPF_CONTROL("LHPF1 Coefficients", ARIZONA_HPLPF1_2), |
| 762 | ARIZONA_LHPF_CONTROL("LHPF2 Coefficients", ARIZONA_HPLPF2_2), |
| 763 | ARIZONA_LHPF_CONTROL("LHPF3 Coefficients", ARIZONA_HPLPF3_2), |
| 764 | ARIZONA_LHPF_CONTROL("LHPF4 Coefficients", ARIZONA_HPLPF4_2), |
Mark Brown | d4d1eaa | 2012-12-05 16:38:30 +0900 | [diff] [blame] | 765 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 766 | SOC_ENUM("LHPF1 Mode", arizona_lhpf1_mode), |
| 767 | SOC_ENUM("LHPF2 Mode", arizona_lhpf2_mode), |
| 768 | SOC_ENUM("LHPF3 Mode", arizona_lhpf3_mode), |
| 769 | SOC_ENUM("LHPF4 Mode", arizona_lhpf4_mode), |
| 770 | |
Lars-Peter Clausen | 696d3af | 2014-04-14 21:31:06 +0200 | [diff] [blame] | 771 | SOC_ENUM("ISRC1 FSL", arizona_isrc_fsl[0]), |
| 772 | SOC_ENUM("ISRC2 FSL", arizona_isrc_fsl[1]), |
| 773 | SOC_ENUM("ISRC3 FSL", arizona_isrc_fsl[2]), |
| 774 | SOC_ENUM("ISRC1 FSH", arizona_isrc_fsh[0]), |
| 775 | SOC_ENUM("ISRC2 FSH", arizona_isrc_fsh[1]), |
| 776 | SOC_ENUM("ISRC3 FSH", arizona_isrc_fsh[2]), |
| 777 | SOC_ENUM("ASRC RATE 1", arizona_asrc_rate1), |
Charles Keepax | 0da2e5b | 2013-11-19 16:04:02 +0000 | [diff] [blame] | 778 | |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 779 | ARIZONA_MIXER_CONTROLS("DSP1L", ARIZONA_DSP1LMIX_INPUT_1_SOURCE), |
| 780 | ARIZONA_MIXER_CONTROLS("DSP1R", ARIZONA_DSP1RMIX_INPUT_1_SOURCE), |
| 781 | ARIZONA_MIXER_CONTROLS("DSP2L", ARIZONA_DSP2LMIX_INPUT_1_SOURCE), |
| 782 | ARIZONA_MIXER_CONTROLS("DSP2R", ARIZONA_DSP2RMIX_INPUT_1_SOURCE), |
| 783 | ARIZONA_MIXER_CONTROLS("DSP3L", ARIZONA_DSP3LMIX_INPUT_1_SOURCE), |
| 784 | ARIZONA_MIXER_CONTROLS("DSP3R", ARIZONA_DSP3RMIX_INPUT_1_SOURCE), |
| 785 | ARIZONA_MIXER_CONTROLS("DSP4L", ARIZONA_DSP4LMIX_INPUT_1_SOURCE), |
Charles Keepax | 39d4ecd | 2013-05-24 11:38:24 +0100 | [diff] [blame] | 786 | ARIZONA_MIXER_CONTROLS("DSP4R", ARIZONA_DSP4RMIX_INPUT_1_SOURCE), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 787 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 788 | ARIZONA_MIXER_CONTROLS("Mic", ARIZONA_MICMIX_INPUT_1_SOURCE), |
| 789 | ARIZONA_MIXER_CONTROLS("Noise", ARIZONA_NOISEMIX_INPUT_1_SOURCE), |
| 790 | |
| 791 | SOC_SINGLE_TLV("Noise Generator Volume", ARIZONA_COMFORT_NOISE_GENERATOR, |
| 792 | ARIZONA_NOISE_GEN_GAIN_SHIFT, 0x16, 0, noise_tlv), |
| 793 | |
| 794 | ARIZONA_MIXER_CONTROLS("HPOUT1L", ARIZONA_OUT1LMIX_INPUT_1_SOURCE), |
| 795 | ARIZONA_MIXER_CONTROLS("HPOUT1R", ARIZONA_OUT1RMIX_INPUT_1_SOURCE), |
| 796 | ARIZONA_MIXER_CONTROLS("HPOUT2L", ARIZONA_OUT2LMIX_INPUT_1_SOURCE), |
| 797 | ARIZONA_MIXER_CONTROLS("HPOUT2R", ARIZONA_OUT2RMIX_INPUT_1_SOURCE), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 798 | ARIZONA_MIXER_CONTROLS("HPOUT3L", ARIZONA_OUT3LMIX_INPUT_1_SOURCE), |
| 799 | ARIZONA_MIXER_CONTROLS("HPOUT3R", ARIZONA_OUT3RMIX_INPUT_1_SOURCE), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 800 | ARIZONA_MIXER_CONTROLS("SPKOUTL", ARIZONA_OUT4LMIX_INPUT_1_SOURCE), |
| 801 | ARIZONA_MIXER_CONTROLS("SPKOUTR", ARIZONA_OUT4RMIX_INPUT_1_SOURCE), |
| 802 | ARIZONA_MIXER_CONTROLS("SPKDAT1L", ARIZONA_OUT5LMIX_INPUT_1_SOURCE), |
| 803 | ARIZONA_MIXER_CONTROLS("SPKDAT1R", ARIZONA_OUT5RMIX_INPUT_1_SOURCE), |
| 804 | ARIZONA_MIXER_CONTROLS("SPKDAT2L", ARIZONA_OUT6LMIX_INPUT_1_SOURCE), |
| 805 | ARIZONA_MIXER_CONTROLS("SPKDAT2R", ARIZONA_OUT6RMIX_INPUT_1_SOURCE), |
| 806 | |
Charles Keepax | afb6d4e | 2014-01-09 14:29:25 +0000 | [diff] [blame] | 807 | SOC_SINGLE("HPOUT1 SC Protect Switch", ARIZONA_HP1_SHORT_CIRCUIT_CTRL, |
| 808 | ARIZONA_HP1_SC_ENA_SHIFT, 1, 0), |
| 809 | SOC_SINGLE("HPOUT2 SC Protect Switch", ARIZONA_HP2_SHORT_CIRCUIT_CTRL, |
| 810 | ARIZONA_HP2_SC_ENA_SHIFT, 1, 0), |
| 811 | SOC_SINGLE("HPOUT3 SC Protect Switch", ARIZONA_HP3_SHORT_CIRCUIT_CTRL, |
| 812 | ARIZONA_HP3_SC_ENA_SHIFT, 1, 0), |
| 813 | |
Charles Keepax | 9374f37 | 2014-04-05 12:11:48 +0100 | [diff] [blame] | 814 | SOC_SINGLE("SPKDAT1 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_5L, |
| 815 | ARIZONA_OUT5_OSR_SHIFT, 1, 0), |
| 816 | SOC_SINGLE("SPKDAT2 High Performance Switch", ARIZONA_OUTPUT_PATH_CONFIG_6L, |
| 817 | ARIZONA_OUT6_OSR_SHIFT, 1, 0), |
| 818 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 819 | SOC_DOUBLE_R("HPOUT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
| 820 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_MUTE_SHIFT, 1, 1), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 821 | SOC_DOUBLE_R("HPOUT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 822 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_MUTE_SHIFT, 1, 1), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 823 | SOC_DOUBLE_R("HPOUT3 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 824 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_MUTE_SHIFT, 1, 1), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 825 | SOC_DOUBLE_R("Speaker Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_4L, |
| 826 | ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_MUTE_SHIFT, 1, 1), |
| 827 | SOC_DOUBLE_R("SPKDAT1 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_5L, |
| 828 | ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_MUTE_SHIFT, 1, 1), |
| 829 | SOC_DOUBLE_R("SPKDAT2 Digital Switch", ARIZONA_DAC_DIGITAL_VOLUME_6L, |
| 830 | ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_MUTE_SHIFT, 1, 1), |
| 831 | |
| 832 | SOC_DOUBLE_R_TLV("HPOUT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_1L, |
| 833 | ARIZONA_DAC_DIGITAL_VOLUME_1R, ARIZONA_OUT1L_VOL_SHIFT, |
| 834 | 0xbf, 0, digital_tlv), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 835 | SOC_DOUBLE_R_TLV("HPOUT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_2L, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 836 | ARIZONA_DAC_DIGITAL_VOLUME_2R, ARIZONA_OUT2L_VOL_SHIFT, |
| 837 | 0xbf, 0, digital_tlv), |
Charles Keepax | 5752ec9 | 2013-02-15 10:37:27 +0000 | [diff] [blame] | 838 | SOC_DOUBLE_R_TLV("HPOUT3 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_3L, |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 839 | ARIZONA_DAC_DIGITAL_VOLUME_3R, ARIZONA_OUT3L_VOL_SHIFT, |
| 840 | 0xbf, 0, digital_tlv), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 841 | SOC_DOUBLE_R_TLV("Speaker Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_4L, |
| 842 | ARIZONA_DAC_DIGITAL_VOLUME_4R, ARIZONA_OUT4L_VOL_SHIFT, |
| 843 | 0xbf, 0, digital_tlv), |
| 844 | SOC_DOUBLE_R_TLV("SPKDAT1 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_5L, |
| 845 | ARIZONA_DAC_DIGITAL_VOLUME_5R, ARIZONA_OUT5L_VOL_SHIFT, |
| 846 | 0xbf, 0, digital_tlv), |
| 847 | SOC_DOUBLE_R_TLV("SPKDAT2 Digital Volume", ARIZONA_DAC_DIGITAL_VOLUME_6L, |
| 848 | ARIZONA_DAC_DIGITAL_VOLUME_6R, ARIZONA_OUT6L_VOL_SHIFT, |
| 849 | 0xbf, 0, digital_tlv), |
| 850 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 851 | SOC_DOUBLE("SPKDAT1 Switch", ARIZONA_PDM_SPK1_CTRL_1, ARIZONA_SPK1L_MUTE_SHIFT, |
| 852 | ARIZONA_SPK1R_MUTE_SHIFT, 1, 1), |
| 853 | SOC_DOUBLE("SPKDAT2 Switch", ARIZONA_PDM_SPK2_CTRL_1, ARIZONA_SPK2L_MUTE_SHIFT, |
| 854 | ARIZONA_SPK2R_MUTE_SHIFT, 1, 1), |
| 855 | |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 856 | SOC_DOUBLE_EXT("HPOUT1 DRE Switch", ARIZONA_DRE_ENABLE, |
| 857 | ARIZONA_DRE1L_ENA_SHIFT, ARIZONA_DRE1R_ENA_SHIFT, 1, 0, |
| 858 | snd_soc_get_volsw, wm5110_put_dre), |
| 859 | SOC_DOUBLE_EXT("HPOUT2 DRE Switch", ARIZONA_DRE_ENABLE, |
| 860 | ARIZONA_DRE2L_ENA_SHIFT, ARIZONA_DRE2R_ENA_SHIFT, 1, 0, |
| 861 | snd_soc_get_volsw, wm5110_put_dre), |
| 862 | SOC_DOUBLE_EXT("HPOUT3 DRE Switch", ARIZONA_DRE_ENABLE, |
| 863 | ARIZONA_DRE3L_ENA_SHIFT, ARIZONA_DRE3R_ENA_SHIFT, 1, 0, |
| 864 | snd_soc_get_volsw, wm5110_put_dre), |
Charles Keepax | a4c0d27 | 2013-12-19 09:11:02 +0000 | [diff] [blame] | 865 | |
Mark Brown | a1abfa8 | 2012-12-09 12:50:05 +0900 | [diff] [blame] | 866 | SOC_ENUM("Output Ramp Up", arizona_out_vi_ramp), |
| 867 | SOC_ENUM("Output Ramp Down", arizona_out_vd_ramp), |
| 868 | |
Mark Brown | bd7fe24 | 2012-12-18 13:53:26 +0000 | [diff] [blame] | 869 | SOC_SINGLE("Noise Gate Switch", ARIZONA_NOISE_GATE_CONTROL, |
| 870 | ARIZONA_NGATE_ENA_SHIFT, 1, 0), |
| 871 | SOC_SINGLE_TLV("Noise Gate Threshold Volume", ARIZONA_NOISE_GATE_CONTROL, |
| 872 | ARIZONA_NGATE_THR_SHIFT, 7, 1, ng_tlv), |
| 873 | SOC_ENUM("Noise Gate Hold", arizona_ng_hold), |
| 874 | |
| 875 | WM5110_NG_SRC("HPOUT1L", ARIZONA_NOISE_GATE_SELECT_1L), |
| 876 | WM5110_NG_SRC("HPOUT1R", ARIZONA_NOISE_GATE_SELECT_1R), |
| 877 | WM5110_NG_SRC("HPOUT2L", ARIZONA_NOISE_GATE_SELECT_2L), |
| 878 | WM5110_NG_SRC("HPOUT2R", ARIZONA_NOISE_GATE_SELECT_2R), |
| 879 | WM5110_NG_SRC("HPOUT3L", ARIZONA_NOISE_GATE_SELECT_3L), |
| 880 | WM5110_NG_SRC("HPOUT3R", ARIZONA_NOISE_GATE_SELECT_3R), |
| 881 | WM5110_NG_SRC("SPKOUTL", ARIZONA_NOISE_GATE_SELECT_4L), |
| 882 | WM5110_NG_SRC("SPKOUTR", ARIZONA_NOISE_GATE_SELECT_4R), |
| 883 | WM5110_NG_SRC("SPKDAT1L", ARIZONA_NOISE_GATE_SELECT_5L), |
| 884 | WM5110_NG_SRC("SPKDAT1R", ARIZONA_NOISE_GATE_SELECT_5R), |
| 885 | WM5110_NG_SRC("SPKDAT2L", ARIZONA_NOISE_GATE_SELECT_6L), |
| 886 | WM5110_NG_SRC("SPKDAT2R", ARIZONA_NOISE_GATE_SELECT_6R), |
| 887 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 888 | ARIZONA_MIXER_CONTROLS("AIF1TX1", ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE), |
| 889 | ARIZONA_MIXER_CONTROLS("AIF1TX2", ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE), |
| 890 | ARIZONA_MIXER_CONTROLS("AIF1TX3", ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE), |
| 891 | ARIZONA_MIXER_CONTROLS("AIF1TX4", ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE), |
| 892 | ARIZONA_MIXER_CONTROLS("AIF1TX5", ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE), |
| 893 | ARIZONA_MIXER_CONTROLS("AIF1TX6", ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE), |
| 894 | ARIZONA_MIXER_CONTROLS("AIF1TX7", ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE), |
| 895 | ARIZONA_MIXER_CONTROLS("AIF1TX8", ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE), |
| 896 | |
| 897 | ARIZONA_MIXER_CONTROLS("AIF2TX1", ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE), |
| 898 | ARIZONA_MIXER_CONTROLS("AIF2TX2", ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE), |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 899 | ARIZONA_MIXER_CONTROLS("AIF2TX3", ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE), |
| 900 | ARIZONA_MIXER_CONTROLS("AIF2TX4", ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE), |
| 901 | ARIZONA_MIXER_CONTROLS("AIF2TX5", ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE), |
| 902 | ARIZONA_MIXER_CONTROLS("AIF2TX6", ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 903 | |
| 904 | ARIZONA_MIXER_CONTROLS("AIF3TX1", ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE), |
| 905 | ARIZONA_MIXER_CONTROLS("AIF3TX2", ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE), |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 906 | |
| 907 | ARIZONA_MIXER_CONTROLS("SLIMTX1", ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE), |
| 908 | ARIZONA_MIXER_CONTROLS("SLIMTX2", ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE), |
| 909 | ARIZONA_MIXER_CONTROLS("SLIMTX3", ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE), |
| 910 | ARIZONA_MIXER_CONTROLS("SLIMTX4", ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE), |
| 911 | ARIZONA_MIXER_CONTROLS("SLIMTX5", ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE), |
| 912 | ARIZONA_MIXER_CONTROLS("SLIMTX6", ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE), |
| 913 | ARIZONA_MIXER_CONTROLS("SLIMTX7", ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE), |
| 914 | ARIZONA_MIXER_CONTROLS("SLIMTX8", ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 915 | }; |
| 916 | |
| 917 | ARIZONA_MIXER_ENUMS(EQ1, ARIZONA_EQ1MIX_INPUT_1_SOURCE); |
| 918 | ARIZONA_MIXER_ENUMS(EQ2, ARIZONA_EQ2MIX_INPUT_1_SOURCE); |
| 919 | ARIZONA_MIXER_ENUMS(EQ3, ARIZONA_EQ3MIX_INPUT_1_SOURCE); |
| 920 | ARIZONA_MIXER_ENUMS(EQ4, ARIZONA_EQ4MIX_INPUT_1_SOURCE); |
| 921 | |
| 922 | ARIZONA_MIXER_ENUMS(DRC1L, ARIZONA_DRC1LMIX_INPUT_1_SOURCE); |
| 923 | ARIZONA_MIXER_ENUMS(DRC1R, ARIZONA_DRC1RMIX_INPUT_1_SOURCE); |
| 924 | ARIZONA_MIXER_ENUMS(DRC2L, ARIZONA_DRC2LMIX_INPUT_1_SOURCE); |
| 925 | ARIZONA_MIXER_ENUMS(DRC2R, ARIZONA_DRC2RMIX_INPUT_1_SOURCE); |
| 926 | |
| 927 | ARIZONA_MIXER_ENUMS(LHPF1, ARIZONA_HPLP1MIX_INPUT_1_SOURCE); |
| 928 | ARIZONA_MIXER_ENUMS(LHPF2, ARIZONA_HPLP2MIX_INPUT_1_SOURCE); |
| 929 | ARIZONA_MIXER_ENUMS(LHPF3, ARIZONA_HPLP3MIX_INPUT_1_SOURCE); |
| 930 | ARIZONA_MIXER_ENUMS(LHPF4, ARIZONA_HPLP4MIX_INPUT_1_SOURCE); |
| 931 | |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 932 | ARIZONA_MIXER_ENUMS(DSP1L, ARIZONA_DSP1LMIX_INPUT_1_SOURCE); |
| 933 | ARIZONA_MIXER_ENUMS(DSP1R, ARIZONA_DSP1RMIX_INPUT_1_SOURCE); |
| 934 | ARIZONA_DSP_AUX_ENUMS(DSP1, ARIZONA_DSP1AUX1MIX_INPUT_1_SOURCE); |
| 935 | |
| 936 | ARIZONA_MIXER_ENUMS(DSP2L, ARIZONA_DSP2LMIX_INPUT_1_SOURCE); |
| 937 | ARIZONA_MIXER_ENUMS(DSP2R, ARIZONA_DSP2RMIX_INPUT_1_SOURCE); |
| 938 | ARIZONA_DSP_AUX_ENUMS(DSP2, ARIZONA_DSP2AUX1MIX_INPUT_1_SOURCE); |
| 939 | |
| 940 | ARIZONA_MIXER_ENUMS(DSP3L, ARIZONA_DSP3LMIX_INPUT_1_SOURCE); |
| 941 | ARIZONA_MIXER_ENUMS(DSP3R, ARIZONA_DSP3RMIX_INPUT_1_SOURCE); |
| 942 | ARIZONA_DSP_AUX_ENUMS(DSP3, ARIZONA_DSP3AUX1MIX_INPUT_1_SOURCE); |
| 943 | |
| 944 | ARIZONA_MIXER_ENUMS(DSP4L, ARIZONA_DSP4LMIX_INPUT_1_SOURCE); |
| 945 | ARIZONA_MIXER_ENUMS(DSP4R, ARIZONA_DSP4RMIX_INPUT_1_SOURCE); |
| 946 | ARIZONA_DSP_AUX_ENUMS(DSP4, ARIZONA_DSP4AUX1MIX_INPUT_1_SOURCE); |
| 947 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 948 | ARIZONA_MIXER_ENUMS(Mic, ARIZONA_MICMIX_INPUT_1_SOURCE); |
| 949 | ARIZONA_MIXER_ENUMS(Noise, ARIZONA_NOISEMIX_INPUT_1_SOURCE); |
| 950 | |
| 951 | ARIZONA_MIXER_ENUMS(PWM1, ARIZONA_PWM1MIX_INPUT_1_SOURCE); |
| 952 | ARIZONA_MIXER_ENUMS(PWM2, ARIZONA_PWM2MIX_INPUT_1_SOURCE); |
| 953 | |
| 954 | ARIZONA_MIXER_ENUMS(OUT1L, ARIZONA_OUT1LMIX_INPUT_1_SOURCE); |
| 955 | ARIZONA_MIXER_ENUMS(OUT1R, ARIZONA_OUT1RMIX_INPUT_1_SOURCE); |
| 956 | ARIZONA_MIXER_ENUMS(OUT2L, ARIZONA_OUT2LMIX_INPUT_1_SOURCE); |
| 957 | ARIZONA_MIXER_ENUMS(OUT2R, ARIZONA_OUT2RMIX_INPUT_1_SOURCE); |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 958 | ARIZONA_MIXER_ENUMS(OUT3L, ARIZONA_OUT3LMIX_INPUT_1_SOURCE); |
| 959 | ARIZONA_MIXER_ENUMS(OUT3R, ARIZONA_OUT3RMIX_INPUT_1_SOURCE); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 960 | ARIZONA_MIXER_ENUMS(SPKOUTL, ARIZONA_OUT4LMIX_INPUT_1_SOURCE); |
| 961 | ARIZONA_MIXER_ENUMS(SPKOUTR, ARIZONA_OUT4RMIX_INPUT_1_SOURCE); |
| 962 | ARIZONA_MIXER_ENUMS(SPKDAT1L, ARIZONA_OUT5LMIX_INPUT_1_SOURCE); |
| 963 | ARIZONA_MIXER_ENUMS(SPKDAT1R, ARIZONA_OUT5RMIX_INPUT_1_SOURCE); |
| 964 | ARIZONA_MIXER_ENUMS(SPKDAT2L, ARIZONA_OUT6LMIX_INPUT_1_SOURCE); |
| 965 | ARIZONA_MIXER_ENUMS(SPKDAT2R, ARIZONA_OUT6RMIX_INPUT_1_SOURCE); |
| 966 | |
| 967 | ARIZONA_MIXER_ENUMS(AIF1TX1, ARIZONA_AIF1TX1MIX_INPUT_1_SOURCE); |
| 968 | ARIZONA_MIXER_ENUMS(AIF1TX2, ARIZONA_AIF1TX2MIX_INPUT_1_SOURCE); |
| 969 | ARIZONA_MIXER_ENUMS(AIF1TX3, ARIZONA_AIF1TX3MIX_INPUT_1_SOURCE); |
| 970 | ARIZONA_MIXER_ENUMS(AIF1TX4, ARIZONA_AIF1TX4MIX_INPUT_1_SOURCE); |
| 971 | ARIZONA_MIXER_ENUMS(AIF1TX5, ARIZONA_AIF1TX5MIX_INPUT_1_SOURCE); |
| 972 | ARIZONA_MIXER_ENUMS(AIF1TX6, ARIZONA_AIF1TX6MIX_INPUT_1_SOURCE); |
| 973 | ARIZONA_MIXER_ENUMS(AIF1TX7, ARIZONA_AIF1TX7MIX_INPUT_1_SOURCE); |
| 974 | ARIZONA_MIXER_ENUMS(AIF1TX8, ARIZONA_AIF1TX8MIX_INPUT_1_SOURCE); |
| 975 | |
| 976 | ARIZONA_MIXER_ENUMS(AIF2TX1, ARIZONA_AIF2TX1MIX_INPUT_1_SOURCE); |
| 977 | ARIZONA_MIXER_ENUMS(AIF2TX2, ARIZONA_AIF2TX2MIX_INPUT_1_SOURCE); |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 978 | ARIZONA_MIXER_ENUMS(AIF2TX3, ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE); |
| 979 | ARIZONA_MIXER_ENUMS(AIF2TX4, ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE); |
| 980 | ARIZONA_MIXER_ENUMS(AIF2TX5, ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE); |
| 981 | ARIZONA_MIXER_ENUMS(AIF2TX6, ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 982 | |
| 983 | ARIZONA_MIXER_ENUMS(AIF3TX1, ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE); |
| 984 | ARIZONA_MIXER_ENUMS(AIF3TX2, ARIZONA_AIF3TX2MIX_INPUT_1_SOURCE); |
| 985 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 986 | ARIZONA_MIXER_ENUMS(SLIMTX1, ARIZONA_SLIMTX1MIX_INPUT_1_SOURCE); |
| 987 | ARIZONA_MIXER_ENUMS(SLIMTX2, ARIZONA_SLIMTX2MIX_INPUT_1_SOURCE); |
| 988 | ARIZONA_MIXER_ENUMS(SLIMTX3, ARIZONA_SLIMTX3MIX_INPUT_1_SOURCE); |
| 989 | ARIZONA_MIXER_ENUMS(SLIMTX4, ARIZONA_SLIMTX4MIX_INPUT_1_SOURCE); |
| 990 | ARIZONA_MIXER_ENUMS(SLIMTX5, ARIZONA_SLIMTX5MIX_INPUT_1_SOURCE); |
| 991 | ARIZONA_MIXER_ENUMS(SLIMTX6, ARIZONA_SLIMTX6MIX_INPUT_1_SOURCE); |
| 992 | ARIZONA_MIXER_ENUMS(SLIMTX7, ARIZONA_SLIMTX7MIX_INPUT_1_SOURCE); |
| 993 | ARIZONA_MIXER_ENUMS(SLIMTX8, ARIZONA_SLIMTX8MIX_INPUT_1_SOURCE); |
| 994 | |
Charles Keepax | 5886c74 | 2012-11-13 16:40:34 +0000 | [diff] [blame] | 995 | ARIZONA_MUX_ENUMS(ASRC1L, ARIZONA_ASRC1LMIX_INPUT_1_SOURCE); |
| 996 | ARIZONA_MUX_ENUMS(ASRC1R, ARIZONA_ASRC1RMIX_INPUT_1_SOURCE); |
| 997 | ARIZONA_MUX_ENUMS(ASRC2L, ARIZONA_ASRC2LMIX_INPUT_1_SOURCE); |
| 998 | ARIZONA_MUX_ENUMS(ASRC2R, ARIZONA_ASRC2RMIX_INPUT_1_SOURCE); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 999 | |
Charles Keepax | 0da2e5b | 2013-11-19 16:04:02 +0000 | [diff] [blame] | 1000 | ARIZONA_MUX_ENUMS(ISRC1INT1, ARIZONA_ISRC1INT1MIX_INPUT_1_SOURCE); |
| 1001 | ARIZONA_MUX_ENUMS(ISRC1INT2, ARIZONA_ISRC1INT2MIX_INPUT_1_SOURCE); |
| 1002 | ARIZONA_MUX_ENUMS(ISRC1INT3, ARIZONA_ISRC1INT3MIX_INPUT_1_SOURCE); |
| 1003 | ARIZONA_MUX_ENUMS(ISRC1INT4, ARIZONA_ISRC1INT4MIX_INPUT_1_SOURCE); |
| 1004 | |
| 1005 | ARIZONA_MUX_ENUMS(ISRC1DEC1, ARIZONA_ISRC1DEC1MIX_INPUT_1_SOURCE); |
| 1006 | ARIZONA_MUX_ENUMS(ISRC1DEC2, ARIZONA_ISRC1DEC2MIX_INPUT_1_SOURCE); |
| 1007 | ARIZONA_MUX_ENUMS(ISRC1DEC3, ARIZONA_ISRC1DEC3MIX_INPUT_1_SOURCE); |
| 1008 | ARIZONA_MUX_ENUMS(ISRC1DEC4, ARIZONA_ISRC1DEC4MIX_INPUT_1_SOURCE); |
| 1009 | |
| 1010 | ARIZONA_MUX_ENUMS(ISRC2INT1, ARIZONA_ISRC2INT1MIX_INPUT_1_SOURCE); |
| 1011 | ARIZONA_MUX_ENUMS(ISRC2INT2, ARIZONA_ISRC2INT2MIX_INPUT_1_SOURCE); |
| 1012 | ARIZONA_MUX_ENUMS(ISRC2INT3, ARIZONA_ISRC2INT3MIX_INPUT_1_SOURCE); |
| 1013 | ARIZONA_MUX_ENUMS(ISRC2INT4, ARIZONA_ISRC2INT4MIX_INPUT_1_SOURCE); |
| 1014 | |
| 1015 | ARIZONA_MUX_ENUMS(ISRC2DEC1, ARIZONA_ISRC2DEC1MIX_INPUT_1_SOURCE); |
| 1016 | ARIZONA_MUX_ENUMS(ISRC2DEC2, ARIZONA_ISRC2DEC2MIX_INPUT_1_SOURCE); |
| 1017 | ARIZONA_MUX_ENUMS(ISRC2DEC3, ARIZONA_ISRC2DEC3MIX_INPUT_1_SOURCE); |
| 1018 | ARIZONA_MUX_ENUMS(ISRC2DEC4, ARIZONA_ISRC2DEC4MIX_INPUT_1_SOURCE); |
| 1019 | |
| 1020 | ARIZONA_MUX_ENUMS(ISRC3INT1, ARIZONA_ISRC3INT1MIX_INPUT_1_SOURCE); |
| 1021 | ARIZONA_MUX_ENUMS(ISRC3INT2, ARIZONA_ISRC3INT2MIX_INPUT_1_SOURCE); |
| 1022 | ARIZONA_MUX_ENUMS(ISRC3INT3, ARIZONA_ISRC3INT3MIX_INPUT_1_SOURCE); |
| 1023 | ARIZONA_MUX_ENUMS(ISRC3INT4, ARIZONA_ISRC3INT4MIX_INPUT_1_SOURCE); |
| 1024 | |
| 1025 | ARIZONA_MUX_ENUMS(ISRC3DEC1, ARIZONA_ISRC3DEC1MIX_INPUT_1_SOURCE); |
| 1026 | ARIZONA_MUX_ENUMS(ISRC3DEC2, ARIZONA_ISRC3DEC2MIX_INPUT_1_SOURCE); |
| 1027 | ARIZONA_MUX_ENUMS(ISRC3DEC3, ARIZONA_ISRC3DEC3MIX_INPUT_1_SOURCE); |
| 1028 | ARIZONA_MUX_ENUMS(ISRC3DEC4, ARIZONA_ISRC3DEC4MIX_INPUT_1_SOURCE); |
| 1029 | |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 1030 | static const char *wm5110_aec_loopback_texts[] = { |
| 1031 | "HPOUT1L", "HPOUT1R", "HPOUT2L", "HPOUT2R", "HPOUT3L", "HPOUT3R", |
| 1032 | "SPKOUTL", "SPKOUTR", "SPKDAT1L", "SPKDAT1R", "SPKDAT2L", "SPKDAT2R", |
| 1033 | }; |
| 1034 | |
| 1035 | static const unsigned int wm5110_aec_loopback_values[] = { |
| 1036 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, |
| 1037 | }; |
| 1038 | |
| 1039 | static const struct soc_enum wm5110_aec_loopback = |
| 1040 | SOC_VALUE_ENUM_SINGLE(ARIZONA_DAC_AEC_CONTROL_1, |
Mark Brown | 7d5cb4f | 2013-01-11 13:32:00 +0000 | [diff] [blame] | 1041 | ARIZONA_AEC_LOOPBACK_SRC_SHIFT, 0xf, |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 1042 | ARRAY_SIZE(wm5110_aec_loopback_texts), |
| 1043 | wm5110_aec_loopback_texts, |
| 1044 | wm5110_aec_loopback_values); |
| 1045 | |
| 1046 | static const struct snd_kcontrol_new wm5110_aec_loopback_mux = |
Lars-Peter Clausen | 696d3af | 2014-04-14 21:31:06 +0200 | [diff] [blame] | 1047 | SOC_DAPM_ENUM("AEC Loopback", wm5110_aec_loopback); |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 1048 | |
Charles Keepax | d190106 | 2015-11-19 16:11:10 +0000 | [diff] [blame] | 1049 | static const struct snd_kcontrol_new wm5110_anc_input_mux[] = { |
| 1050 | SOC_DAPM_ENUM("RXANCL Input", arizona_anc_input_src[0]), |
| 1051 | SOC_DAPM_ENUM("RXANCL Channel", arizona_anc_input_src[1]), |
| 1052 | SOC_DAPM_ENUM("RXANCR Input", arizona_anc_input_src[2]), |
| 1053 | SOC_DAPM_ENUM("RXANCR Channel", arizona_anc_input_src[3]), |
| 1054 | }; |
| 1055 | |
| 1056 | static const struct snd_kcontrol_new wm5110_anc_ng_mux = |
| 1057 | SOC_DAPM_ENUM("RXANC NG Source", arizona_anc_ng_enum); |
| 1058 | |
| 1059 | static const struct snd_kcontrol_new wm5110_output_anc_src[] = { |
| 1060 | SOC_DAPM_ENUM("HPOUT1L ANC Source", arizona_output_anc_src[0]), |
| 1061 | SOC_DAPM_ENUM("HPOUT1R ANC Source", arizona_output_anc_src[1]), |
| 1062 | SOC_DAPM_ENUM("HPOUT2L ANC Source", arizona_output_anc_src[2]), |
| 1063 | SOC_DAPM_ENUM("HPOUT2R ANC Source", arizona_output_anc_src[3]), |
| 1064 | SOC_DAPM_ENUM("HPOUT3L ANC Source", arizona_output_anc_src[4]), |
| 1065 | SOC_DAPM_ENUM("HPOUT3R ANC Source", arizona_output_anc_src[5]), |
| 1066 | SOC_DAPM_ENUM("SPKOUTL ANC Source", arizona_output_anc_src[6]), |
| 1067 | SOC_DAPM_ENUM("SPKOUTR ANC Source", arizona_output_anc_src[7]), |
| 1068 | SOC_DAPM_ENUM("SPKDAT1L ANC Source", arizona_output_anc_src[8]), |
| 1069 | SOC_DAPM_ENUM("SPKDAT1R ANC Source", arizona_output_anc_src[9]), |
| 1070 | SOC_DAPM_ENUM("SPKDAT2L ANC Source", arizona_output_anc_src[10]), |
| 1071 | SOC_DAPM_ENUM("SPKDAT2R ANC Source", arizona_output_anc_src[11]), |
| 1072 | }; |
| 1073 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1074 | static const struct snd_soc_dapm_widget wm5110_dapm_widgets[] = { |
| 1075 | SND_SOC_DAPM_SUPPLY("SYSCLK", ARIZONA_SYSTEM_CLOCK_1, ARIZONA_SYSCLK_ENA_SHIFT, |
Charles Keepax | f69f86b | 2013-11-19 10:51:29 +0000 | [diff] [blame] | 1076 | 0, wm5110_sysclk_ev, SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1077 | SND_SOC_DAPM_SUPPLY("ASYNCCLK", ARIZONA_ASYNC_CLOCK_1, |
| 1078 | ARIZONA_ASYNC_CLK_ENA_SHIFT, 0, NULL, 0), |
Mark Brown | 94237f8 | 2012-08-09 19:14:43 +0100 | [diff] [blame] | 1079 | SND_SOC_DAPM_SUPPLY("OPCLK", ARIZONA_OUTPUT_SYSTEM_CLOCK, |
| 1080 | ARIZONA_OPCLK_ENA_SHIFT, 0, NULL, 0), |
| 1081 | SND_SOC_DAPM_SUPPLY("ASYNCOPCLK", ARIZONA_OUTPUT_ASYNC_CLOCK, |
| 1082 | ARIZONA_OPCLK_ASYNC_ENA_SHIFT, 0, NULL, 0), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1083 | |
Mark Brown | 822b4b8 | 2012-09-07 10:54:32 +0800 | [diff] [blame] | 1084 | SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD2", 0, 0), |
| 1085 | SND_SOC_DAPM_REGULATOR_SUPPLY("DBVDD3", 0, 0), |
| 1086 | SND_SOC_DAPM_REGULATOR_SUPPLY("CPVDD", 20, 0), |
Mark Brown | 76dbd2a | 2012-09-07 12:58:54 +0800 | [diff] [blame] | 1087 | SND_SOC_DAPM_REGULATOR_SUPPLY("MICVDD", 0, SND_SOC_DAPM_REGULATOR_BYPASS), |
Mark Brown | 822b4b8 | 2012-09-07 10:54:32 +0800 | [diff] [blame] | 1088 | SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDL", 0, 0), |
| 1089 | SND_SOC_DAPM_REGULATOR_SUPPLY("SPKVDDR", 0, 0), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1090 | |
| 1091 | SND_SOC_DAPM_SIGGEN("TONE"), |
| 1092 | SND_SOC_DAPM_SIGGEN("NOISE"), |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 1093 | SND_SOC_DAPM_SIGGEN("HAPTICS"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1094 | |
| 1095 | SND_SOC_DAPM_INPUT("IN1L"), |
| 1096 | SND_SOC_DAPM_INPUT("IN1R"), |
| 1097 | SND_SOC_DAPM_INPUT("IN2L"), |
| 1098 | SND_SOC_DAPM_INPUT("IN2R"), |
| 1099 | SND_SOC_DAPM_INPUT("IN3L"), |
| 1100 | SND_SOC_DAPM_INPUT("IN3R"), |
| 1101 | SND_SOC_DAPM_INPUT("IN4L"), |
| 1102 | SND_SOC_DAPM_INPUT("IN4R"), |
| 1103 | |
Charles Keepax | b63144e | 2013-07-04 08:56:28 +0100 | [diff] [blame] | 1104 | SND_SOC_DAPM_OUTPUT("DRC1 Signal Activity"), |
| 1105 | SND_SOC_DAPM_OUTPUT("DRC2 Signal Activity"), |
| 1106 | |
Charles Keepax | 97126ce | 2016-05-13 16:45:16 +0100 | [diff] [blame] | 1107 | SND_SOC_DAPM_OUTPUT("DSP Voice Trigger"), |
| 1108 | |
| 1109 | SND_SOC_DAPM_SWITCH("DSP3 Voice Trigger", SND_SOC_NOPM, 2, 0, |
| 1110 | &arizona_voice_trigger_switch[2]), |
| 1111 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1112 | SND_SOC_DAPM_PGA_E("IN1L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1L_ENA_SHIFT, |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1113 | 0, NULL, 0, wm5110_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1114 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1115 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
| 1116 | SND_SOC_DAPM_WILL_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1117 | SND_SOC_DAPM_PGA_E("IN1R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN1R_ENA_SHIFT, |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1118 | 0, NULL, 0, wm5110_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1119 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1120 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
| 1121 | SND_SOC_DAPM_WILL_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1122 | SND_SOC_DAPM_PGA_E("IN2L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2L_ENA_SHIFT, |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1123 | 0, NULL, 0, wm5110_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1124 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1125 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
| 1126 | SND_SOC_DAPM_WILL_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1127 | SND_SOC_DAPM_PGA_E("IN2R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN2R_ENA_SHIFT, |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1128 | 0, NULL, 0, wm5110_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1129 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1130 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
| 1131 | SND_SOC_DAPM_WILL_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1132 | SND_SOC_DAPM_PGA_E("IN3L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3L_ENA_SHIFT, |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1133 | 0, NULL, 0, wm5110_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1134 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1135 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
| 1136 | SND_SOC_DAPM_WILL_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1137 | SND_SOC_DAPM_PGA_E("IN3R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN3R_ENA_SHIFT, |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1138 | 0, NULL, 0, wm5110_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1139 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | ccaadda | 2015-09-17 10:45:24 +0100 | [diff] [blame] | 1140 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | |
| 1141 | SND_SOC_DAPM_WILL_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1142 | SND_SOC_DAPM_PGA_E("IN4L PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4L_ENA_SHIFT, |
| 1143 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1144 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 1145 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1146 | SND_SOC_DAPM_PGA_E("IN4R PGA", ARIZONA_INPUT_ENABLES, ARIZONA_IN4R_ENA_SHIFT, |
| 1147 | 0, NULL, 0, arizona_in_ev, |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 1148 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
| 1149 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1150 | |
| 1151 | SND_SOC_DAPM_SUPPLY("MICBIAS1", ARIZONA_MIC_BIAS_CTRL_1, |
| 1152 | ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0), |
| 1153 | SND_SOC_DAPM_SUPPLY("MICBIAS2", ARIZONA_MIC_BIAS_CTRL_2, |
| 1154 | ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0), |
| 1155 | SND_SOC_DAPM_SUPPLY("MICBIAS3", ARIZONA_MIC_BIAS_CTRL_3, |
| 1156 | ARIZONA_MICB1_ENA_SHIFT, 0, NULL, 0), |
| 1157 | |
| 1158 | SND_SOC_DAPM_PGA("Noise Generator", ARIZONA_COMFORT_NOISE_GENERATOR, |
| 1159 | ARIZONA_NOISE_GEN_ENA_SHIFT, 0, NULL, 0), |
| 1160 | |
| 1161 | SND_SOC_DAPM_PGA("Tone Generator 1", ARIZONA_TONE_GENERATOR_1, |
| 1162 | ARIZONA_TONE1_ENA_SHIFT, 0, NULL, 0), |
| 1163 | SND_SOC_DAPM_PGA("Tone Generator 2", ARIZONA_TONE_GENERATOR_1, |
| 1164 | ARIZONA_TONE2_ENA_SHIFT, 0, NULL, 0), |
| 1165 | |
| 1166 | SND_SOC_DAPM_PGA("Mic Mute Mixer", ARIZONA_MIC_NOISE_MIX_CONTROL_1, |
| 1167 | ARIZONA_MICMUTE_MIX_ENA_SHIFT, 0, NULL, 0), |
| 1168 | |
| 1169 | SND_SOC_DAPM_PGA("EQ1", ARIZONA_EQ1_1, ARIZONA_EQ1_ENA_SHIFT, 0, NULL, 0), |
| 1170 | SND_SOC_DAPM_PGA("EQ2", ARIZONA_EQ2_1, ARIZONA_EQ2_ENA_SHIFT, 0, NULL, 0), |
| 1171 | SND_SOC_DAPM_PGA("EQ3", ARIZONA_EQ3_1, ARIZONA_EQ3_ENA_SHIFT, 0, NULL, 0), |
| 1172 | SND_SOC_DAPM_PGA("EQ4", ARIZONA_EQ4_1, ARIZONA_EQ4_ENA_SHIFT, 0, NULL, 0), |
| 1173 | |
| 1174 | SND_SOC_DAPM_PGA("DRC1L", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1L_ENA_SHIFT, 0, |
| 1175 | NULL, 0), |
| 1176 | SND_SOC_DAPM_PGA("DRC1R", ARIZONA_DRC1_CTRL1, ARIZONA_DRC1R_ENA_SHIFT, 0, |
| 1177 | NULL, 0), |
| 1178 | SND_SOC_DAPM_PGA("DRC2L", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2L_ENA_SHIFT, 0, |
| 1179 | NULL, 0), |
| 1180 | SND_SOC_DAPM_PGA("DRC2R", ARIZONA_DRC2_CTRL1, ARIZONA_DRC2R_ENA_SHIFT, 0, |
| 1181 | NULL, 0), |
| 1182 | |
| 1183 | SND_SOC_DAPM_PGA("LHPF1", ARIZONA_HPLPF1_1, ARIZONA_LHPF1_ENA_SHIFT, 0, |
| 1184 | NULL, 0), |
| 1185 | SND_SOC_DAPM_PGA("LHPF2", ARIZONA_HPLPF2_1, ARIZONA_LHPF2_ENA_SHIFT, 0, |
| 1186 | NULL, 0), |
| 1187 | SND_SOC_DAPM_PGA("LHPF3", ARIZONA_HPLPF3_1, ARIZONA_LHPF3_ENA_SHIFT, 0, |
| 1188 | NULL, 0), |
| 1189 | SND_SOC_DAPM_PGA("LHPF4", ARIZONA_HPLPF4_1, ARIZONA_LHPF4_ENA_SHIFT, 0, |
| 1190 | NULL, 0), |
| 1191 | |
| 1192 | SND_SOC_DAPM_PGA("PWM1 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM1_ENA_SHIFT, |
| 1193 | 0, NULL, 0), |
| 1194 | SND_SOC_DAPM_PGA("PWM2 Driver", ARIZONA_PWM_DRIVE_1, ARIZONA_PWM2_ENA_SHIFT, |
| 1195 | 0, NULL, 0), |
| 1196 | |
| 1197 | SND_SOC_DAPM_PGA("ASRC1L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1L_ENA_SHIFT, 0, |
| 1198 | NULL, 0), |
| 1199 | SND_SOC_DAPM_PGA("ASRC1R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC1R_ENA_SHIFT, 0, |
| 1200 | NULL, 0), |
| 1201 | SND_SOC_DAPM_PGA("ASRC2L", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2L_ENA_SHIFT, 0, |
| 1202 | NULL, 0), |
| 1203 | SND_SOC_DAPM_PGA("ASRC2R", ARIZONA_ASRC_ENABLE, ARIZONA_ASRC2R_ENA_SHIFT, 0, |
| 1204 | NULL, 0), |
| 1205 | |
Charles Keepax | d82d767 | 2016-01-21 17:53:02 +0000 | [diff] [blame] | 1206 | WM_ADSP2("DSP1", 0, wm5110_adsp_power_ev), |
| 1207 | WM_ADSP2("DSP2", 1, wm5110_adsp_power_ev), |
| 1208 | WM_ADSP2("DSP3", 2, wm5110_adsp_power_ev), |
| 1209 | WM_ADSP2("DSP4", 3, wm5110_adsp_power_ev), |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 1210 | |
Charles Keepax | 0da2e5b | 2013-11-19 16:04:02 +0000 | [diff] [blame] | 1211 | SND_SOC_DAPM_PGA("ISRC1INT1", ARIZONA_ISRC_1_CTRL_3, |
| 1212 | ARIZONA_ISRC1_INT0_ENA_SHIFT, 0, NULL, 0), |
| 1213 | SND_SOC_DAPM_PGA("ISRC1INT2", ARIZONA_ISRC_1_CTRL_3, |
| 1214 | ARIZONA_ISRC1_INT1_ENA_SHIFT, 0, NULL, 0), |
| 1215 | SND_SOC_DAPM_PGA("ISRC1INT3", ARIZONA_ISRC_1_CTRL_3, |
| 1216 | ARIZONA_ISRC1_INT2_ENA_SHIFT, 0, NULL, 0), |
| 1217 | SND_SOC_DAPM_PGA("ISRC1INT4", ARIZONA_ISRC_1_CTRL_3, |
| 1218 | ARIZONA_ISRC1_INT3_ENA_SHIFT, 0, NULL, 0), |
| 1219 | |
| 1220 | SND_SOC_DAPM_PGA("ISRC1DEC1", ARIZONA_ISRC_1_CTRL_3, |
| 1221 | ARIZONA_ISRC1_DEC0_ENA_SHIFT, 0, NULL, 0), |
| 1222 | SND_SOC_DAPM_PGA("ISRC1DEC2", ARIZONA_ISRC_1_CTRL_3, |
| 1223 | ARIZONA_ISRC1_DEC1_ENA_SHIFT, 0, NULL, 0), |
| 1224 | SND_SOC_DAPM_PGA("ISRC1DEC3", ARIZONA_ISRC_1_CTRL_3, |
| 1225 | ARIZONA_ISRC1_DEC2_ENA_SHIFT, 0, NULL, 0), |
| 1226 | SND_SOC_DAPM_PGA("ISRC1DEC4", ARIZONA_ISRC_1_CTRL_3, |
| 1227 | ARIZONA_ISRC1_DEC3_ENA_SHIFT, 0, NULL, 0), |
| 1228 | |
| 1229 | SND_SOC_DAPM_PGA("ISRC2INT1", ARIZONA_ISRC_2_CTRL_3, |
| 1230 | ARIZONA_ISRC2_INT0_ENA_SHIFT, 0, NULL, 0), |
| 1231 | SND_SOC_DAPM_PGA("ISRC2INT2", ARIZONA_ISRC_2_CTRL_3, |
| 1232 | ARIZONA_ISRC2_INT1_ENA_SHIFT, 0, NULL, 0), |
| 1233 | SND_SOC_DAPM_PGA("ISRC2INT3", ARIZONA_ISRC_2_CTRL_3, |
| 1234 | ARIZONA_ISRC2_INT2_ENA_SHIFT, 0, NULL, 0), |
| 1235 | SND_SOC_DAPM_PGA("ISRC2INT4", ARIZONA_ISRC_2_CTRL_3, |
| 1236 | ARIZONA_ISRC2_INT3_ENA_SHIFT, 0, NULL, 0), |
| 1237 | |
| 1238 | SND_SOC_DAPM_PGA("ISRC2DEC1", ARIZONA_ISRC_2_CTRL_3, |
| 1239 | ARIZONA_ISRC2_DEC0_ENA_SHIFT, 0, NULL, 0), |
| 1240 | SND_SOC_DAPM_PGA("ISRC2DEC2", ARIZONA_ISRC_2_CTRL_3, |
| 1241 | ARIZONA_ISRC2_DEC1_ENA_SHIFT, 0, NULL, 0), |
| 1242 | SND_SOC_DAPM_PGA("ISRC2DEC3", ARIZONA_ISRC_2_CTRL_3, |
| 1243 | ARIZONA_ISRC2_DEC2_ENA_SHIFT, 0, NULL, 0), |
| 1244 | SND_SOC_DAPM_PGA("ISRC2DEC4", ARIZONA_ISRC_2_CTRL_3, |
| 1245 | ARIZONA_ISRC2_DEC3_ENA_SHIFT, 0, NULL, 0), |
| 1246 | |
| 1247 | SND_SOC_DAPM_PGA("ISRC3INT1", ARIZONA_ISRC_3_CTRL_3, |
| 1248 | ARIZONA_ISRC3_INT0_ENA_SHIFT, 0, NULL, 0), |
| 1249 | SND_SOC_DAPM_PGA("ISRC3INT2", ARIZONA_ISRC_3_CTRL_3, |
| 1250 | ARIZONA_ISRC3_INT1_ENA_SHIFT, 0, NULL, 0), |
| 1251 | SND_SOC_DAPM_PGA("ISRC3INT3", ARIZONA_ISRC_3_CTRL_3, |
| 1252 | ARIZONA_ISRC3_INT2_ENA_SHIFT, 0, NULL, 0), |
| 1253 | SND_SOC_DAPM_PGA("ISRC3INT4", ARIZONA_ISRC_3_CTRL_3, |
| 1254 | ARIZONA_ISRC3_INT3_ENA_SHIFT, 0, NULL, 0), |
| 1255 | |
| 1256 | SND_SOC_DAPM_PGA("ISRC3DEC1", ARIZONA_ISRC_3_CTRL_3, |
| 1257 | ARIZONA_ISRC3_DEC0_ENA_SHIFT, 0, NULL, 0), |
| 1258 | SND_SOC_DAPM_PGA("ISRC3DEC2", ARIZONA_ISRC_3_CTRL_3, |
| 1259 | ARIZONA_ISRC3_DEC1_ENA_SHIFT, 0, NULL, 0), |
| 1260 | SND_SOC_DAPM_PGA("ISRC3DEC3", ARIZONA_ISRC_3_CTRL_3, |
| 1261 | ARIZONA_ISRC3_DEC2_ENA_SHIFT, 0, NULL, 0), |
| 1262 | SND_SOC_DAPM_PGA("ISRC3DEC4", ARIZONA_ISRC_3_CTRL_3, |
| 1263 | ARIZONA_ISRC3_DEC3_ENA_SHIFT, 0, NULL, 0), |
| 1264 | |
Lars-Peter Clausen | 696d3af | 2014-04-14 21:31:06 +0200 | [diff] [blame] | 1265 | SND_SOC_DAPM_MUX("AEC Loopback", ARIZONA_DAC_AEC_CONTROL_1, |
Charles Keepax | ee4b7c7 | 2013-06-05 14:51:30 +0100 | [diff] [blame] | 1266 | ARIZONA_AEC_LOOPBACK_ENA_SHIFT, 0, |
| 1267 | &wm5110_aec_loopback_mux), |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 1268 | |
Charles Keepax | d190106 | 2015-11-19 16:11:10 +0000 | [diff] [blame] | 1269 | SND_SOC_DAPM_SUPPLY("RXANC NG External Clock", SND_SOC_NOPM, |
| 1270 | ARIZONA_EXT_NG_SEL_SET_SHIFT, 0, arizona_anc_ev, |
| 1271 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), |
| 1272 | SND_SOC_DAPM_PGA("RXANCL NG External", SND_SOC_NOPM, 0, 0, NULL, 0), |
| 1273 | SND_SOC_DAPM_PGA("RXANCR NG External", SND_SOC_NOPM, 0, 0, NULL, 0), |
| 1274 | |
| 1275 | SND_SOC_DAPM_SUPPLY("RXANC NG Clock", SND_SOC_NOPM, |
| 1276 | ARIZONA_CLK_NG_ENA_SET_SHIFT, 0, arizona_anc_ev, |
| 1277 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), |
| 1278 | SND_SOC_DAPM_PGA("RXANCL NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0), |
| 1279 | SND_SOC_DAPM_PGA("RXANCR NG Internal", SND_SOC_NOPM, 0, 0, NULL, 0), |
| 1280 | |
| 1281 | SND_SOC_DAPM_MUX("RXANCL Left Input", SND_SOC_NOPM, 0, 0, |
| 1282 | &wm5110_anc_input_mux[0]), |
| 1283 | SND_SOC_DAPM_MUX("RXANCL Right Input", SND_SOC_NOPM, 0, 0, |
| 1284 | &wm5110_anc_input_mux[0]), |
| 1285 | SND_SOC_DAPM_MUX("RXANCL Channel", SND_SOC_NOPM, 0, 0, |
| 1286 | &wm5110_anc_input_mux[1]), |
| 1287 | SND_SOC_DAPM_MUX("RXANCL NG Mux", SND_SOC_NOPM, 0, 0, &wm5110_anc_ng_mux), |
| 1288 | SND_SOC_DAPM_MUX("RXANCR Left Input", SND_SOC_NOPM, 0, 0, |
| 1289 | &wm5110_anc_input_mux[2]), |
| 1290 | SND_SOC_DAPM_MUX("RXANCR Right Input", SND_SOC_NOPM, 0, 0, |
| 1291 | &wm5110_anc_input_mux[2]), |
| 1292 | SND_SOC_DAPM_MUX("RXANCR Channel", SND_SOC_NOPM, 0, 0, |
| 1293 | &wm5110_anc_input_mux[3]), |
| 1294 | SND_SOC_DAPM_MUX("RXANCR NG Mux", SND_SOC_NOPM, 0, 0, &wm5110_anc_ng_mux), |
| 1295 | |
| 1296 | SND_SOC_DAPM_PGA_E("RXANCL", SND_SOC_NOPM, ARIZONA_CLK_L_ENA_SET_SHIFT, |
| 1297 | 0, NULL, 0, arizona_anc_ev, |
| 1298 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), |
| 1299 | SND_SOC_DAPM_PGA_E("RXANCR", SND_SOC_NOPM, ARIZONA_CLK_R_ENA_SET_SHIFT, |
| 1300 | 0, NULL, 0, arizona_anc_ev, |
| 1301 | SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), |
| 1302 | |
| 1303 | SND_SOC_DAPM_MUX("HPOUT1L ANC Source", SND_SOC_NOPM, 0, 0, |
| 1304 | &wm5110_output_anc_src[0]), |
| 1305 | SND_SOC_DAPM_MUX("HPOUT1R ANC Source", SND_SOC_NOPM, 0, 0, |
| 1306 | &wm5110_output_anc_src[1]), |
| 1307 | SND_SOC_DAPM_MUX("HPOUT2L ANC Source", SND_SOC_NOPM, 0, 0, |
| 1308 | &wm5110_output_anc_src[2]), |
| 1309 | SND_SOC_DAPM_MUX("HPOUT2R ANC Source", SND_SOC_NOPM, 0, 0, |
| 1310 | &wm5110_output_anc_src[3]), |
| 1311 | SND_SOC_DAPM_MUX("HPOUT3L ANC Source", SND_SOC_NOPM, 0, 0, |
| 1312 | &wm5110_output_anc_src[4]), |
| 1313 | SND_SOC_DAPM_MUX("HPOUT3R ANC Source", SND_SOC_NOPM, 0, 0, |
| 1314 | &wm5110_output_anc_src[5]), |
| 1315 | SND_SOC_DAPM_MUX("SPKOUTL ANC Source", SND_SOC_NOPM, 0, 0, |
| 1316 | &wm5110_output_anc_src[6]), |
| 1317 | SND_SOC_DAPM_MUX("SPKOUTR ANC Source", SND_SOC_NOPM, 0, 0, |
| 1318 | &wm5110_output_anc_src[7]), |
| 1319 | SND_SOC_DAPM_MUX("SPKDAT1L ANC Source", SND_SOC_NOPM, 0, 0, |
| 1320 | &wm5110_output_anc_src[8]), |
| 1321 | SND_SOC_DAPM_MUX("SPKDAT1R ANC Source", SND_SOC_NOPM, 0, 0, |
| 1322 | &wm5110_output_anc_src[9]), |
| 1323 | SND_SOC_DAPM_MUX("SPKDAT2L ANC Source", SND_SOC_NOPM, 0, 0, |
| 1324 | &wm5110_output_anc_src[10]), |
| 1325 | SND_SOC_DAPM_MUX("SPKDAT2R ANC Source", SND_SOC_NOPM, 0, 0, |
| 1326 | &wm5110_output_anc_src[11]), |
| 1327 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1328 | SND_SOC_DAPM_AIF_OUT("AIF1TX1", NULL, 0, |
| 1329 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX1_ENA_SHIFT, 0), |
| 1330 | SND_SOC_DAPM_AIF_OUT("AIF1TX2", NULL, 0, |
| 1331 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX2_ENA_SHIFT, 0), |
| 1332 | SND_SOC_DAPM_AIF_OUT("AIF1TX3", NULL, 0, |
| 1333 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX3_ENA_SHIFT, 0), |
| 1334 | SND_SOC_DAPM_AIF_OUT("AIF1TX4", NULL, 0, |
| 1335 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX4_ENA_SHIFT, 0), |
| 1336 | SND_SOC_DAPM_AIF_OUT("AIF1TX5", NULL, 0, |
| 1337 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX5_ENA_SHIFT, 0), |
| 1338 | SND_SOC_DAPM_AIF_OUT("AIF1TX6", NULL, 0, |
| 1339 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX6_ENA_SHIFT, 0), |
| 1340 | SND_SOC_DAPM_AIF_OUT("AIF1TX7", NULL, 0, |
| 1341 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX7_ENA_SHIFT, 0), |
| 1342 | SND_SOC_DAPM_AIF_OUT("AIF1TX8", NULL, 0, |
| 1343 | ARIZONA_AIF1_TX_ENABLES, ARIZONA_AIF1TX8_ENA_SHIFT, 0), |
| 1344 | |
| 1345 | SND_SOC_DAPM_AIF_IN("AIF1RX1", NULL, 0, |
| 1346 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX1_ENA_SHIFT, 0), |
| 1347 | SND_SOC_DAPM_AIF_IN("AIF1RX2", NULL, 0, |
| 1348 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX2_ENA_SHIFT, 0), |
| 1349 | SND_SOC_DAPM_AIF_IN("AIF1RX3", NULL, 0, |
| 1350 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX3_ENA_SHIFT, 0), |
| 1351 | SND_SOC_DAPM_AIF_IN("AIF1RX4", NULL, 0, |
| 1352 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX4_ENA_SHIFT, 0), |
| 1353 | SND_SOC_DAPM_AIF_IN("AIF1RX5", NULL, 0, |
| 1354 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX5_ENA_SHIFT, 0), |
| 1355 | SND_SOC_DAPM_AIF_IN("AIF1RX6", NULL, 0, |
| 1356 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX6_ENA_SHIFT, 0), |
| 1357 | SND_SOC_DAPM_AIF_IN("AIF1RX7", NULL, 0, |
| 1358 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX7_ENA_SHIFT, 0), |
| 1359 | SND_SOC_DAPM_AIF_IN("AIF1RX8", NULL, 0, |
| 1360 | ARIZONA_AIF1_RX_ENABLES, ARIZONA_AIF1RX8_ENA_SHIFT, 0), |
| 1361 | |
| 1362 | SND_SOC_DAPM_AIF_OUT("AIF2TX1", NULL, 0, |
| 1363 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX1_ENA_SHIFT, 0), |
| 1364 | SND_SOC_DAPM_AIF_OUT("AIF2TX2", NULL, 0, |
| 1365 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX2_ENA_SHIFT, 0), |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 1366 | SND_SOC_DAPM_AIF_OUT("AIF2TX3", NULL, 0, |
| 1367 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX3_ENA_SHIFT, 0), |
| 1368 | SND_SOC_DAPM_AIF_OUT("AIF2TX4", NULL, 0, |
| 1369 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX4_ENA_SHIFT, 0), |
| 1370 | SND_SOC_DAPM_AIF_OUT("AIF2TX5", NULL, 0, |
| 1371 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX5_ENA_SHIFT, 0), |
| 1372 | SND_SOC_DAPM_AIF_OUT("AIF2TX6", NULL, 0, |
| 1373 | ARIZONA_AIF2_TX_ENABLES, ARIZONA_AIF2TX6_ENA_SHIFT, 0), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1374 | |
| 1375 | SND_SOC_DAPM_AIF_IN("AIF2RX1", NULL, 0, |
| 1376 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX1_ENA_SHIFT, 0), |
| 1377 | SND_SOC_DAPM_AIF_IN("AIF2RX2", NULL, 0, |
| 1378 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX2_ENA_SHIFT, 0), |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 1379 | SND_SOC_DAPM_AIF_IN("AIF2RX3", NULL, 0, |
| 1380 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX3_ENA_SHIFT, 0), |
| 1381 | SND_SOC_DAPM_AIF_IN("AIF2RX4", NULL, 0, |
| 1382 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX4_ENA_SHIFT, 0), |
| 1383 | SND_SOC_DAPM_AIF_IN("AIF2RX5", NULL, 0, |
| 1384 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX5_ENA_SHIFT, 0), |
| 1385 | SND_SOC_DAPM_AIF_IN("AIF2RX6", NULL, 0, |
| 1386 | ARIZONA_AIF2_RX_ENABLES, ARIZONA_AIF2RX6_ENA_SHIFT, 0), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1387 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1388 | SND_SOC_DAPM_AIF_IN("SLIMRX1", NULL, 0, |
| 1389 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1390 | ARIZONA_SLIMRX1_ENA_SHIFT, 0), |
| 1391 | SND_SOC_DAPM_AIF_IN("SLIMRX2", NULL, 0, |
| 1392 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1393 | ARIZONA_SLIMRX2_ENA_SHIFT, 0), |
| 1394 | SND_SOC_DAPM_AIF_IN("SLIMRX3", NULL, 0, |
| 1395 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1396 | ARIZONA_SLIMRX3_ENA_SHIFT, 0), |
| 1397 | SND_SOC_DAPM_AIF_IN("SLIMRX4", NULL, 0, |
| 1398 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1399 | ARIZONA_SLIMRX4_ENA_SHIFT, 0), |
| 1400 | SND_SOC_DAPM_AIF_IN("SLIMRX5", NULL, 0, |
| 1401 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1402 | ARIZONA_SLIMRX5_ENA_SHIFT, 0), |
| 1403 | SND_SOC_DAPM_AIF_IN("SLIMRX6", NULL, 0, |
| 1404 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1405 | ARIZONA_SLIMRX6_ENA_SHIFT, 0), |
| 1406 | SND_SOC_DAPM_AIF_IN("SLIMRX7", NULL, 0, |
| 1407 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1408 | ARIZONA_SLIMRX7_ENA_SHIFT, 0), |
| 1409 | SND_SOC_DAPM_AIF_IN("SLIMRX8", NULL, 0, |
| 1410 | ARIZONA_SLIMBUS_RX_CHANNEL_ENABLE, |
| 1411 | ARIZONA_SLIMRX8_ENA_SHIFT, 0), |
| 1412 | |
| 1413 | SND_SOC_DAPM_AIF_OUT("SLIMTX1", NULL, 0, |
| 1414 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1415 | ARIZONA_SLIMTX1_ENA_SHIFT, 0), |
| 1416 | SND_SOC_DAPM_AIF_OUT("SLIMTX2", NULL, 0, |
| 1417 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1418 | ARIZONA_SLIMTX2_ENA_SHIFT, 0), |
| 1419 | SND_SOC_DAPM_AIF_OUT("SLIMTX3", NULL, 0, |
| 1420 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1421 | ARIZONA_SLIMTX3_ENA_SHIFT, 0), |
| 1422 | SND_SOC_DAPM_AIF_OUT("SLIMTX4", NULL, 0, |
| 1423 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1424 | ARIZONA_SLIMTX4_ENA_SHIFT, 0), |
| 1425 | SND_SOC_DAPM_AIF_OUT("SLIMTX5", NULL, 0, |
| 1426 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1427 | ARIZONA_SLIMTX5_ENA_SHIFT, 0), |
| 1428 | SND_SOC_DAPM_AIF_OUT("SLIMTX6", NULL, 0, |
| 1429 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1430 | ARIZONA_SLIMTX6_ENA_SHIFT, 0), |
| 1431 | SND_SOC_DAPM_AIF_OUT("SLIMTX7", NULL, 0, |
| 1432 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1433 | ARIZONA_SLIMTX7_ENA_SHIFT, 0), |
| 1434 | SND_SOC_DAPM_AIF_OUT("SLIMTX8", NULL, 0, |
| 1435 | ARIZONA_SLIMBUS_TX_CHANNEL_ENABLE, |
| 1436 | ARIZONA_SLIMTX8_ENA_SHIFT, 0), |
| 1437 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1438 | SND_SOC_DAPM_AIF_OUT("AIF3TX1", NULL, 0, |
| 1439 | ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX1_ENA_SHIFT, 0), |
| 1440 | SND_SOC_DAPM_AIF_OUT("AIF3TX2", NULL, 0, |
| 1441 | ARIZONA_AIF3_TX_ENABLES, ARIZONA_AIF3TX2_ENA_SHIFT, 0), |
| 1442 | |
| 1443 | SND_SOC_DAPM_AIF_IN("AIF3RX1", NULL, 0, |
| 1444 | ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX1_ENA_SHIFT, 0), |
| 1445 | SND_SOC_DAPM_AIF_IN("AIF3RX2", NULL, 0, |
| 1446 | ARIZONA_AIF3_RX_ENABLES, ARIZONA_AIF3RX2_ENA_SHIFT, 0), |
| 1447 | |
Mark Brown | f607e31 | 2013-02-22 18:36:53 +0000 | [diff] [blame] | 1448 | SND_SOC_DAPM_PGA_E("OUT1L", SND_SOC_NOPM, |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 1449 | ARIZONA_OUT1L_ENA_SHIFT, 0, NULL, 0, wm5110_hp_ev, |
Charles Keepax | 054e1b4 | 2015-01-20 16:31:50 +0000 | [diff] [blame] | 1450 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | e1ae5fb | 2015-01-20 16:31:51 +0000 | [diff] [blame] | 1451 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | f607e31 | 2013-02-22 18:36:53 +0000 | [diff] [blame] | 1452 | SND_SOC_DAPM_PGA_E("OUT1R", SND_SOC_NOPM, |
Charles Keepax | d1acd31 | 2015-07-07 15:28:14 +0100 | [diff] [blame] | 1453 | ARIZONA_OUT1R_ENA_SHIFT, 0, NULL, 0, wm5110_hp_ev, |
Charles Keepax | 054e1b4 | 2015-01-20 16:31:50 +0000 | [diff] [blame] | 1454 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | e1ae5fb | 2015-01-20 16:31:51 +0000 | [diff] [blame] | 1455 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1456 | SND_SOC_DAPM_PGA_E("OUT2L", ARIZONA_OUTPUT_ENABLES_1, |
| 1457 | ARIZONA_OUT2L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
Charles Keepax | 054e1b4 | 2015-01-20 16:31:50 +0000 | [diff] [blame] | 1458 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | e1ae5fb | 2015-01-20 16:31:51 +0000 | [diff] [blame] | 1459 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1460 | SND_SOC_DAPM_PGA_E("OUT2R", ARIZONA_OUTPUT_ENABLES_1, |
| 1461 | ARIZONA_OUT2R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
Charles Keepax | 054e1b4 | 2015-01-20 16:31:50 +0000 | [diff] [blame] | 1462 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | e1ae5fb | 2015-01-20 16:31:51 +0000 | [diff] [blame] | 1463 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1464 | SND_SOC_DAPM_PGA_E("OUT3L", ARIZONA_OUTPUT_ENABLES_1, |
| 1465 | ARIZONA_OUT3L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
Charles Keepax | 054e1b4 | 2015-01-20 16:31:50 +0000 | [diff] [blame] | 1466 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | e1ae5fb | 2015-01-20 16:31:51 +0000 | [diff] [blame] | 1467 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 20bf691 | 2012-09-26 17:52:36 +0100 | [diff] [blame] | 1468 | SND_SOC_DAPM_PGA_E("OUT3R", ARIZONA_OUTPUT_ENABLES_1, |
| 1469 | ARIZONA_OUT3R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
Charles Keepax | 054e1b4 | 2015-01-20 16:31:50 +0000 | [diff] [blame] | 1470 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD | |
Charles Keepax | e1ae5fb | 2015-01-20 16:31:51 +0000 | [diff] [blame] | 1471 | SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1472 | SND_SOC_DAPM_PGA_E("OUT5L", ARIZONA_OUTPUT_ENABLES_1, |
| 1473 | ARIZONA_OUT5L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 1474 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 1475 | SND_SOC_DAPM_PGA_E("OUT5R", ARIZONA_OUTPUT_ENABLES_1, |
| 1476 | ARIZONA_OUT5R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 1477 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 1478 | SND_SOC_DAPM_PGA_E("OUT6L", ARIZONA_OUTPUT_ENABLES_1, |
| 1479 | ARIZONA_OUT6L_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 1480 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 1481 | SND_SOC_DAPM_PGA_E("OUT6R", ARIZONA_OUTPUT_ENABLES_1, |
| 1482 | ARIZONA_OUT6R_ENA_SHIFT, 0, NULL, 0, arizona_out_ev, |
| 1483 | SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU), |
| 1484 | |
| 1485 | ARIZONA_MIXER_WIDGETS(EQ1, "EQ1"), |
| 1486 | ARIZONA_MIXER_WIDGETS(EQ2, "EQ2"), |
| 1487 | ARIZONA_MIXER_WIDGETS(EQ3, "EQ3"), |
| 1488 | ARIZONA_MIXER_WIDGETS(EQ4, "EQ4"), |
| 1489 | |
| 1490 | ARIZONA_MIXER_WIDGETS(DRC1L, "DRC1L"), |
| 1491 | ARIZONA_MIXER_WIDGETS(DRC1R, "DRC1R"), |
| 1492 | ARIZONA_MIXER_WIDGETS(DRC2L, "DRC2L"), |
| 1493 | ARIZONA_MIXER_WIDGETS(DRC2R, "DRC2R"), |
| 1494 | |
| 1495 | ARIZONA_MIXER_WIDGETS(LHPF1, "LHPF1"), |
| 1496 | ARIZONA_MIXER_WIDGETS(LHPF2, "LHPF2"), |
| 1497 | ARIZONA_MIXER_WIDGETS(LHPF3, "LHPF3"), |
| 1498 | ARIZONA_MIXER_WIDGETS(LHPF4, "LHPF4"), |
| 1499 | |
| 1500 | ARIZONA_MIXER_WIDGETS(Mic, "Mic"), |
| 1501 | ARIZONA_MIXER_WIDGETS(Noise, "Noise"), |
| 1502 | |
| 1503 | ARIZONA_MIXER_WIDGETS(PWM1, "PWM1"), |
| 1504 | ARIZONA_MIXER_WIDGETS(PWM2, "PWM2"), |
| 1505 | |
| 1506 | ARIZONA_MIXER_WIDGETS(OUT1L, "HPOUT1L"), |
| 1507 | ARIZONA_MIXER_WIDGETS(OUT1R, "HPOUT1R"), |
| 1508 | ARIZONA_MIXER_WIDGETS(OUT2L, "HPOUT2L"), |
| 1509 | ARIZONA_MIXER_WIDGETS(OUT2R, "HPOUT2R"), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 1510 | ARIZONA_MIXER_WIDGETS(OUT3L, "HPOUT3L"), |
| 1511 | ARIZONA_MIXER_WIDGETS(OUT3R, "HPOUT3R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1512 | ARIZONA_MIXER_WIDGETS(SPKOUTL, "SPKOUTL"), |
| 1513 | ARIZONA_MIXER_WIDGETS(SPKOUTR, "SPKOUTR"), |
| 1514 | ARIZONA_MIXER_WIDGETS(SPKDAT1L, "SPKDAT1L"), |
| 1515 | ARIZONA_MIXER_WIDGETS(SPKDAT1R, "SPKDAT1R"), |
| 1516 | ARIZONA_MIXER_WIDGETS(SPKDAT2L, "SPKDAT2L"), |
| 1517 | ARIZONA_MIXER_WIDGETS(SPKDAT2R, "SPKDAT2R"), |
| 1518 | |
| 1519 | ARIZONA_MIXER_WIDGETS(AIF1TX1, "AIF1TX1"), |
| 1520 | ARIZONA_MIXER_WIDGETS(AIF1TX2, "AIF1TX2"), |
| 1521 | ARIZONA_MIXER_WIDGETS(AIF1TX3, "AIF1TX3"), |
| 1522 | ARIZONA_MIXER_WIDGETS(AIF1TX4, "AIF1TX4"), |
| 1523 | ARIZONA_MIXER_WIDGETS(AIF1TX5, "AIF1TX5"), |
| 1524 | ARIZONA_MIXER_WIDGETS(AIF1TX6, "AIF1TX6"), |
| 1525 | ARIZONA_MIXER_WIDGETS(AIF1TX7, "AIF1TX7"), |
| 1526 | ARIZONA_MIXER_WIDGETS(AIF1TX8, "AIF1TX8"), |
| 1527 | |
| 1528 | ARIZONA_MIXER_WIDGETS(AIF2TX1, "AIF2TX1"), |
| 1529 | ARIZONA_MIXER_WIDGETS(AIF2TX2, "AIF2TX2"), |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 1530 | ARIZONA_MIXER_WIDGETS(AIF2TX3, "AIF2TX3"), |
| 1531 | ARIZONA_MIXER_WIDGETS(AIF2TX4, "AIF2TX4"), |
| 1532 | ARIZONA_MIXER_WIDGETS(AIF2TX5, "AIF2TX5"), |
| 1533 | ARIZONA_MIXER_WIDGETS(AIF2TX6, "AIF2TX6"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1534 | |
| 1535 | ARIZONA_MIXER_WIDGETS(AIF3TX1, "AIF3TX1"), |
| 1536 | ARIZONA_MIXER_WIDGETS(AIF3TX2, "AIF3TX2"), |
| 1537 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1538 | ARIZONA_MIXER_WIDGETS(SLIMTX1, "SLIMTX1"), |
| 1539 | ARIZONA_MIXER_WIDGETS(SLIMTX2, "SLIMTX2"), |
| 1540 | ARIZONA_MIXER_WIDGETS(SLIMTX3, "SLIMTX3"), |
| 1541 | ARIZONA_MIXER_WIDGETS(SLIMTX4, "SLIMTX4"), |
| 1542 | ARIZONA_MIXER_WIDGETS(SLIMTX5, "SLIMTX5"), |
| 1543 | ARIZONA_MIXER_WIDGETS(SLIMTX6, "SLIMTX6"), |
| 1544 | ARIZONA_MIXER_WIDGETS(SLIMTX7, "SLIMTX7"), |
| 1545 | ARIZONA_MIXER_WIDGETS(SLIMTX8, "SLIMTX8"), |
| 1546 | |
Charles Keepax | 5886c74 | 2012-11-13 16:40:34 +0000 | [diff] [blame] | 1547 | ARIZONA_MUX_WIDGETS(ASRC1L, "ASRC1L"), |
| 1548 | ARIZONA_MUX_WIDGETS(ASRC1R, "ASRC1R"), |
| 1549 | ARIZONA_MUX_WIDGETS(ASRC2L, "ASRC2L"), |
| 1550 | ARIZONA_MUX_WIDGETS(ASRC2R, "ASRC2R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1551 | |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 1552 | ARIZONA_DSP_WIDGETS(DSP1, "DSP1"), |
| 1553 | ARIZONA_DSP_WIDGETS(DSP2, "DSP2"), |
| 1554 | ARIZONA_DSP_WIDGETS(DSP3, "DSP3"), |
| 1555 | ARIZONA_DSP_WIDGETS(DSP4, "DSP4"), |
| 1556 | |
Charles Keepax | 0da2e5b | 2013-11-19 16:04:02 +0000 | [diff] [blame] | 1557 | ARIZONA_MUX_WIDGETS(ISRC1DEC1, "ISRC1DEC1"), |
| 1558 | ARIZONA_MUX_WIDGETS(ISRC1DEC2, "ISRC1DEC2"), |
| 1559 | ARIZONA_MUX_WIDGETS(ISRC1DEC3, "ISRC1DEC3"), |
| 1560 | ARIZONA_MUX_WIDGETS(ISRC1DEC4, "ISRC1DEC4"), |
| 1561 | |
| 1562 | ARIZONA_MUX_WIDGETS(ISRC1INT1, "ISRC1INT1"), |
| 1563 | ARIZONA_MUX_WIDGETS(ISRC1INT2, "ISRC1INT2"), |
| 1564 | ARIZONA_MUX_WIDGETS(ISRC1INT3, "ISRC1INT3"), |
| 1565 | ARIZONA_MUX_WIDGETS(ISRC1INT4, "ISRC1INT4"), |
| 1566 | |
| 1567 | ARIZONA_MUX_WIDGETS(ISRC2DEC1, "ISRC2DEC1"), |
| 1568 | ARIZONA_MUX_WIDGETS(ISRC2DEC2, "ISRC2DEC2"), |
| 1569 | ARIZONA_MUX_WIDGETS(ISRC2DEC3, "ISRC2DEC3"), |
| 1570 | ARIZONA_MUX_WIDGETS(ISRC2DEC4, "ISRC2DEC4"), |
| 1571 | |
| 1572 | ARIZONA_MUX_WIDGETS(ISRC2INT1, "ISRC2INT1"), |
| 1573 | ARIZONA_MUX_WIDGETS(ISRC2INT2, "ISRC2INT2"), |
| 1574 | ARIZONA_MUX_WIDGETS(ISRC2INT3, "ISRC2INT3"), |
| 1575 | ARIZONA_MUX_WIDGETS(ISRC2INT4, "ISRC2INT4"), |
| 1576 | |
| 1577 | ARIZONA_MUX_WIDGETS(ISRC3DEC1, "ISRC3DEC1"), |
| 1578 | ARIZONA_MUX_WIDGETS(ISRC3DEC2, "ISRC3DEC2"), |
| 1579 | ARIZONA_MUX_WIDGETS(ISRC3DEC3, "ISRC3DEC3"), |
| 1580 | ARIZONA_MUX_WIDGETS(ISRC3DEC4, "ISRC3DEC4"), |
| 1581 | |
| 1582 | ARIZONA_MUX_WIDGETS(ISRC3INT1, "ISRC3INT1"), |
| 1583 | ARIZONA_MUX_WIDGETS(ISRC3INT2, "ISRC3INT2"), |
| 1584 | ARIZONA_MUX_WIDGETS(ISRC3INT3, "ISRC3INT3"), |
| 1585 | ARIZONA_MUX_WIDGETS(ISRC3INT4, "ISRC3INT4"), |
| 1586 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1587 | SND_SOC_DAPM_OUTPUT("HPOUT1L"), |
| 1588 | SND_SOC_DAPM_OUTPUT("HPOUT1R"), |
| 1589 | SND_SOC_DAPM_OUTPUT("HPOUT2L"), |
| 1590 | SND_SOC_DAPM_OUTPUT("HPOUT2R"), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 1591 | SND_SOC_DAPM_OUTPUT("HPOUT3L"), |
| 1592 | SND_SOC_DAPM_OUTPUT("HPOUT3R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1593 | SND_SOC_DAPM_OUTPUT("SPKOUTLN"), |
| 1594 | SND_SOC_DAPM_OUTPUT("SPKOUTLP"), |
| 1595 | SND_SOC_DAPM_OUTPUT("SPKOUTRN"), |
| 1596 | SND_SOC_DAPM_OUTPUT("SPKOUTRP"), |
| 1597 | SND_SOC_DAPM_OUTPUT("SPKDAT1L"), |
| 1598 | SND_SOC_DAPM_OUTPUT("SPKDAT1R"), |
| 1599 | SND_SOC_DAPM_OUTPUT("SPKDAT2L"), |
| 1600 | SND_SOC_DAPM_OUTPUT("SPKDAT2R"), |
Mark Brown | 57a10a1 | 2013-01-10 19:32:33 +0000 | [diff] [blame] | 1601 | |
| 1602 | SND_SOC_DAPM_OUTPUT("MICSUPP"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1603 | }; |
| 1604 | |
| 1605 | #define ARIZONA_MIXER_INPUT_ROUTES(name) \ |
| 1606 | { name, "Noise Generator", "Noise Generator" }, \ |
| 1607 | { name, "Tone Generator 1", "Tone Generator 1" }, \ |
| 1608 | { name, "Tone Generator 2", "Tone Generator 2" }, \ |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 1609 | { name, "Haptics", "HAPTICS" }, \ |
Mark Brown | dac8f1c | 2012-08-26 13:51:27 -0700 | [diff] [blame] | 1610 | { name, "AEC", "AEC Loopback" }, \ |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1611 | { name, "IN1L", "IN1L PGA" }, \ |
| 1612 | { name, "IN1R", "IN1R PGA" }, \ |
| 1613 | { name, "IN2L", "IN2L PGA" }, \ |
| 1614 | { name, "IN2R", "IN2R PGA" }, \ |
| 1615 | { name, "IN3L", "IN3L PGA" }, \ |
| 1616 | { name, "IN3R", "IN3R PGA" }, \ |
| 1617 | { name, "IN4L", "IN4L PGA" }, \ |
| 1618 | { name, "IN4R", "IN4R PGA" }, \ |
| 1619 | { name, "Mic Mute Mixer", "Mic Mute Mixer" }, \ |
| 1620 | { name, "AIF1RX1", "AIF1RX1" }, \ |
| 1621 | { name, "AIF1RX2", "AIF1RX2" }, \ |
| 1622 | { name, "AIF1RX3", "AIF1RX3" }, \ |
| 1623 | { name, "AIF1RX4", "AIF1RX4" }, \ |
| 1624 | { name, "AIF1RX5", "AIF1RX5" }, \ |
| 1625 | { name, "AIF1RX6", "AIF1RX6" }, \ |
| 1626 | { name, "AIF1RX7", "AIF1RX7" }, \ |
| 1627 | { name, "AIF1RX8", "AIF1RX8" }, \ |
| 1628 | { name, "AIF2RX1", "AIF2RX1" }, \ |
| 1629 | { name, "AIF2RX2", "AIF2RX2" }, \ |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 1630 | { name, "AIF2RX3", "AIF2RX3" }, \ |
| 1631 | { name, "AIF2RX4", "AIF2RX4" }, \ |
| 1632 | { name, "AIF2RX5", "AIF2RX5" }, \ |
| 1633 | { name, "AIF2RX6", "AIF2RX6" }, \ |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1634 | { name, "AIF3RX1", "AIF3RX1" }, \ |
| 1635 | { name, "AIF3RX2", "AIF3RX2" }, \ |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1636 | { name, "SLIMRX1", "SLIMRX1" }, \ |
| 1637 | { name, "SLIMRX2", "SLIMRX2" }, \ |
| 1638 | { name, "SLIMRX3", "SLIMRX3" }, \ |
| 1639 | { name, "SLIMRX4", "SLIMRX4" }, \ |
| 1640 | { name, "SLIMRX5", "SLIMRX5" }, \ |
| 1641 | { name, "SLIMRX6", "SLIMRX6" }, \ |
| 1642 | { name, "SLIMRX7", "SLIMRX7" }, \ |
| 1643 | { name, "SLIMRX8", "SLIMRX8" }, \ |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1644 | { name, "EQ1", "EQ1" }, \ |
| 1645 | { name, "EQ2", "EQ2" }, \ |
| 1646 | { name, "EQ3", "EQ3" }, \ |
| 1647 | { name, "EQ4", "EQ4" }, \ |
| 1648 | { name, "DRC1L", "DRC1L" }, \ |
| 1649 | { name, "DRC1R", "DRC1R" }, \ |
| 1650 | { name, "DRC2L", "DRC2L" }, \ |
| 1651 | { name, "DRC2R", "DRC2R" }, \ |
| 1652 | { name, "LHPF1", "LHPF1" }, \ |
| 1653 | { name, "LHPF2", "LHPF2" }, \ |
| 1654 | { name, "LHPF3", "LHPF3" }, \ |
| 1655 | { name, "LHPF4", "LHPF4" }, \ |
| 1656 | { name, "ASRC1L", "ASRC1L" }, \ |
| 1657 | { name, "ASRC1R", "ASRC1R" }, \ |
| 1658 | { name, "ASRC2L", "ASRC2L" }, \ |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 1659 | { name, "ASRC2R", "ASRC2R" }, \ |
Charles Keepax | 0da2e5b | 2013-11-19 16:04:02 +0000 | [diff] [blame] | 1660 | { name, "ISRC1DEC1", "ISRC1DEC1" }, \ |
| 1661 | { name, "ISRC1DEC2", "ISRC1DEC2" }, \ |
| 1662 | { name, "ISRC1DEC3", "ISRC1DEC3" }, \ |
| 1663 | { name, "ISRC1DEC4", "ISRC1DEC4" }, \ |
| 1664 | { name, "ISRC1INT1", "ISRC1INT1" }, \ |
| 1665 | { name, "ISRC1INT2", "ISRC1INT2" }, \ |
| 1666 | { name, "ISRC1INT3", "ISRC1INT3" }, \ |
| 1667 | { name, "ISRC1INT4", "ISRC1INT4" }, \ |
| 1668 | { name, "ISRC2DEC1", "ISRC2DEC1" }, \ |
| 1669 | { name, "ISRC2DEC2", "ISRC2DEC2" }, \ |
| 1670 | { name, "ISRC2DEC3", "ISRC2DEC3" }, \ |
| 1671 | { name, "ISRC2DEC4", "ISRC2DEC4" }, \ |
| 1672 | { name, "ISRC2INT1", "ISRC2INT1" }, \ |
| 1673 | { name, "ISRC2INT2", "ISRC2INT2" }, \ |
| 1674 | { name, "ISRC2INT3", "ISRC2INT3" }, \ |
| 1675 | { name, "ISRC2INT4", "ISRC2INT4" }, \ |
| 1676 | { name, "ISRC3DEC1", "ISRC3DEC1" }, \ |
| 1677 | { name, "ISRC3DEC2", "ISRC3DEC2" }, \ |
| 1678 | { name, "ISRC3DEC3", "ISRC3DEC3" }, \ |
| 1679 | { name, "ISRC3DEC4", "ISRC3DEC4" }, \ |
| 1680 | { name, "ISRC3INT1", "ISRC3INT1" }, \ |
| 1681 | { name, "ISRC3INT2", "ISRC3INT2" }, \ |
| 1682 | { name, "ISRC3INT3", "ISRC3INT3" }, \ |
| 1683 | { name, "ISRC3INT4", "ISRC3INT4" }, \ |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 1684 | { name, "DSP1.1", "DSP1" }, \ |
| 1685 | { name, "DSP1.2", "DSP1" }, \ |
| 1686 | { name, "DSP1.3", "DSP1" }, \ |
| 1687 | { name, "DSP1.4", "DSP1" }, \ |
| 1688 | { name, "DSP1.5", "DSP1" }, \ |
| 1689 | { name, "DSP1.6", "DSP1" }, \ |
| 1690 | { name, "DSP2.1", "DSP2" }, \ |
| 1691 | { name, "DSP2.2", "DSP2" }, \ |
| 1692 | { name, "DSP2.3", "DSP2" }, \ |
| 1693 | { name, "DSP2.4", "DSP2" }, \ |
| 1694 | { name, "DSP2.5", "DSP2" }, \ |
| 1695 | { name, "DSP2.6", "DSP2" }, \ |
| 1696 | { name, "DSP3.1", "DSP3" }, \ |
| 1697 | { name, "DSP3.2", "DSP3" }, \ |
| 1698 | { name, "DSP3.3", "DSP3" }, \ |
| 1699 | { name, "DSP3.4", "DSP3" }, \ |
| 1700 | { name, "DSP3.5", "DSP3" }, \ |
| 1701 | { name, "DSP3.6", "DSP3" }, \ |
| 1702 | { name, "DSP4.1", "DSP4" }, \ |
| 1703 | { name, "DSP4.2", "DSP4" }, \ |
| 1704 | { name, "DSP4.3", "DSP4" }, \ |
| 1705 | { name, "DSP4.4", "DSP4" }, \ |
| 1706 | { name, "DSP4.5", "DSP4" }, \ |
| 1707 | { name, "DSP4.6", "DSP4" } |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1708 | |
| 1709 | static const struct snd_soc_dapm_route wm5110_dapm_routes[] = { |
| 1710 | { "AIF2 Capture", NULL, "DBVDD2" }, |
| 1711 | { "AIF2 Playback", NULL, "DBVDD2" }, |
| 1712 | |
| 1713 | { "AIF3 Capture", NULL, "DBVDD3" }, |
| 1714 | { "AIF3 Playback", NULL, "DBVDD3" }, |
| 1715 | |
| 1716 | { "OUT1L", NULL, "CPVDD" }, |
| 1717 | { "OUT1R", NULL, "CPVDD" }, |
| 1718 | { "OUT2L", NULL, "CPVDD" }, |
| 1719 | { "OUT2R", NULL, "CPVDD" }, |
| 1720 | { "OUT3L", NULL, "CPVDD" }, |
Mark Brown | 20bf691 | 2012-09-26 17:52:36 +0100 | [diff] [blame] | 1721 | { "OUT3R", NULL, "CPVDD" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1722 | |
| 1723 | { "OUT4L", NULL, "SPKVDDL" }, |
| 1724 | { "OUT4R", NULL, "SPKVDDR" }, |
| 1725 | |
| 1726 | { "OUT1L", NULL, "SYSCLK" }, |
| 1727 | { "OUT1R", NULL, "SYSCLK" }, |
| 1728 | { "OUT2L", NULL, "SYSCLK" }, |
| 1729 | { "OUT2R", NULL, "SYSCLK" }, |
| 1730 | { "OUT3L", NULL, "SYSCLK" }, |
Ajit Pandey | d72fea6 | 2016-06-13 13:35:15 +0100 | [diff] [blame] | 1731 | { "OUT3R", NULL, "SYSCLK" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1732 | { "OUT4L", NULL, "SYSCLK" }, |
| 1733 | { "OUT4R", NULL, "SYSCLK" }, |
| 1734 | { "OUT5L", NULL, "SYSCLK" }, |
| 1735 | { "OUT5R", NULL, "SYSCLK" }, |
| 1736 | { "OUT6L", NULL, "SYSCLK" }, |
| 1737 | { "OUT6R", NULL, "SYSCLK" }, |
| 1738 | |
Charles Keepax | 6dc6a3f | 2013-06-05 14:51:31 +0100 | [diff] [blame] | 1739 | { "IN1L", NULL, "SYSCLK" }, |
| 1740 | { "IN1R", NULL, "SYSCLK" }, |
| 1741 | { "IN2L", NULL, "SYSCLK" }, |
| 1742 | { "IN2R", NULL, "SYSCLK" }, |
| 1743 | { "IN3L", NULL, "SYSCLK" }, |
| 1744 | { "IN3R", NULL, "SYSCLK" }, |
| 1745 | { "IN4L", NULL, "SYSCLK" }, |
| 1746 | { "IN4R", NULL, "SYSCLK" }, |
| 1747 | |
Charles Keepax | 19c8919 | 2016-08-11 14:42:55 +0100 | [diff] [blame] | 1748 | { "ASRC1L", NULL, "SYSCLK" }, |
| 1749 | { "ASRC1R", NULL, "SYSCLK" }, |
| 1750 | { "ASRC2L", NULL, "SYSCLK" }, |
| 1751 | { "ASRC2R", NULL, "SYSCLK" }, |
| 1752 | |
| 1753 | { "ASRC1L", NULL, "ASYNCCLK" }, |
| 1754 | { "ASRC1R", NULL, "ASYNCCLK" }, |
| 1755 | { "ASRC2L", NULL, "ASYNCCLK" }, |
| 1756 | { "ASRC2R", NULL, "ASYNCCLK" }, |
| 1757 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1758 | { "MICBIAS1", NULL, "MICVDD" }, |
| 1759 | { "MICBIAS2", NULL, "MICVDD" }, |
| 1760 | { "MICBIAS3", NULL, "MICVDD" }, |
| 1761 | |
Charles Keepax | 6dc6a3f | 2013-06-05 14:51:31 +0100 | [diff] [blame] | 1762 | { "Noise Generator", NULL, "SYSCLK" }, |
| 1763 | { "Tone Generator 1", NULL, "SYSCLK" }, |
| 1764 | { "Tone Generator 2", NULL, "SYSCLK" }, |
| 1765 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1766 | { "Noise Generator", NULL, "NOISE" }, |
| 1767 | { "Tone Generator 1", NULL, "TONE" }, |
| 1768 | { "Tone Generator 2", NULL, "TONE" }, |
| 1769 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1770 | { "AIF1 Capture", NULL, "AIF1TX1" }, |
| 1771 | { "AIF1 Capture", NULL, "AIF1TX2" }, |
| 1772 | { "AIF1 Capture", NULL, "AIF1TX3" }, |
| 1773 | { "AIF1 Capture", NULL, "AIF1TX4" }, |
| 1774 | { "AIF1 Capture", NULL, "AIF1TX5" }, |
| 1775 | { "AIF1 Capture", NULL, "AIF1TX6" }, |
| 1776 | { "AIF1 Capture", NULL, "AIF1TX7" }, |
| 1777 | { "AIF1 Capture", NULL, "AIF1TX8" }, |
| 1778 | |
| 1779 | { "AIF1RX1", NULL, "AIF1 Playback" }, |
| 1780 | { "AIF1RX2", NULL, "AIF1 Playback" }, |
| 1781 | { "AIF1RX3", NULL, "AIF1 Playback" }, |
| 1782 | { "AIF1RX4", NULL, "AIF1 Playback" }, |
| 1783 | { "AIF1RX5", NULL, "AIF1 Playback" }, |
| 1784 | { "AIF1RX6", NULL, "AIF1 Playback" }, |
| 1785 | { "AIF1RX7", NULL, "AIF1 Playback" }, |
| 1786 | { "AIF1RX8", NULL, "AIF1 Playback" }, |
| 1787 | |
| 1788 | { "AIF2 Capture", NULL, "AIF2TX1" }, |
| 1789 | { "AIF2 Capture", NULL, "AIF2TX2" }, |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 1790 | { "AIF2 Capture", NULL, "AIF2TX3" }, |
| 1791 | { "AIF2 Capture", NULL, "AIF2TX4" }, |
| 1792 | { "AIF2 Capture", NULL, "AIF2TX5" }, |
| 1793 | { "AIF2 Capture", NULL, "AIF2TX6" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1794 | |
| 1795 | { "AIF2RX1", NULL, "AIF2 Playback" }, |
| 1796 | { "AIF2RX2", NULL, "AIF2 Playback" }, |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 1797 | { "AIF2RX3", NULL, "AIF2 Playback" }, |
| 1798 | { "AIF2RX4", NULL, "AIF2 Playback" }, |
| 1799 | { "AIF2RX5", NULL, "AIF2 Playback" }, |
| 1800 | { "AIF2RX6", NULL, "AIF2 Playback" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1801 | |
| 1802 | { "AIF3 Capture", NULL, "AIF3TX1" }, |
| 1803 | { "AIF3 Capture", NULL, "AIF3TX2" }, |
| 1804 | |
| 1805 | { "AIF3RX1", NULL, "AIF3 Playback" }, |
| 1806 | { "AIF3RX2", NULL, "AIF3 Playback" }, |
| 1807 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1808 | { "Slim1 Capture", NULL, "SLIMTX1" }, |
| 1809 | { "Slim1 Capture", NULL, "SLIMTX2" }, |
| 1810 | { "Slim1 Capture", NULL, "SLIMTX3" }, |
| 1811 | { "Slim1 Capture", NULL, "SLIMTX4" }, |
| 1812 | |
| 1813 | { "SLIMRX1", NULL, "Slim1 Playback" }, |
| 1814 | { "SLIMRX2", NULL, "Slim1 Playback" }, |
| 1815 | { "SLIMRX3", NULL, "Slim1 Playback" }, |
| 1816 | { "SLIMRX4", NULL, "Slim1 Playback" }, |
| 1817 | |
| 1818 | { "Slim2 Capture", NULL, "SLIMTX5" }, |
| 1819 | { "Slim2 Capture", NULL, "SLIMTX6" }, |
| 1820 | |
| 1821 | { "SLIMRX5", NULL, "Slim2 Playback" }, |
| 1822 | { "SLIMRX6", NULL, "Slim2 Playback" }, |
| 1823 | |
| 1824 | { "Slim3 Capture", NULL, "SLIMTX7" }, |
| 1825 | { "Slim3 Capture", NULL, "SLIMTX8" }, |
| 1826 | |
| 1827 | { "SLIMRX7", NULL, "Slim3 Playback" }, |
| 1828 | { "SLIMRX8", NULL, "Slim3 Playback" }, |
| 1829 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1830 | { "AIF1 Playback", NULL, "SYSCLK" }, |
| 1831 | { "AIF2 Playback", NULL, "SYSCLK" }, |
| 1832 | { "AIF3 Playback", NULL, "SYSCLK" }, |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1833 | { "Slim1 Playback", NULL, "SYSCLK" }, |
| 1834 | { "Slim2 Playback", NULL, "SYSCLK" }, |
| 1835 | { "Slim3 Playback", NULL, "SYSCLK" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1836 | |
| 1837 | { "AIF1 Capture", NULL, "SYSCLK" }, |
| 1838 | { "AIF2 Capture", NULL, "SYSCLK" }, |
| 1839 | { "AIF3 Capture", NULL, "SYSCLK" }, |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1840 | { "Slim1 Capture", NULL, "SYSCLK" }, |
| 1841 | { "Slim2 Capture", NULL, "SYSCLK" }, |
| 1842 | { "Slim3 Capture", NULL, "SYSCLK" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1843 | |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 1844 | { "Voice Control DSP", NULL, "DSP3" }, |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 1845 | |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 1846 | { "Audio Trace DSP", NULL, "DSP1" }, |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 1847 | |
Mark Brown | 17c3f7e | 2012-08-10 15:40:22 +0100 | [diff] [blame] | 1848 | { "IN1L PGA", NULL, "IN1L" }, |
| 1849 | { "IN1R PGA", NULL, "IN1R" }, |
| 1850 | |
| 1851 | { "IN2L PGA", NULL, "IN2L" }, |
| 1852 | { "IN2R PGA", NULL, "IN2R" }, |
| 1853 | |
| 1854 | { "IN3L PGA", NULL, "IN3L" }, |
| 1855 | { "IN3R PGA", NULL, "IN3R" }, |
| 1856 | |
| 1857 | { "IN4L PGA", NULL, "IN4L" }, |
| 1858 | { "IN4R PGA", NULL, "IN4R" }, |
| 1859 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1860 | ARIZONA_MIXER_ROUTES("OUT1L", "HPOUT1L"), |
| 1861 | ARIZONA_MIXER_ROUTES("OUT1R", "HPOUT1R"), |
| 1862 | ARIZONA_MIXER_ROUTES("OUT2L", "HPOUT2L"), |
| 1863 | ARIZONA_MIXER_ROUTES("OUT2R", "HPOUT2R"), |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 1864 | ARIZONA_MIXER_ROUTES("OUT3L", "HPOUT3L"), |
| 1865 | ARIZONA_MIXER_ROUTES("OUT3R", "HPOUT3R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1866 | |
| 1867 | ARIZONA_MIXER_ROUTES("OUT4L", "SPKOUTL"), |
| 1868 | ARIZONA_MIXER_ROUTES("OUT4R", "SPKOUTR"), |
| 1869 | ARIZONA_MIXER_ROUTES("OUT5L", "SPKDAT1L"), |
| 1870 | ARIZONA_MIXER_ROUTES("OUT5R", "SPKDAT1R"), |
| 1871 | ARIZONA_MIXER_ROUTES("OUT6L", "SPKDAT2L"), |
| 1872 | ARIZONA_MIXER_ROUTES("OUT6R", "SPKDAT2R"), |
| 1873 | |
| 1874 | ARIZONA_MIXER_ROUTES("PWM1 Driver", "PWM1"), |
| 1875 | ARIZONA_MIXER_ROUTES("PWM2 Driver", "PWM2"), |
| 1876 | |
| 1877 | ARIZONA_MIXER_ROUTES("AIF1TX1", "AIF1TX1"), |
| 1878 | ARIZONA_MIXER_ROUTES("AIF1TX2", "AIF1TX2"), |
| 1879 | ARIZONA_MIXER_ROUTES("AIF1TX3", "AIF1TX3"), |
| 1880 | ARIZONA_MIXER_ROUTES("AIF1TX4", "AIF1TX4"), |
| 1881 | ARIZONA_MIXER_ROUTES("AIF1TX5", "AIF1TX5"), |
| 1882 | ARIZONA_MIXER_ROUTES("AIF1TX6", "AIF1TX6"), |
| 1883 | ARIZONA_MIXER_ROUTES("AIF1TX7", "AIF1TX7"), |
| 1884 | ARIZONA_MIXER_ROUTES("AIF1TX8", "AIF1TX8"), |
| 1885 | |
| 1886 | ARIZONA_MIXER_ROUTES("AIF2TX1", "AIF2TX1"), |
| 1887 | ARIZONA_MIXER_ROUTES("AIF2TX2", "AIF2TX2"), |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 1888 | ARIZONA_MIXER_ROUTES("AIF2TX3", "AIF2TX3"), |
| 1889 | ARIZONA_MIXER_ROUTES("AIF2TX4", "AIF2TX4"), |
| 1890 | ARIZONA_MIXER_ROUTES("AIF2TX5", "AIF2TX5"), |
| 1891 | ARIZONA_MIXER_ROUTES("AIF2TX6", "AIF2TX6"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1892 | |
| 1893 | ARIZONA_MIXER_ROUTES("AIF3TX1", "AIF3TX1"), |
| 1894 | ARIZONA_MIXER_ROUTES("AIF3TX2", "AIF3TX2"), |
| 1895 | |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 1896 | ARIZONA_MIXER_ROUTES("SLIMTX1", "SLIMTX1"), |
| 1897 | ARIZONA_MIXER_ROUTES("SLIMTX2", "SLIMTX2"), |
| 1898 | ARIZONA_MIXER_ROUTES("SLIMTX3", "SLIMTX3"), |
| 1899 | ARIZONA_MIXER_ROUTES("SLIMTX4", "SLIMTX4"), |
| 1900 | ARIZONA_MIXER_ROUTES("SLIMTX5", "SLIMTX5"), |
| 1901 | ARIZONA_MIXER_ROUTES("SLIMTX6", "SLIMTX6"), |
| 1902 | ARIZONA_MIXER_ROUTES("SLIMTX7", "SLIMTX7"), |
| 1903 | ARIZONA_MIXER_ROUTES("SLIMTX8", "SLIMTX8"), |
| 1904 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1905 | ARIZONA_MIXER_ROUTES("EQ1", "EQ1"), |
| 1906 | ARIZONA_MIXER_ROUTES("EQ2", "EQ2"), |
| 1907 | ARIZONA_MIXER_ROUTES("EQ3", "EQ3"), |
| 1908 | ARIZONA_MIXER_ROUTES("EQ4", "EQ4"), |
| 1909 | |
| 1910 | ARIZONA_MIXER_ROUTES("DRC1L", "DRC1L"), |
| 1911 | ARIZONA_MIXER_ROUTES("DRC1R", "DRC1R"), |
| 1912 | ARIZONA_MIXER_ROUTES("DRC2L", "DRC2L"), |
| 1913 | ARIZONA_MIXER_ROUTES("DRC2R", "DRC2R"), |
| 1914 | |
| 1915 | ARIZONA_MIXER_ROUTES("LHPF1", "LHPF1"), |
| 1916 | ARIZONA_MIXER_ROUTES("LHPF2", "LHPF2"), |
| 1917 | ARIZONA_MIXER_ROUTES("LHPF3", "LHPF3"), |
| 1918 | ARIZONA_MIXER_ROUTES("LHPF4", "LHPF4"), |
| 1919 | |
Mark Brown | 66e7aa2 | 2013-08-12 23:59:08 +0100 | [diff] [blame] | 1920 | ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Noise"), |
| 1921 | ARIZONA_MIXER_ROUTES("Mic Mute Mixer", "Mic"), |
| 1922 | |
Charles Keepax | e7edb27 | 2013-08-12 11:33:32 +0100 | [diff] [blame] | 1923 | ARIZONA_MUX_ROUTES("ASRC1L", "ASRC1L"), |
| 1924 | ARIZONA_MUX_ROUTES("ASRC1R", "ASRC1R"), |
| 1925 | ARIZONA_MUX_ROUTES("ASRC2L", "ASRC2L"), |
| 1926 | ARIZONA_MUX_ROUTES("ASRC2R", "ASRC2R"), |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1927 | |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 1928 | ARIZONA_DSP_ROUTES("DSP1"), |
| 1929 | ARIZONA_DSP_ROUTES("DSP2"), |
| 1930 | ARIZONA_DSP_ROUTES("DSP3"), |
| 1931 | ARIZONA_DSP_ROUTES("DSP4"), |
| 1932 | |
Charles Keepax | 0da2e5b | 2013-11-19 16:04:02 +0000 | [diff] [blame] | 1933 | ARIZONA_MUX_ROUTES("ISRC1INT1", "ISRC1INT1"), |
| 1934 | ARIZONA_MUX_ROUTES("ISRC1INT2", "ISRC1INT2"), |
| 1935 | ARIZONA_MUX_ROUTES("ISRC1INT3", "ISRC1INT3"), |
| 1936 | ARIZONA_MUX_ROUTES("ISRC1INT4", "ISRC1INT4"), |
| 1937 | |
| 1938 | ARIZONA_MUX_ROUTES("ISRC1DEC1", "ISRC1DEC1"), |
| 1939 | ARIZONA_MUX_ROUTES("ISRC1DEC2", "ISRC1DEC2"), |
| 1940 | ARIZONA_MUX_ROUTES("ISRC1DEC3", "ISRC1DEC3"), |
| 1941 | ARIZONA_MUX_ROUTES("ISRC1DEC4", "ISRC1DEC4"), |
| 1942 | |
| 1943 | ARIZONA_MUX_ROUTES("ISRC2INT1", "ISRC2INT1"), |
| 1944 | ARIZONA_MUX_ROUTES("ISRC2INT2", "ISRC2INT2"), |
| 1945 | ARIZONA_MUX_ROUTES("ISRC2INT3", "ISRC2INT3"), |
| 1946 | ARIZONA_MUX_ROUTES("ISRC2INT4", "ISRC2INT4"), |
| 1947 | |
| 1948 | ARIZONA_MUX_ROUTES("ISRC2DEC1", "ISRC2DEC1"), |
| 1949 | ARIZONA_MUX_ROUTES("ISRC2DEC2", "ISRC2DEC2"), |
| 1950 | ARIZONA_MUX_ROUTES("ISRC2DEC3", "ISRC2DEC3"), |
| 1951 | ARIZONA_MUX_ROUTES("ISRC2DEC4", "ISRC2DEC4"), |
| 1952 | |
| 1953 | ARIZONA_MUX_ROUTES("ISRC3INT1", "ISRC3INT1"), |
| 1954 | ARIZONA_MUX_ROUTES("ISRC3INT2", "ISRC3INT2"), |
| 1955 | ARIZONA_MUX_ROUTES("ISRC3INT3", "ISRC3INT3"), |
| 1956 | ARIZONA_MUX_ROUTES("ISRC3INT4", "ISRC3INT4"), |
| 1957 | |
| 1958 | ARIZONA_MUX_ROUTES("ISRC3DEC1", "ISRC3DEC1"), |
| 1959 | ARIZONA_MUX_ROUTES("ISRC3DEC2", "ISRC3DEC2"), |
| 1960 | ARIZONA_MUX_ROUTES("ISRC3DEC3", "ISRC3DEC3"), |
| 1961 | ARIZONA_MUX_ROUTES("ISRC3DEC4", "ISRC3DEC4"), |
| 1962 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1963 | { "AEC Loopback", "HPOUT1L", "OUT1L" }, |
| 1964 | { "AEC Loopback", "HPOUT1R", "OUT1R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1965 | { "HPOUT1L", NULL, "OUT1L" }, |
| 1966 | { "HPOUT1R", NULL, "OUT1R" }, |
| 1967 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1968 | { "AEC Loopback", "HPOUT2L", "OUT2L" }, |
| 1969 | { "AEC Loopback", "HPOUT2R", "OUT2R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1970 | { "HPOUT2L", NULL, "OUT2L" }, |
| 1971 | { "HPOUT2R", NULL, "OUT2R" }, |
| 1972 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1973 | { "AEC Loopback", "HPOUT3L", "OUT3L" }, |
| 1974 | { "AEC Loopback", "HPOUT3R", "OUT3R" }, |
Mark Brown | 35d3889 | 2012-08-26 13:50:48 -0700 | [diff] [blame] | 1975 | { "HPOUT3L", NULL, "OUT3L" }, |
Charles Keepax | 280484e | 2013-12-17 13:16:16 +0000 | [diff] [blame] | 1976 | { "HPOUT3R", NULL, "OUT3R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1977 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1978 | { "AEC Loopback", "SPKOUTL", "OUT4L" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1979 | { "SPKOUTLN", NULL, "OUT4L" }, |
| 1980 | { "SPKOUTLP", NULL, "OUT4L" }, |
| 1981 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1982 | { "AEC Loopback", "SPKOUTR", "OUT4R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1983 | { "SPKOUTRN", NULL, "OUT4R" }, |
| 1984 | { "SPKOUTRP", NULL, "OUT4R" }, |
| 1985 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1986 | { "AEC Loopback", "SPKDAT1L", "OUT5L" }, |
| 1987 | { "AEC Loopback", "SPKDAT1R", "OUT5R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1988 | { "SPKDAT1L", NULL, "OUT5L" }, |
| 1989 | { "SPKDAT1R", NULL, "OUT5R" }, |
| 1990 | |
Charles Keepax | a9c9caf | 2013-10-26 15:31:26 +0100 | [diff] [blame] | 1991 | { "AEC Loopback", "SPKDAT2L", "OUT6L" }, |
| 1992 | { "AEC Loopback", "SPKDAT2R", "OUT6R" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 1993 | { "SPKDAT2L", NULL, "OUT6L" }, |
| 1994 | { "SPKDAT2R", NULL, "OUT6R" }, |
Mark Brown | 57a10a1 | 2013-01-10 19:32:33 +0000 | [diff] [blame] | 1995 | |
Charles Keepax | d190106 | 2015-11-19 16:11:10 +0000 | [diff] [blame] | 1996 | WM5110_RXANC_INPUT_ROUTES("RXANCL", "RXANCL"), |
| 1997 | WM5110_RXANC_INPUT_ROUTES("RXANCR", "RXANCR"), |
| 1998 | |
| 1999 | WM5110_RXANC_OUTPUT_ROUTES("OUT1L", "HPOUT1L"), |
| 2000 | WM5110_RXANC_OUTPUT_ROUTES("OUT1R", "HPOUT1R"), |
| 2001 | WM5110_RXANC_OUTPUT_ROUTES("OUT2L", "HPOUT2L"), |
| 2002 | WM5110_RXANC_OUTPUT_ROUTES("OUT2R", "HPOUT2R"), |
| 2003 | WM5110_RXANC_OUTPUT_ROUTES("OUT3L", "HPOUT3L"), |
| 2004 | WM5110_RXANC_OUTPUT_ROUTES("OUT3R", "HPOUT3R"), |
| 2005 | WM5110_RXANC_OUTPUT_ROUTES("OUT4L", "SPKOUTL"), |
| 2006 | WM5110_RXANC_OUTPUT_ROUTES("OUT4R", "SPKOUTR"), |
| 2007 | WM5110_RXANC_OUTPUT_ROUTES("OUT5L", "SPKDAT1L"), |
| 2008 | WM5110_RXANC_OUTPUT_ROUTES("OUT5R", "SPKDAT1R"), |
| 2009 | WM5110_RXANC_OUTPUT_ROUTES("OUT6L", "SPKDAT2L"), |
| 2010 | WM5110_RXANC_OUTPUT_ROUTES("OUT6R", "SPKDAT2R"), |
| 2011 | |
Mark Brown | 57a10a1 | 2013-01-10 19:32:33 +0000 | [diff] [blame] | 2012 | { "MICSUPP", NULL, "SYSCLK" }, |
Charles Keepax | b63144e | 2013-07-04 08:56:28 +0100 | [diff] [blame] | 2013 | |
Charles Keepax | 9fc772e | 2016-05-13 16:45:15 +0100 | [diff] [blame] | 2014 | { "DRC1 Signal Activity", NULL, "SYSCLK" }, |
| 2015 | { "DRC2 Signal Activity", NULL, "SYSCLK" }, |
Charles Keepax | b63144e | 2013-07-04 08:56:28 +0100 | [diff] [blame] | 2016 | { "DRC1 Signal Activity", NULL, "DRC1L" }, |
| 2017 | { "DRC1 Signal Activity", NULL, "DRC1R" }, |
| 2018 | { "DRC2 Signal Activity", NULL, "DRC2L" }, |
| 2019 | { "DRC2 Signal Activity", NULL, "DRC2R" }, |
Charles Keepax | 97126ce | 2016-05-13 16:45:16 +0100 | [diff] [blame] | 2020 | |
| 2021 | { "DSP Voice Trigger", NULL, "SYSCLK" }, |
| 2022 | { "DSP Voice Trigger", NULL, "DSP3 Voice Trigger" }, |
| 2023 | { "DSP3 Voice Trigger", "Switch", "DSP3" }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2024 | }; |
| 2025 | |
| 2026 | static int wm5110_set_fll(struct snd_soc_codec *codec, int fll_id, int source, |
| 2027 | unsigned int Fref, unsigned int Fout) |
| 2028 | { |
| 2029 | struct wm5110_priv *wm5110 = snd_soc_codec_get_drvdata(codec); |
| 2030 | |
| 2031 | switch (fll_id) { |
| 2032 | case WM5110_FLL1: |
| 2033 | return arizona_set_fll(&wm5110->fll[0], source, Fref, Fout); |
| 2034 | case WM5110_FLL2: |
| 2035 | return arizona_set_fll(&wm5110->fll[1], source, Fref, Fout); |
Charles Keepax | ee929a9 | 2013-02-20 17:28:40 +0000 | [diff] [blame] | 2036 | case WM5110_FLL1_REFCLK: |
| 2037 | return arizona_set_fll_refclk(&wm5110->fll[0], source, Fref, |
| 2038 | Fout); |
| 2039 | case WM5110_FLL2_REFCLK: |
| 2040 | return arizona_set_fll_refclk(&wm5110->fll[1], source, Fref, |
| 2041 | Fout); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2042 | default: |
| 2043 | return -EINVAL; |
| 2044 | } |
| 2045 | } |
| 2046 | |
Charles Keepax | d81221f | 2016-02-04 16:29:01 +0000 | [diff] [blame] | 2047 | #define WM5110_RATES SNDRV_PCM_RATE_KNOT |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2048 | |
| 2049 | #define WM5110_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ |
| 2050 | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE) |
| 2051 | |
| 2052 | static struct snd_soc_dai_driver wm5110_dai[] = { |
| 2053 | { |
| 2054 | .name = "wm5110-aif1", |
| 2055 | .id = 1, |
| 2056 | .base = ARIZONA_AIF1_BCLK_CTRL, |
| 2057 | .playback = { |
| 2058 | .stream_name = "AIF1 Playback", |
| 2059 | .channels_min = 1, |
| 2060 | .channels_max = 8, |
| 2061 | .rates = WM5110_RATES, |
| 2062 | .formats = WM5110_FORMATS, |
| 2063 | }, |
| 2064 | .capture = { |
| 2065 | .stream_name = "AIF1 Capture", |
| 2066 | .channels_min = 1, |
| 2067 | .channels_max = 8, |
| 2068 | .rates = WM5110_RATES, |
| 2069 | .formats = WM5110_FORMATS, |
| 2070 | }, |
| 2071 | .ops = &arizona_dai_ops, |
| 2072 | .symmetric_rates = 1, |
Richard Fitzgerald | 3d02cc7 | 2014-07-22 11:50:22 +0100 | [diff] [blame] | 2073 | .symmetric_samplebits = 1, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2074 | }, |
| 2075 | { |
| 2076 | .name = "wm5110-aif2", |
| 2077 | .id = 2, |
| 2078 | .base = ARIZONA_AIF2_BCLK_CTRL, |
| 2079 | .playback = { |
| 2080 | .stream_name = "AIF2 Playback", |
| 2081 | .channels_min = 1, |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 2082 | .channels_max = 6, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2083 | .rates = WM5110_RATES, |
| 2084 | .formats = WM5110_FORMATS, |
| 2085 | }, |
| 2086 | .capture = { |
| 2087 | .stream_name = "AIF2 Capture", |
| 2088 | .channels_min = 1, |
Richard Fitzgerald | e64001e | 2013-11-20 13:17:07 +0000 | [diff] [blame] | 2089 | .channels_max = 6, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2090 | .rates = WM5110_RATES, |
| 2091 | .formats = WM5110_FORMATS, |
| 2092 | }, |
| 2093 | .ops = &arizona_dai_ops, |
| 2094 | .symmetric_rates = 1, |
Richard Fitzgerald | 3d02cc7 | 2014-07-22 11:50:22 +0100 | [diff] [blame] | 2095 | .symmetric_samplebits = 1, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2096 | }, |
| 2097 | { |
| 2098 | .name = "wm5110-aif3", |
| 2099 | .id = 3, |
| 2100 | .base = ARIZONA_AIF3_BCLK_CTRL, |
| 2101 | .playback = { |
| 2102 | .stream_name = "AIF3 Playback", |
| 2103 | .channels_min = 1, |
| 2104 | .channels_max = 2, |
| 2105 | .rates = WM5110_RATES, |
| 2106 | .formats = WM5110_FORMATS, |
| 2107 | }, |
| 2108 | .capture = { |
| 2109 | .stream_name = "AIF3 Capture", |
| 2110 | .channels_min = 1, |
| 2111 | .channels_max = 2, |
| 2112 | .rates = WM5110_RATES, |
| 2113 | .formats = WM5110_FORMATS, |
| 2114 | }, |
| 2115 | .ops = &arizona_dai_ops, |
| 2116 | .symmetric_rates = 1, |
Richard Fitzgerald | 3d02cc7 | 2014-07-22 11:50:22 +0100 | [diff] [blame] | 2117 | .symmetric_samplebits = 1, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2118 | }, |
Mark Brown | d217f90 | 2013-05-17 13:29:05 +0100 | [diff] [blame] | 2119 | { |
| 2120 | .name = "wm5110-slim1", |
| 2121 | .id = 4, |
| 2122 | .playback = { |
| 2123 | .stream_name = "Slim1 Playback", |
| 2124 | .channels_min = 1, |
| 2125 | .channels_max = 4, |
| 2126 | .rates = WM5110_RATES, |
| 2127 | .formats = WM5110_FORMATS, |
| 2128 | }, |
| 2129 | .capture = { |
| 2130 | .stream_name = "Slim1 Capture", |
| 2131 | .channels_min = 1, |
| 2132 | .channels_max = 4, |
| 2133 | .rates = WM5110_RATES, |
| 2134 | .formats = WM5110_FORMATS, |
| 2135 | }, |
| 2136 | .ops = &arizona_simple_dai_ops, |
| 2137 | }, |
| 2138 | { |
| 2139 | .name = "wm5110-slim2", |
| 2140 | .id = 5, |
| 2141 | .playback = { |
| 2142 | .stream_name = "Slim2 Playback", |
| 2143 | .channels_min = 1, |
| 2144 | .channels_max = 2, |
| 2145 | .rates = WM5110_RATES, |
| 2146 | .formats = WM5110_FORMATS, |
| 2147 | }, |
| 2148 | .capture = { |
| 2149 | .stream_name = "Slim2 Capture", |
| 2150 | .channels_min = 1, |
| 2151 | .channels_max = 2, |
| 2152 | .rates = WM5110_RATES, |
| 2153 | .formats = WM5110_FORMATS, |
| 2154 | }, |
| 2155 | .ops = &arizona_simple_dai_ops, |
| 2156 | }, |
| 2157 | { |
| 2158 | .name = "wm5110-slim3", |
| 2159 | .id = 6, |
| 2160 | .playback = { |
| 2161 | .stream_name = "Slim3 Playback", |
| 2162 | .channels_min = 1, |
| 2163 | .channels_max = 2, |
| 2164 | .rates = WM5110_RATES, |
| 2165 | .formats = WM5110_FORMATS, |
| 2166 | }, |
| 2167 | .capture = { |
| 2168 | .stream_name = "Slim3 Capture", |
| 2169 | .channels_min = 1, |
| 2170 | .channels_max = 2, |
| 2171 | .rates = WM5110_RATES, |
| 2172 | .formats = WM5110_FORMATS, |
| 2173 | }, |
| 2174 | .ops = &arizona_simple_dai_ops, |
| 2175 | }, |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 2176 | { |
| 2177 | .name = "wm5110-cpu-voicectrl", |
| 2178 | .capture = { |
| 2179 | .stream_name = "Voice Control CPU", |
| 2180 | .channels_min = 1, |
| 2181 | .channels_max = 1, |
| 2182 | .rates = WM5110_RATES, |
| 2183 | .formats = WM5110_FORMATS, |
| 2184 | }, |
| 2185 | .compress_new = snd_soc_new_compress, |
| 2186 | }, |
| 2187 | { |
| 2188 | .name = "wm5110-dsp-voicectrl", |
| 2189 | .capture = { |
| 2190 | .stream_name = "Voice Control DSP", |
| 2191 | .channels_min = 1, |
| 2192 | .channels_max = 1, |
| 2193 | .rates = WM5110_RATES, |
| 2194 | .formats = WM5110_FORMATS, |
| 2195 | }, |
| 2196 | }, |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 2197 | { |
| 2198 | .name = "wm5110-cpu-trace", |
| 2199 | .capture = { |
| 2200 | .stream_name = "Audio Trace CPU", |
| 2201 | .channels_min = 1, |
| 2202 | .channels_max = 6, |
| 2203 | .rates = WM5110_RATES, |
| 2204 | .formats = WM5110_FORMATS, |
| 2205 | }, |
| 2206 | .compress_new = snd_soc_new_compress, |
| 2207 | }, |
| 2208 | { |
| 2209 | .name = "wm5110-dsp-trace", |
| 2210 | .capture = { |
| 2211 | .stream_name = "Audio Trace DSP", |
| 2212 | .channels_min = 1, |
| 2213 | .channels_max = 6, |
| 2214 | .rates = WM5110_RATES, |
| 2215 | .formats = WM5110_FORMATS, |
| 2216 | }, |
| 2217 | }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2218 | }; |
| 2219 | |
Charles Keepax | 406abc9 | 2015-12-15 11:29:45 +0000 | [diff] [blame] | 2220 | static int wm5110_open(struct snd_compr_stream *stream) |
| 2221 | { |
| 2222 | struct snd_soc_pcm_runtime *rtd = stream->private_data; |
| 2223 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(rtd->codec); |
| 2224 | struct arizona *arizona = priv->core.arizona; |
| 2225 | int n_adsp; |
| 2226 | |
| 2227 | if (strcmp(rtd->codec_dai->name, "wm5110-dsp-voicectrl") == 0) { |
| 2228 | n_adsp = 2; |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 2229 | } else if (strcmp(rtd->codec_dai->name, "wm5110-dsp-trace") == 0) { |
| 2230 | n_adsp = 0; |
Charles Keepax | 406abc9 | 2015-12-15 11:29:45 +0000 | [diff] [blame] | 2231 | } else { |
| 2232 | dev_err(arizona->dev, |
| 2233 | "No suitable compressed stream for DAI '%s'\n", |
| 2234 | rtd->codec_dai->name); |
| 2235 | return -EINVAL; |
| 2236 | } |
| 2237 | |
| 2238 | return wm_adsp_compr_open(&priv->core.adsp[n_adsp], stream); |
| 2239 | } |
| 2240 | |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2241 | static irqreturn_t wm5110_adsp2_irq(int irq, void *data) |
| 2242 | { |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 2243 | struct wm5110_priv *priv = data; |
| 2244 | struct arizona *arizona = priv->core.arizona; |
Charles Keepax | 546ad3d | 2016-05-31 12:44:17 +0100 | [diff] [blame] | 2245 | struct arizona_voice_trigger_info info; |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 2246 | int serviced = 0; |
| 2247 | int i, ret; |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2248 | |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 2249 | for (i = 0; i < WM5110_NUM_ADSP; ++i) { |
| 2250 | ret = wm_adsp_compr_handle_irq(&priv->core.adsp[i]); |
| 2251 | if (ret != -ENODEV) |
| 2252 | serviced++; |
Charles Keepax | 546ad3d | 2016-05-31 12:44:17 +0100 | [diff] [blame] | 2253 | if (ret == WM_ADSP_COMPR_VOICE_TRIGGER) { |
| 2254 | info.core = i; |
Charles Keepax | 7baa7e2 | 2016-05-13 16:45:19 +0100 | [diff] [blame] | 2255 | arizona_call_notifiers(arizona, |
| 2256 | ARIZONA_NOTIFY_VOICE_TRIGGER, |
Charles Keepax | 546ad3d | 2016-05-31 12:44:17 +0100 | [diff] [blame] | 2257 | &info); |
| 2258 | } |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 2259 | } |
| 2260 | |
| 2261 | if (!serviced) { |
| 2262 | dev_err(arizona->dev, "Spurious compressed data IRQ\n"); |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2263 | return IRQ_NONE; |
Charles Keepax | 3188950 | 2016-01-21 17:53:00 +0000 | [diff] [blame] | 2264 | } |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2265 | |
| 2266 | return IRQ_HANDLED; |
| 2267 | } |
| 2268 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2269 | static int wm5110_codec_probe(struct snd_soc_codec *codec) |
| 2270 | { |
Lars-Peter Clausen | 72945b3 | 2015-06-01 10:10:28 +0200 | [diff] [blame] | 2271 | struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2272 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2273 | struct arizona *arizona = priv->core.arizona; |
Richard Fitzgerald | f5e2ce9 | 2015-06-11 11:32:30 +0100 | [diff] [blame] | 2274 | int i, ret; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2275 | |
Lars-Peter Clausen | 72945b3 | 2015-06-01 10:10:28 +0200 | [diff] [blame] | 2276 | priv->core.arizona->dapm = dapm; |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 2277 | |
Mark Brown | 62cc4d5 | 2013-05-20 11:28:35 -0500 | [diff] [blame] | 2278 | arizona_init_spk(codec); |
Charles Keepax | b63144e | 2013-07-04 08:56:28 +0100 | [diff] [blame] | 2279 | arizona_init_gpio(codec); |
Charles Keepax | b60f363 | 2014-06-10 18:41:02 +0100 | [diff] [blame] | 2280 | arizona_init_mono(codec); |
Charles Keepax | 2230c49 | 2016-05-13 16:45:18 +0100 | [diff] [blame] | 2281 | arizona_init_notifiers(codec); |
Mark Brown | 62cc4d5 | 2013-05-20 11:28:35 -0500 | [diff] [blame] | 2282 | |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2283 | ret = arizona_request_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, |
| 2284 | "ADSP2 Compressed IRQ", wm5110_adsp2_irq, |
| 2285 | priv); |
| 2286 | if (ret != 0) { |
| 2287 | dev_err(codec->dev, "Failed to request DSP IRQ: %d\n", ret); |
| 2288 | return ret; |
| 2289 | } |
| 2290 | |
Richard Fitzgerald | f5e2ce9 | 2015-06-11 11:32:30 +0100 | [diff] [blame] | 2291 | for (i = 0; i < WM5110_NUM_ADSP; ++i) { |
| 2292 | ret = wm_adsp2_codec_probe(&priv->core.adsp[i], codec); |
| 2293 | if (ret) |
Charles Keepax | d90c6cc | 2015-07-10 14:37:25 +0100 | [diff] [blame] | 2294 | goto err_adsp2_codec_probe; |
Richard Fitzgerald | f5e2ce9 | 2015-06-11 11:32:30 +0100 | [diff] [blame] | 2295 | } |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 2296 | |
Richard Fitzgerald | 336d044 | 2015-06-18 13:43:19 +0100 | [diff] [blame] | 2297 | ret = snd_soc_add_codec_controls(codec, |
| 2298 | arizona_adsp2_rate_controls, |
| 2299 | WM5110_NUM_ADSP); |
| 2300 | if (ret) |
Charles Keepax | d90c6cc | 2015-07-10 14:37:25 +0100 | [diff] [blame] | 2301 | goto err_adsp2_codec_probe; |
Richard Fitzgerald | 336d044 | 2015-06-18 13:43:19 +0100 | [diff] [blame] | 2302 | |
Lars-Peter Clausen | 72945b3 | 2015-06-01 10:10:28 +0200 | [diff] [blame] | 2303 | snd_soc_dapm_disable_pin(dapm, "HAPTICS"); |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 2304 | |
| 2305 | return 0; |
Charles Keepax | d90c6cc | 2015-07-10 14:37:25 +0100 | [diff] [blame] | 2306 | |
| 2307 | err_adsp2_codec_probe: |
| 2308 | for (--i; i >= 0; --i) |
| 2309 | wm_adsp2_codec_remove(&priv->core.adsp[i], codec); |
| 2310 | |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2311 | arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv); |
| 2312 | |
Charles Keepax | d90c6cc | 2015-07-10 14:37:25 +0100 | [diff] [blame] | 2313 | return ret; |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 2314 | } |
| 2315 | |
| 2316 | static int wm5110_codec_remove(struct snd_soc_codec *codec) |
| 2317 | { |
| 2318 | struct wm5110_priv *priv = snd_soc_codec_get_drvdata(codec); |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2319 | struct arizona *arizona = priv->core.arizona; |
Richard Fitzgerald | f5e2ce9 | 2015-06-11 11:32:30 +0100 | [diff] [blame] | 2320 | int i; |
| 2321 | |
| 2322 | for (i = 0; i < WM5110_NUM_ADSP; ++i) |
| 2323 | wm_adsp2_codec_remove(&priv->core.adsp[i], codec); |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 2324 | |
| 2325 | priv->core.arizona->dapm = NULL; |
| 2326 | |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2327 | arizona_free_irq(arizona, ARIZONA_IRQ_DSP_IRQ1, priv); |
| 2328 | |
Charles Keepax | 54dca70 | 2016-04-15 13:11:56 +0100 | [diff] [blame] | 2329 | arizona_free_spk(codec); |
| 2330 | |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 2331 | return 0; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2332 | } |
| 2333 | |
| 2334 | #define WM5110_DIG_VU 0x0200 |
| 2335 | |
| 2336 | static unsigned int wm5110_digital_vu[] = { |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2337 | ARIZONA_DAC_DIGITAL_VOLUME_1L, |
| 2338 | ARIZONA_DAC_DIGITAL_VOLUME_1R, |
| 2339 | ARIZONA_DAC_DIGITAL_VOLUME_2L, |
| 2340 | ARIZONA_DAC_DIGITAL_VOLUME_2R, |
| 2341 | ARIZONA_DAC_DIGITAL_VOLUME_3L, |
| 2342 | ARIZONA_DAC_DIGITAL_VOLUME_3R, |
| 2343 | ARIZONA_DAC_DIGITAL_VOLUME_4L, |
| 2344 | ARIZONA_DAC_DIGITAL_VOLUME_4R, |
| 2345 | ARIZONA_DAC_DIGITAL_VOLUME_5L, |
| 2346 | ARIZONA_DAC_DIGITAL_VOLUME_5R, |
Charles Keepax | ae60503 | 2012-09-27 13:21:48 +0100 | [diff] [blame] | 2347 | ARIZONA_DAC_DIGITAL_VOLUME_6L, |
| 2348 | ARIZONA_DAC_DIGITAL_VOLUME_6R, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2349 | }; |
| 2350 | |
Xiubo Li | 7a34b1c | 2014-04-03 07:53:59 +0800 | [diff] [blame] | 2351 | static struct regmap *wm5110_get_regmap(struct device *dev) |
Xiubo Li | 6e4842d | 2014-03-26 13:40:29 +0800 | [diff] [blame] | 2352 | { |
| 2353 | struct wm5110_priv *priv = dev_get_drvdata(dev); |
| 2354 | |
| 2355 | return priv->core.arizona->regmap; |
| 2356 | } |
| 2357 | |
Julia Lawall | f802d6c | 2016-08-31 23:52:27 +0200 | [diff] [blame] | 2358 | static const struct snd_soc_codec_driver soc_codec_dev_wm5110 = { |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2359 | .probe = wm5110_codec_probe, |
Mark Brown | 2f76e68 | 2012-11-26 21:18:18 +0000 | [diff] [blame] | 2360 | .remove = wm5110_codec_remove, |
Xiubo Li | 6e4842d | 2014-03-26 13:40:29 +0800 | [diff] [blame] | 2361 | .get_regmap = wm5110_get_regmap, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2362 | |
| 2363 | .idle_bias_off = true, |
| 2364 | |
| 2365 | .set_sysclk = arizona_set_sysclk, |
| 2366 | .set_pll = wm5110_set_fll, |
| 2367 | |
Kuninori Morimoto | 098c075 | 2016-08-08 09:29:55 +0000 | [diff] [blame] | 2368 | .component_driver = { |
| 2369 | .controls = wm5110_snd_controls, |
| 2370 | .num_controls = ARRAY_SIZE(wm5110_snd_controls), |
| 2371 | .dapm_widgets = wm5110_dapm_widgets, |
| 2372 | .num_dapm_widgets = ARRAY_SIZE(wm5110_dapm_widgets), |
| 2373 | .dapm_routes = wm5110_dapm_routes, |
| 2374 | .num_dapm_routes = ARRAY_SIZE(wm5110_dapm_routes), |
| 2375 | }, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2376 | }; |
| 2377 | |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 2378 | static struct snd_compr_ops wm5110_compr_ops = { |
Charles Keepax | 406abc9 | 2015-12-15 11:29:45 +0000 | [diff] [blame] | 2379 | .open = wm5110_open, |
| 2380 | .free = wm_adsp_compr_free, |
| 2381 | .set_params = wm_adsp_compr_set_params, |
| 2382 | .get_caps = wm_adsp_compr_get_caps, |
Charles Keepax | 95fe959 | 2015-12-15 11:29:47 +0000 | [diff] [blame] | 2383 | .trigger = wm_adsp_compr_trigger, |
Charles Keepax | 565ace4 | 2016-01-06 12:33:18 +0000 | [diff] [blame] | 2384 | .pointer = wm_adsp_compr_pointer, |
Charles Keepax | 83a40ce | 2016-01-06 12:33:19 +0000 | [diff] [blame] | 2385 | .copy = wm_adsp_compr_copy, |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 2386 | }; |
| 2387 | |
| 2388 | static struct snd_soc_platform_driver wm5110_compr_platform = { |
| 2389 | .compr_ops = &wm5110_compr_ops, |
| 2390 | }; |
| 2391 | |
Bill Pemberton | 7a79e94 | 2012-12-07 09:26:37 -0500 | [diff] [blame] | 2392 | static int wm5110_probe(struct platform_device *pdev) |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2393 | { |
| 2394 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); |
| 2395 | struct wm5110_priv *wm5110; |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 2396 | int i, ret; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2397 | |
| 2398 | wm5110 = devm_kzalloc(&pdev->dev, sizeof(struct wm5110_priv), |
| 2399 | GFP_KERNEL); |
| 2400 | if (wm5110 == NULL) |
| 2401 | return -ENOMEM; |
| 2402 | platform_set_drvdata(pdev, wm5110); |
| 2403 | |
| 2404 | wm5110->core.arizona = arizona; |
Mark Brown | ddbce97 | 2013-02-15 17:27:22 +0000 | [diff] [blame] | 2405 | wm5110->core.num_inputs = 8; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2406 | |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 2407 | for (i = 0; i < WM5110_NUM_ADSP; i++) { |
| 2408 | wm5110->core.adsp[i].part = "wm5110"; |
| 2409 | wm5110->core.adsp[i].num = i + 1; |
| 2410 | wm5110->core.adsp[i].type = WMFW_ADSP2; |
| 2411 | wm5110->core.adsp[i].dev = arizona->dev; |
| 2412 | wm5110->core.adsp[i].regmap = arizona->regmap; |
| 2413 | |
| 2414 | wm5110->core.adsp[i].base = ARIZONA_DSP1_CONTROL_1 |
| 2415 | + (0x100 * i); |
| 2416 | wm5110->core.adsp[i].mem = wm5110_dsp_regions[i]; |
| 2417 | wm5110->core.adsp[i].num_mems |
| 2418 | = ARRAY_SIZE(wm5110_dsp1_regions); |
| 2419 | |
Richard Fitzgerald | 81ac58b | 2015-06-02 11:53:34 +0100 | [diff] [blame] | 2420 | ret = wm_adsp2_init(&wm5110->core.adsp[i]); |
Mark Brown | 9a3e1b8 | 2013-11-19 16:04:01 +0000 | [diff] [blame] | 2421 | if (ret != 0) |
| 2422 | return ret; |
| 2423 | } |
| 2424 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2425 | for (i = 0; i < ARRAY_SIZE(wm5110->fll); i++) |
| 2426 | wm5110->fll[i].vco_mult = 3; |
| 2427 | |
| 2428 | arizona_init_fll(arizona, 1, ARIZONA_FLL1_CONTROL_1 - 1, |
| 2429 | ARIZONA_IRQ_FLL1_LOCK, ARIZONA_IRQ_FLL1_CLOCK_OK, |
| 2430 | &wm5110->fll[0]); |
| 2431 | arizona_init_fll(arizona, 2, ARIZONA_FLL2_CONTROL_1 - 1, |
| 2432 | ARIZONA_IRQ_FLL2_LOCK, ARIZONA_IRQ_FLL2_CLOCK_OK, |
| 2433 | &wm5110->fll[1]); |
| 2434 | |
Charles Keepax | 0da2e5b | 2013-11-19 16:04:02 +0000 | [diff] [blame] | 2435 | /* SR2 fixed at 8kHz, SR3 fixed at 16kHz */ |
| 2436 | regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_2, |
| 2437 | ARIZONA_SAMPLE_RATE_2_MASK, 0x11); |
| 2438 | regmap_update_bits(arizona->regmap, ARIZONA_SAMPLE_RATE_3, |
| 2439 | ARIZONA_SAMPLE_RATE_3_MASK, 0x12); |
| 2440 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2441 | for (i = 0; i < ARRAY_SIZE(wm5110_dai); i++) |
| 2442 | arizona_init_dai(&wm5110->core, i); |
| 2443 | |
| 2444 | /* Latch volume update bits */ |
| 2445 | for (i = 0; i < ARRAY_SIZE(wm5110_digital_vu); i++) |
| 2446 | regmap_update_bits(arizona->regmap, wm5110_digital_vu[i], |
| 2447 | WM5110_DIG_VU, WM5110_DIG_VU); |
| 2448 | |
| 2449 | pm_runtime_enable(&pdev->dev); |
| 2450 | pm_runtime_idle(&pdev->dev); |
| 2451 | |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 2452 | ret = snd_soc_register_platform(&pdev->dev, &wm5110_compr_platform); |
| 2453 | if (ret < 0) { |
| 2454 | dev_err(&pdev->dev, "Failed to register platform: %d\n", ret); |
Charles Keepax | 0f9aa09 | 2016-01-21 17:52:57 +0000 | [diff] [blame] | 2455 | return ret; |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 2456 | } |
| 2457 | |
| 2458 | ret = snd_soc_register_codec(&pdev->dev, &soc_codec_dev_wm5110, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2459 | wm5110_dai, ARRAY_SIZE(wm5110_dai)); |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 2460 | if (ret < 0) { |
| 2461 | dev_err(&pdev->dev, "Failed to register codec: %d\n", ret); |
| 2462 | snd_soc_unregister_platform(&pdev->dev); |
| 2463 | } |
| 2464 | |
Charles Keepax | 1d981e0 | 2015-12-15 11:29:42 +0000 | [diff] [blame] | 2465 | return ret; |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2466 | } |
| 2467 | |
Bill Pemberton | 7a79e94 | 2012-12-07 09:26:37 -0500 | [diff] [blame] | 2468 | static int wm5110_remove(struct platform_device *pdev) |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2469 | { |
Richard Fitzgerald | 401cf14 | 2016-04-27 14:58:28 +0100 | [diff] [blame] | 2470 | struct wm5110_priv *wm5110 = platform_get_drvdata(pdev); |
| 2471 | int i; |
| 2472 | |
Richard Fitzgerald | f5ede8d | 2016-01-21 14:41:12 +0000 | [diff] [blame] | 2473 | snd_soc_unregister_platform(&pdev->dev); |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2474 | snd_soc_unregister_codec(&pdev->dev); |
| 2475 | pm_runtime_disable(&pdev->dev); |
| 2476 | |
Richard Fitzgerald | 401cf14 | 2016-04-27 14:58:28 +0100 | [diff] [blame] | 2477 | for (i = 0; i < WM5110_NUM_ADSP; i++) |
| 2478 | wm_adsp2_remove(&wm5110->core.adsp[i]); |
| 2479 | |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2480 | return 0; |
| 2481 | } |
| 2482 | |
| 2483 | static struct platform_driver wm5110_codec_driver = { |
| 2484 | .driver = { |
| 2485 | .name = "wm5110-codec", |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2486 | }, |
| 2487 | .probe = wm5110_probe, |
Bill Pemberton | 7a79e94 | 2012-12-07 09:26:37 -0500 | [diff] [blame] | 2488 | .remove = wm5110_remove, |
Mark Brown | 5c6af63 | 2012-07-09 19:09:41 +0100 | [diff] [blame] | 2489 | }; |
| 2490 | |
| 2491 | module_platform_driver(wm5110_codec_driver); |
| 2492 | |
| 2493 | MODULE_DESCRIPTION("ASoC WM5110 driver"); |
| 2494 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
| 2495 | MODULE_LICENSE("GPL"); |
| 2496 | MODULE_ALIAS("platform:wm5110-codec"); |