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