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