1b886d83cSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
22f989f7eSM R Swami Reddy /*
32f989f7eSM R Swami Reddy * isabelle.c - Low power high fidelity audio codec driver
42f989f7eSM R Swami Reddy *
52f989f7eSM R Swami Reddy * Copyright (c) 2012 Texas Instruments, Inc
62f989f7eSM R Swami Reddy *
72f989f7eSM R Swami Reddy * Initially based on sound/soc/codecs/twl6040.c
82f989f7eSM R Swami Reddy */
92f989f7eSM R Swami Reddy #include <linux/module.h>
102f989f7eSM R Swami Reddy #include <linux/moduleparam.h>
112f989f7eSM R Swami Reddy #include <linux/kernel.h>
122f989f7eSM R Swami Reddy #include <linux/init.h>
132f989f7eSM R Swami Reddy #include <linux/delay.h>
142f989f7eSM R Swami Reddy #include <linux/pm.h>
152f989f7eSM R Swami Reddy #include <linux/regmap.h>
162f989f7eSM R Swami Reddy #include <linux/i2c.h>
172f989f7eSM R Swami Reddy #include <linux/slab.h>
182f989f7eSM R Swami Reddy #include <sound/core.h>
192f989f7eSM R Swami Reddy #include <sound/pcm.h>
202f989f7eSM R Swami Reddy #include <sound/pcm_params.h>
212f989f7eSM R Swami Reddy #include <sound/soc.h>
222f989f7eSM R Swami Reddy #include <sound/soc-dapm.h>
232f989f7eSM R Swami Reddy #include <sound/tlv.h>
242f989f7eSM R Swami Reddy #include <sound/jack.h>
252f989f7eSM R Swami Reddy #include <sound/initval.h>
262f989f7eSM R Swami Reddy #include <asm/div64.h>
272f989f7eSM R Swami Reddy #include "isabelle.h"
282f989f7eSM R Swami Reddy
292f989f7eSM R Swami Reddy
302f989f7eSM R Swami Reddy /* Register default values for ISABELLE driver. */
31c418a84aSAxel Lin static const struct reg_default isabelle_reg_defs[] = {
322f989f7eSM R Swami Reddy { 0, 0x00 },
332f989f7eSM R Swami Reddy { 1, 0x00 },
342f989f7eSM R Swami Reddy { 2, 0x00 },
352f989f7eSM R Swami Reddy { 3, 0x00 },
362f989f7eSM R Swami Reddy { 4, 0x00 },
372f989f7eSM R Swami Reddy { 5, 0x00 },
382f989f7eSM R Swami Reddy { 6, 0x00 },
392f989f7eSM R Swami Reddy { 7, 0x00 },
402f989f7eSM R Swami Reddy { 8, 0x00 },
412f989f7eSM R Swami Reddy { 9, 0x00 },
422f989f7eSM R Swami Reddy { 10, 0x00 },
432f989f7eSM R Swami Reddy { 11, 0x00 },
442f989f7eSM R Swami Reddy { 12, 0x00 },
452f989f7eSM R Swami Reddy { 13, 0x00 },
462f989f7eSM R Swami Reddy { 14, 0x00 },
472f989f7eSM R Swami Reddy { 15, 0x00 },
482f989f7eSM R Swami Reddy { 16, 0x00 },
492f989f7eSM R Swami Reddy { 17, 0x00 },
502f989f7eSM R Swami Reddy { 18, 0x00 },
512f989f7eSM R Swami Reddy { 19, 0x00 },
522f989f7eSM R Swami Reddy { 20, 0x00 },
532f989f7eSM R Swami Reddy { 21, 0x02 },
542f989f7eSM R Swami Reddy { 22, 0x02 },
552f989f7eSM R Swami Reddy { 23, 0x02 },
562f989f7eSM R Swami Reddy { 24, 0x02 },
572f989f7eSM R Swami Reddy { 25, 0x0F },
582f989f7eSM R Swami Reddy { 26, 0x8F },
592f989f7eSM R Swami Reddy { 27, 0x0F },
602f989f7eSM R Swami Reddy { 28, 0x8F },
612f989f7eSM R Swami Reddy { 29, 0x00 },
622f989f7eSM R Swami Reddy { 30, 0x00 },
632f989f7eSM R Swami Reddy { 31, 0x00 },
642f989f7eSM R Swami Reddy { 32, 0x00 },
652f989f7eSM R Swami Reddy { 33, 0x00 },
662f989f7eSM R Swami Reddy { 34, 0x00 },
672f989f7eSM R Swami Reddy { 35, 0x00 },
682f989f7eSM R Swami Reddy { 36, 0x00 },
692f989f7eSM R Swami Reddy { 37, 0x00 },
702f989f7eSM R Swami Reddy { 38, 0x00 },
712f989f7eSM R Swami Reddy { 39, 0x00 },
722f989f7eSM R Swami Reddy { 40, 0x00 },
732f989f7eSM R Swami Reddy { 41, 0x00 },
742f989f7eSM R Swami Reddy { 42, 0x00 },
752f989f7eSM R Swami Reddy { 43, 0x00 },
762f989f7eSM R Swami Reddy { 44, 0x00 },
772f989f7eSM R Swami Reddy { 45, 0x00 },
782f989f7eSM R Swami Reddy { 46, 0x00 },
792f989f7eSM R Swami Reddy { 47, 0x00 },
802f989f7eSM R Swami Reddy { 48, 0x00 },
812f989f7eSM R Swami Reddy { 49, 0x00 },
822f989f7eSM R Swami Reddy { 50, 0x00 },
832f989f7eSM R Swami Reddy { 51, 0x00 },
842f989f7eSM R Swami Reddy { 52, 0x00 },
852f989f7eSM R Swami Reddy { 53, 0x00 },
862f989f7eSM R Swami Reddy { 54, 0x00 },
872f989f7eSM R Swami Reddy { 55, 0x00 },
882f989f7eSM R Swami Reddy { 56, 0x00 },
892f989f7eSM R Swami Reddy { 57, 0x00 },
902f989f7eSM R Swami Reddy { 58, 0x00 },
912f989f7eSM R Swami Reddy { 59, 0x00 },
922f989f7eSM R Swami Reddy { 60, 0x00 },
932f989f7eSM R Swami Reddy { 61, 0x00 },
942f989f7eSM R Swami Reddy { 62, 0x00 },
952f989f7eSM R Swami Reddy { 63, 0x00 },
962f989f7eSM R Swami Reddy { 64, 0x00 },
972f989f7eSM R Swami Reddy { 65, 0x00 },
982f989f7eSM R Swami Reddy { 66, 0x00 },
992f989f7eSM R Swami Reddy { 67, 0x00 },
1002f989f7eSM R Swami Reddy { 68, 0x00 },
1012f989f7eSM R Swami Reddy { 69, 0x90 },
1022f989f7eSM R Swami Reddy { 70, 0x90 },
1032f989f7eSM R Swami Reddy { 71, 0x90 },
1042f989f7eSM R Swami Reddy { 72, 0x00 },
1052f989f7eSM R Swami Reddy { 73, 0x00 },
1062f989f7eSM R Swami Reddy { 74, 0x00 },
1072f989f7eSM R Swami Reddy { 75, 0x00 },
1082f989f7eSM R Swami Reddy { 76, 0x00 },
1092f989f7eSM R Swami Reddy { 77, 0x00 },
1102f989f7eSM R Swami Reddy { 78, 0x00 },
1112f989f7eSM R Swami Reddy { 79, 0x00 },
1122f989f7eSM R Swami Reddy { 80, 0x00 },
1132f989f7eSM R Swami Reddy { 81, 0x00 },
1142f989f7eSM R Swami Reddy { 82, 0x00 },
1152f989f7eSM R Swami Reddy { 83, 0x00 },
1162f989f7eSM R Swami Reddy { 84, 0x00 },
1172f989f7eSM R Swami Reddy { 85, 0x07 },
1182f989f7eSM R Swami Reddy { 86, 0x00 },
1192f989f7eSM R Swami Reddy { 87, 0x00 },
1202f989f7eSM R Swami Reddy { 88, 0x00 },
1212f989f7eSM R Swami Reddy { 89, 0x07 },
1222f989f7eSM R Swami Reddy { 90, 0x80 },
1232f989f7eSM R Swami Reddy { 91, 0x07 },
1242f989f7eSM R Swami Reddy { 92, 0x07 },
1252f989f7eSM R Swami Reddy { 93, 0x00 },
1262f989f7eSM R Swami Reddy { 94, 0x00 },
1272f989f7eSM R Swami Reddy { 95, 0x00 },
1282f989f7eSM R Swami Reddy { 96, 0x00 },
1292f989f7eSM R Swami Reddy { 97, 0x00 },
1302f989f7eSM R Swami Reddy { 98, 0x00 },
1312f989f7eSM R Swami Reddy { 99, 0x00 },
1322f989f7eSM R Swami Reddy };
1332f989f7eSM R Swami Reddy
1342f989f7eSM R Swami Reddy static const char *isabelle_rx1_texts[] = {"VRX1", "ARX1"};
1352f989f7eSM R Swami Reddy static const char *isabelle_rx2_texts[] = {"VRX2", "ARX2"};
1362f989f7eSM R Swami Reddy
1372f989f7eSM R Swami Reddy static const struct soc_enum isabelle_rx1_enum[] = {
138cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3,
139cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts),
140cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5,
141cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts),
1422f989f7eSM R Swami Reddy };
1432f989f7eSM R Swami Reddy
1442f989f7eSM R Swami Reddy static const struct soc_enum isabelle_rx2_enum[] = {
145cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2,
146cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts),
147cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4,
148cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts),
1492f989f7eSM R Swami Reddy };
1502f989f7eSM R Swami Reddy
1512f989f7eSM R Swami Reddy /* Headset DAC playback switches */
1522f989f7eSM R Swami Reddy static const struct snd_kcontrol_new rx1_mux_controls =
1532f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_rx1_enum);
1542f989f7eSM R Swami Reddy
1552f989f7eSM R Swami Reddy static const struct snd_kcontrol_new rx2_mux_controls =
1562f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_rx2_enum);
1572f989f7eSM R Swami Reddy
1582f989f7eSM R Swami Reddy /* TX input selection */
1592f989f7eSM R Swami Reddy static const char *isabelle_atx_texts[] = {"AMIC1", "DMIC"};
1602f989f7eSM R Swami Reddy static const char *isabelle_vtx_texts[] = {"AMIC2", "DMIC"};
1612f989f7eSM R Swami Reddy
1622f989f7eSM R Swami Reddy static const struct soc_enum isabelle_atx_enum[] = {
163cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7,
164cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts),
165cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0,
166cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts),
1672f989f7eSM R Swami Reddy };
1682f989f7eSM R Swami Reddy
1692f989f7eSM R Swami Reddy static const struct soc_enum isabelle_vtx_enum[] = {
170cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6,
171cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts),
172cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0,
173cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts),
1742f989f7eSM R Swami Reddy };
1752f989f7eSM R Swami Reddy
1762f989f7eSM R Swami Reddy static const struct snd_kcontrol_new atx_mux_controls =
1772f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_atx_enum);
1782f989f7eSM R Swami Reddy
1792f989f7eSM R Swami Reddy static const struct snd_kcontrol_new vtx_mux_controls =
1802f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_vtx_enum);
1812f989f7eSM R Swami Reddy
1822f989f7eSM R Swami Reddy /* Left analog microphone selection */
1832f989f7eSM R Swami Reddy static const char *isabelle_amic1_texts[] = {
1842f989f7eSM R Swami Reddy "Main Mic", "Headset Mic", "Aux/FM Left"};
1852f989f7eSM R Swami Reddy
1862f989f7eSM R Swami Reddy /* Left analog microphone selection */
1872f989f7eSM R Swami Reddy static const char *isabelle_amic2_texts[] = {"Sub Mic", "Aux/FM Right"};
1882f989f7eSM R Swami Reddy
189cdbb4925STakashi Iwai static SOC_ENUM_SINGLE_DECL(isabelle_amic1_enum,
190cdbb4925STakashi Iwai ISABELLE_AMIC_CFG_REG, 5,
191cdbb4925STakashi Iwai isabelle_amic1_texts);
1922f989f7eSM R Swami Reddy
193cdbb4925STakashi Iwai static SOC_ENUM_SINGLE_DECL(isabelle_amic2_enum,
194cdbb4925STakashi Iwai ISABELLE_AMIC_CFG_REG, 4,
195cdbb4925STakashi Iwai isabelle_amic2_texts);
1962f989f7eSM R Swami Reddy
1972f989f7eSM R Swami Reddy static const struct snd_kcontrol_new amic1_control =
1982f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_amic1_enum);
1992f989f7eSM R Swami Reddy
2002f989f7eSM R Swami Reddy static const struct snd_kcontrol_new amic2_control =
2012f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_amic2_enum);
2022f989f7eSM R Swami Reddy
2032f989f7eSM R Swami Reddy static const char *isabelle_st_audio_texts[] = {"ATX1", "ATX2"};
2042f989f7eSM R Swami Reddy
2052f989f7eSM R Swami Reddy static const char *isabelle_st_voice_texts[] = {"VTX1", "VTX2"};
2062f989f7eSM R Swami Reddy
2072f989f7eSM R Swami Reddy static const struct soc_enum isabelle_st_audio_enum[] = {
208cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7,
209cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_st_audio_texts),
2102f989f7eSM R Swami Reddy isabelle_st_audio_texts),
211cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7,
212cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_st_audio_texts),
2132f989f7eSM R Swami Reddy isabelle_st_audio_texts),
2142f989f7eSM R Swami Reddy };
2152f989f7eSM R Swami Reddy
2162f989f7eSM R Swami Reddy static const struct soc_enum isabelle_st_voice_enum[] = {
217cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7,
218cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_st_voice_texts),
2192f989f7eSM R Swami Reddy isabelle_st_voice_texts),
220cdbb4925STakashi Iwai SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7,
221cdbb4925STakashi Iwai ARRAY_SIZE(isabelle_st_voice_texts),
2222f989f7eSM R Swami Reddy isabelle_st_voice_texts),
2232f989f7eSM R Swami Reddy };
2242f989f7eSM R Swami Reddy
2252f989f7eSM R Swami Reddy static const struct snd_kcontrol_new st_audio_control =
2262f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_st_audio_enum);
2272f989f7eSM R Swami Reddy
2282f989f7eSM R Swami Reddy static const struct snd_kcontrol_new st_voice_control =
2292f989f7eSM R Swami Reddy SOC_DAPM_ENUM("Route", isabelle_st_voice_enum);
2302f989f7eSM R Swami Reddy
2312f989f7eSM R Swami Reddy /* Mixer controls */
2322f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hs_left_mixer_controls[] = {
2332f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC1L Playback Switch", ISABELLE_HSDRV_CFG1_REG, 7, 1, 0),
2342f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 6, 1, 0),
2352f989f7eSM R Swami Reddy };
2362f989f7eSM R Swami Reddy
2372f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hs_right_mixer_controls[] = {
2382f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC1R Playback Switch", ISABELLE_HSDRV_CFG1_REG, 5, 1, 0),
2392f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 4, 1, 0),
2402f989f7eSM R Swami Reddy };
2412f989f7eSM R Swami Reddy
2422f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hf_left_mixer_controls[] = {
2432f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_HFLPGA_CFG_REG, 7, 1, 0),
2442f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HFLPGA_CFG_REG, 6, 1, 0),
2452f989f7eSM R Swami Reddy };
2462f989f7eSM R Swami Reddy
2472f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hf_right_mixer_controls[] = {
2482f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC2R Playback Switch", ISABELLE_HFRPGA_CFG_REG, 7, 1, 0),
2492f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HFRPGA_CFG_REG, 6, 1, 0),
2502f989f7eSM R Swami Reddy };
2512f989f7eSM R Swami Reddy
2522f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_ep_mixer_controls[] = {
2532f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_EARDRV_CFG1_REG, 7, 1, 0),
2542f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_EARDRV_CFG1_REG, 6, 1, 0),
2552f989f7eSM R Swami Reddy };
2562f989f7eSM R Swami Reddy
2572f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_aux_left_mixer_controls[] = {
2582f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC3L Playback Switch", ISABELLE_LINEAMP_CFG_REG, 7, 1, 0),
2592f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 6, 1, 0),
2602f989f7eSM R Swami Reddy };
2612f989f7eSM R Swami Reddy
2622f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_aux_right_mixer_controls[] = {
2632f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC3R Playback Switch", ISABELLE_LINEAMP_CFG_REG, 5, 1, 0),
2642f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 4, 1, 0),
2652f989f7eSM R Swami Reddy };
2662f989f7eSM R Swami Reddy
2672f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga1_left_mixer_controls[] = {
2682f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 7, 1, 0),
2692f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 6, 1, 0),
2702f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 5, 1, 0),
2712f989f7eSM R Swami Reddy };
2722f989f7eSM R Swami Reddy
2732f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga1_right_mixer_controls[] = {
2742f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 3, 1, 0),
2752f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 2, 1, 0),
2762f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 1, 1, 0),
2772f989f7eSM R Swami Reddy };
2782f989f7eSM R Swami Reddy
2792f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga2_left_mixer_controls[] = {
2802f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 7, 1, 0),
2812f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 6, 1, 0),
2822f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 5, 1, 0),
2832f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 4, 1, 0),
2842f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 3, 1, 0),
2852f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 2, 1, 0),
2862f989f7eSM R Swami Reddy };
2872f989f7eSM R Swami Reddy
2882f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga2_right_mixer_controls[] = {
2892f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("USNC Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 7, 1, 0),
2902f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 3, 1, 0),
2912f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 2, 1, 0),
2922f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 1, 1, 0),
2932f989f7eSM R Swami Reddy };
2942f989f7eSM R Swami Reddy
2952f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga3_left_mixer_controls[] = {
2962f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 7, 1, 0),
2972f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 6, 1, 0),
2982f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 5, 1, 0),
2992f989f7eSM R Swami Reddy };
3002f989f7eSM R Swami Reddy
3012f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga3_right_mixer_controls[] = {
3022f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 3, 1, 0),
3032f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 2, 1, 0),
3042f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 1, 1, 0),
3052f989f7eSM R Swami Reddy };
3062f989f7eSM R Swami Reddy
3072f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx1_mixer_controls[] = {
3082f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 7, 1, 0),
3092f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 6, 1, 0),
3102f989f7eSM R Swami Reddy };
3112f989f7eSM R Swami Reddy
3122f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx2_mixer_controls[] = {
3132f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 5, 1, 0),
3142f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 4, 1, 0),
3152f989f7eSM R Swami Reddy };
3162f989f7eSM R Swami Reddy
3172f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx3_mixer_controls[] = {
3182f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 3, 1, 0),
3192f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL3 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 2, 1, 0),
3202f989f7eSM R Swami Reddy };
3212f989f7eSM R Swami Reddy
3222f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx4_mixer_controls[] = {
3232f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 1, 1, 0),
3242f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL4 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 0, 1, 0),
3252f989f7eSM R Swami Reddy };
3262f989f7eSM R Swami Reddy
3272f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx5_mixer_controls[] = {
3282f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 7, 1, 0),
3292f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL5 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 6, 1, 0),
3302f989f7eSM R Swami Reddy };
3312f989f7eSM R Swami Reddy
3322f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx6_mixer_controls[] = {
3332f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 5, 1, 0),
3342f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL6 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 4, 1, 0),
3352f989f7eSM R Swami Reddy };
3362f989f7eSM R Swami Reddy
3372f989f7eSM R Swami Reddy static const struct snd_kcontrol_new ep_path_enable_control =
3382f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("Switch", ISABELLE_EARDRV_CFG2_REG, 0, 1, 0);
3392f989f7eSM R Swami Reddy
3402f989f7eSM R Swami Reddy /* TLV Declarations */
3412f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(mic_amp_tlv, 0, 100, 0);
3422f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(afm_amp_tlv, -3300, 300, 0);
3432f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(dac_tlv, -1200, 200, 0);
3442f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(hf_tlv, -5000, 200, 0);
3452f989f7eSM R Swami Reddy
3462f989f7eSM R Swami Reddy /* from -63 to 0 dB in 1 dB steps */
3472f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(dpga_tlv, -6300, 100, 1);
3482f989f7eSM R Swami Reddy
3492f989f7eSM R Swami Reddy /* from -63 to 9 dB in 1 dB steps */
3502f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(rx_tlv, -6300, 100, 1);
3512f989f7eSM R Swami Reddy
3522f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(st_tlv, -2700, 300, 1);
3532f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(tx_tlv, -600, 100, 0);
3542f989f7eSM R Swami Reddy
3552f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_snd_controls[] = {
3562f989f7eSM R Swami Reddy SOC_DOUBLE_TLV("Headset Playback Volume", ISABELLE_HSDRV_GAIN_REG,
3572f989f7eSM R Swami Reddy 4, 0, 0xF, 0, dac_tlv),
3582f989f7eSM R Swami Reddy SOC_DOUBLE_R_TLV("Handsfree Playback Volume",
3592f989f7eSM R Swami Reddy ISABELLE_HFLPGA_CFG_REG, ISABELLE_HFRPGA_CFG_REG,
3602f989f7eSM R Swami Reddy 0, 0x1F, 0, hf_tlv),
3612f989f7eSM R Swami Reddy SOC_DOUBLE_TLV("Aux Playback Volume", ISABELLE_LINEAMP_GAIN_REG,
3622f989f7eSM R Swami Reddy 4, 0, 0xF, 0, dac_tlv),
3632f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Earpiece Playback Volume", ISABELLE_EARDRV_CFG1_REG,
3642f989f7eSM R Swami Reddy 0, 0xF, 0, dac_tlv),
3652f989f7eSM R Swami Reddy
3662f989f7eSM R Swami Reddy SOC_DOUBLE_TLV("Aux FM Volume", ISABELLE_APGA_GAIN_REG, 4, 0, 0xF, 0,
3672f989f7eSM R Swami Reddy afm_amp_tlv),
3682f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Mic1 Capture Volume", ISABELLE_MIC1_GAIN_REG, 3, 0x1F,
3692f989f7eSM R Swami Reddy 0, mic_amp_tlv),
3702f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Mic2 Capture Volume", ISABELLE_MIC2_GAIN_REG, 3, 0x1F,
3712f989f7eSM R Swami Reddy 0, mic_amp_tlv),
3722f989f7eSM R Swami Reddy
3732f989f7eSM R Swami Reddy SOC_DOUBLE_R_TLV("DPGA1 Volume", ISABELLE_DPGA1L_GAIN_REG,
3742f989f7eSM R Swami Reddy ISABELLE_DPGA1R_GAIN_REG, 0, 0x3F, 0, dpga_tlv),
3752f989f7eSM R Swami Reddy SOC_DOUBLE_R_TLV("DPGA2 Volume", ISABELLE_DPGA2L_GAIN_REG,
3762f989f7eSM R Swami Reddy ISABELLE_DPGA2R_GAIN_REG, 0, 0x3F, 0, dpga_tlv),
3772f989f7eSM R Swami Reddy SOC_DOUBLE_R_TLV("DPGA3 Volume", ISABELLE_DPGA3L_GAIN_REG,
3782f989f7eSM R Swami Reddy ISABELLE_DPGA3R_GAIN_REG, 0, 0x3F, 0, dpga_tlv),
3792f989f7eSM R Swami Reddy
3802f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Sidetone Audio TX1 Volume",
3812f989f7eSM R Swami Reddy ISABELLE_ATX_STPGA1_CFG_REG, 0, 0xF, 0, st_tlv),
3822f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Sidetone Audio TX2 Volume",
3832f989f7eSM R Swami Reddy ISABELLE_ATX_STPGA2_CFG_REG, 0, 0xF, 0, st_tlv),
3842f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Sidetone Voice TX1 Volume",
3852f989f7eSM R Swami Reddy ISABELLE_VTX_STPGA1_CFG_REG, 0, 0xF, 0, st_tlv),
3862f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Sidetone Voice TX2 Volume",
3872f989f7eSM R Swami Reddy ISABELLE_VTX2_STPGA2_CFG_REG, 0, 0xF, 0, st_tlv),
3882f989f7eSM R Swami Reddy
3892f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Audio TX1 Volume", ISABELLE_ATX1_DPGA_REG, 4, 0xF, 0,
3902f989f7eSM R Swami Reddy tx_tlv),
3912f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Audio TX2 Volume", ISABELLE_ATX2_DPGA_REG, 4, 0xF, 0,
3922f989f7eSM R Swami Reddy tx_tlv),
3932f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Voice TX1 Volume", ISABELLE_VTX1_DPGA_REG, 4, 0xF, 0,
3942f989f7eSM R Swami Reddy tx_tlv),
3952f989f7eSM R Swami Reddy SOC_SINGLE_TLV("Voice TX2 Volume", ISABELLE_VTX2_DPGA_REG, 4, 0xF, 0,
3962f989f7eSM R Swami Reddy tx_tlv),
3972f989f7eSM R Swami Reddy
3982f989f7eSM R Swami Reddy SOC_SINGLE_TLV("RX1 DPGA Volume", ISABELLE_RX1_DPGA_REG, 0, 0x3F, 0,
3992f989f7eSM R Swami Reddy rx_tlv),
4002f989f7eSM R Swami Reddy SOC_SINGLE_TLV("RX2 DPGA Volume", ISABELLE_RX2_DPGA_REG, 0, 0x3F, 0,
4012f989f7eSM R Swami Reddy rx_tlv),
4022f989f7eSM R Swami Reddy SOC_SINGLE_TLV("RX3 DPGA Volume", ISABELLE_RX3_DPGA_REG, 0, 0x3F, 0,
4032f989f7eSM R Swami Reddy rx_tlv),
4042f989f7eSM R Swami Reddy SOC_SINGLE_TLV("RX4 DPGA Volume", ISABELLE_RX4_DPGA_REG, 0, 0x3F, 0,
4052f989f7eSM R Swami Reddy rx_tlv),
4062f989f7eSM R Swami Reddy SOC_SINGLE_TLV("RX5 DPGA Volume", ISABELLE_RX5_DPGA_REG, 0, 0x3F, 0,
4072f989f7eSM R Swami Reddy rx_tlv),
4082f989f7eSM R Swami Reddy SOC_SINGLE_TLV("RX6 DPGA Volume", ISABELLE_RX6_DPGA_REG, 0, 0x3F, 0,
4092f989f7eSM R Swami Reddy rx_tlv),
4102f989f7eSM R Swami Reddy
4112f989f7eSM R Swami Reddy SOC_SINGLE("Headset Noise Gate", ISABELLE_HS_NG_CFG1_REG, 7, 1, 0),
4122f989f7eSM R Swami Reddy SOC_SINGLE("Handsfree Noise Gate", ISABELLE_HF_NG_CFG1_REG, 7, 1, 0),
4132f989f7eSM R Swami Reddy
4142f989f7eSM R Swami Reddy SOC_SINGLE("ATX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4152f989f7eSM R Swami Reddy 7, 1, 0),
4162f989f7eSM R Swami Reddy SOC_SINGLE("ATX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4172f989f7eSM R Swami Reddy 6, 1, 0),
4182f989f7eSM R Swami Reddy SOC_SINGLE("ARX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4192f989f7eSM R Swami Reddy 5, 1, 0),
4202f989f7eSM R Swami Reddy SOC_SINGLE("ARX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4212f989f7eSM R Swami Reddy 4, 1, 0),
4222f989f7eSM R Swami Reddy SOC_SINGLE("ARX3 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4232f989f7eSM R Swami Reddy 3, 1, 0),
4242f989f7eSM R Swami Reddy SOC_SINGLE("ARX4 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4252f989f7eSM R Swami Reddy 2, 1, 0),
4262f989f7eSM R Swami Reddy SOC_SINGLE("ARX5 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4272f989f7eSM R Swami Reddy 1, 1, 0),
4282f989f7eSM R Swami Reddy SOC_SINGLE("ARX6 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4292f989f7eSM R Swami Reddy 0, 1, 0),
4302f989f7eSM R Swami Reddy SOC_SINGLE("VRX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4312f989f7eSM R Swami Reddy 3, 1, 0),
4322f989f7eSM R Swami Reddy SOC_SINGLE("VRX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4332f989f7eSM R Swami Reddy 2, 1, 0),
4342f989f7eSM R Swami Reddy
4352f989f7eSM R Swami Reddy SOC_SINGLE("ATX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4362f989f7eSM R Swami Reddy 7, 1, 0),
4372f989f7eSM R Swami Reddy SOC_SINGLE("ATX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4382f989f7eSM R Swami Reddy 6, 1, 0),
4392f989f7eSM R Swami Reddy SOC_SINGLE("VTX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4402f989f7eSM R Swami Reddy 5, 1, 0),
4412f989f7eSM R Swami Reddy SOC_SINGLE("VTX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4422f989f7eSM R Swami Reddy 4, 1, 0),
4432f989f7eSM R Swami Reddy SOC_SINGLE("RX1 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4442f989f7eSM R Swami Reddy 5, 1, 0),
4452f989f7eSM R Swami Reddy SOC_SINGLE("RX2 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4462f989f7eSM R Swami Reddy 4, 1, 0),
4472f989f7eSM R Swami Reddy SOC_SINGLE("RX3 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4482f989f7eSM R Swami Reddy 3, 1, 0),
4492f989f7eSM R Swami Reddy SOC_SINGLE("RX4 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4502f989f7eSM R Swami Reddy 2, 1, 0),
4512f989f7eSM R Swami Reddy SOC_SINGLE("RX5 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4522f989f7eSM R Swami Reddy 1, 1, 0),
4532f989f7eSM R Swami Reddy SOC_SINGLE("RX6 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4542f989f7eSM R Swami Reddy 0, 1, 0),
4552f989f7eSM R Swami Reddy
4562f989f7eSM R Swami Reddy SOC_SINGLE("ULATX12 Capture Switch", ISABELLE_ULATX12_INTF_CFG_REG,
4572f989f7eSM R Swami Reddy 7, 1, 0),
4582f989f7eSM R Swami Reddy
4592f989f7eSM R Swami Reddy SOC_SINGLE("DL12 Playback Switch", ISABELLE_DL12_INTF_CFG_REG,
4602f989f7eSM R Swami Reddy 7, 1, 0),
4612f989f7eSM R Swami Reddy SOC_SINGLE("DL34 Playback Switch", ISABELLE_DL34_INTF_CFG_REG,
4622f989f7eSM R Swami Reddy 7, 1, 0),
4632f989f7eSM R Swami Reddy SOC_SINGLE("DL56 Playback Switch", ISABELLE_DL56_INTF_CFG_REG,
4642f989f7eSM R Swami Reddy 7, 1, 0),
4652f989f7eSM R Swami Reddy
4662f989f7eSM R Swami Reddy /* DMIC Switch */
4672f989f7eSM R Swami Reddy SOC_SINGLE("DMIC Switch", ISABELLE_DMIC_CFG_REG, 0, 1, 0),
4682f989f7eSM R Swami Reddy };
4692f989f7eSM R Swami Reddy
4702f989f7eSM R Swami Reddy static const struct snd_soc_dapm_widget isabelle_dapm_widgets[] = {
4712f989f7eSM R Swami Reddy /* Inputs */
4722f989f7eSM R Swami Reddy SND_SOC_DAPM_INPUT("MAINMIC"),
4732f989f7eSM R Swami Reddy SND_SOC_DAPM_INPUT("HSMIC"),
4742f989f7eSM R Swami Reddy SND_SOC_DAPM_INPUT("SUBMIC"),
4752f989f7eSM R Swami Reddy SND_SOC_DAPM_INPUT("LINEIN1"),
4762f989f7eSM R Swami Reddy SND_SOC_DAPM_INPUT("LINEIN2"),
4772f989f7eSM R Swami Reddy SND_SOC_DAPM_INPUT("DMICDAT"),
4782f989f7eSM R Swami Reddy
4792f989f7eSM R Swami Reddy /* Outputs */
4802f989f7eSM R Swami Reddy SND_SOC_DAPM_OUTPUT("HSOL"),
4812f989f7eSM R Swami Reddy SND_SOC_DAPM_OUTPUT("HSOR"),
4822f989f7eSM R Swami Reddy SND_SOC_DAPM_OUTPUT("HFL"),
4832f989f7eSM R Swami Reddy SND_SOC_DAPM_OUTPUT("HFR"),
4842f989f7eSM R Swami Reddy SND_SOC_DAPM_OUTPUT("EP"),
4852f989f7eSM R Swami Reddy SND_SOC_DAPM_OUTPUT("LINEOUT1"),
4862f989f7eSM R Swami Reddy SND_SOC_DAPM_OUTPUT("LINEOUT2"),
4872f989f7eSM R Swami Reddy
4882f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DL1", SND_SOC_NOPM, 0, 0, NULL, 0),
4892f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DL2", SND_SOC_NOPM, 0, 0, NULL, 0),
4902f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DL3", SND_SOC_NOPM, 0, 0, NULL, 0),
4912f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DL4", SND_SOC_NOPM, 0, 0, NULL, 0),
4922f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DL5", SND_SOC_NOPM, 0, 0, NULL, 0),
4932f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DL6", SND_SOC_NOPM, 0, 0, NULL, 0),
4942f989f7eSM R Swami Reddy
4952f989f7eSM R Swami Reddy /* Analog input muxes for the capture amplifiers */
4962f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("Analog Left Capture Route",
4972f989f7eSM R Swami Reddy SND_SOC_NOPM, 0, 0, &amic1_control),
4982f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("Analog Right Capture Route",
4992f989f7eSM R Swami Reddy SND_SOC_NOPM, 0, 0, &amic2_control),
5002f989f7eSM R Swami Reddy
5012f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("Sidetone Audio Playback", SND_SOC_NOPM, 0, 0,
5022f989f7eSM R Swami Reddy &st_audio_control),
5032f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("Sidetone Voice Playback", SND_SOC_NOPM, 0, 0,
5042f989f7eSM R Swami Reddy &st_voice_control),
5052f989f7eSM R Swami Reddy
5062f989f7eSM R Swami Reddy /* AIF */
5072f989f7eSM R Swami Reddy SND_SOC_DAPM_AIF_IN("INTF1_SDI", NULL, 0, ISABELLE_INTF_EN_REG, 7, 0),
5082f989f7eSM R Swami Reddy SND_SOC_DAPM_AIF_IN("INTF2_SDI", NULL, 0, ISABELLE_INTF_EN_REG, 6, 0),
5092f989f7eSM R Swami Reddy
5102f989f7eSM R Swami Reddy SND_SOC_DAPM_AIF_OUT("INTF1_SDO", NULL, 0, ISABELLE_INTF_EN_REG, 5, 0),
5112f989f7eSM R Swami Reddy SND_SOC_DAPM_AIF_OUT("INTF2_SDO", NULL, 0, ISABELLE_INTF_EN_REG, 4, 0),
5122f989f7eSM R Swami Reddy
5132f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("ULATX1", SND_SOC_NOPM, 0, 0, NULL, 0),
5142f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("ULATX2", SND_SOC_NOPM, 0, 0, NULL, 0),
5152f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("ULVTX1", SND_SOC_NOPM, 0, 0, NULL, 0),
5162f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("ULVTX2", SND_SOC_NOPM, 0, 0, NULL, 0),
5172f989f7eSM R Swami Reddy
5182f989f7eSM R Swami Reddy /* Analog Capture PGAs */
5192f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("MicAmp1", ISABELLE_AMIC_CFG_REG, 5, 0, NULL, 0),
5202f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("MicAmp2", ISABELLE_AMIC_CFG_REG, 4, 0, NULL, 0),
5212f989f7eSM R Swami Reddy
5222f989f7eSM R Swami Reddy /* Auxiliary FM PGAs */
5232f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("APGA1", ISABELLE_APGA_CFG_REG, 7, 0, NULL, 0),
5242f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("APGA2", ISABELLE_APGA_CFG_REG, 6, 0, NULL, 0),
5252f989f7eSM R Swami Reddy
5262f989f7eSM R Swami Reddy /* ADCs */
5272f989f7eSM R Swami Reddy SND_SOC_DAPM_ADC("ADC1", "Left Front Capture",
5282f989f7eSM R Swami Reddy ISABELLE_AMIC_CFG_REG, 7, 0),
5292f989f7eSM R Swami Reddy SND_SOC_DAPM_ADC("ADC2", "Right Front Capture",
5302f989f7eSM R Swami Reddy ISABELLE_AMIC_CFG_REG, 6, 0),
5312f989f7eSM R Swami Reddy
5322f989f7eSM R Swami Reddy /* Microphone Bias */
5332f989f7eSM R Swami Reddy SND_SOC_DAPM_SUPPLY("Headset Mic Bias", ISABELLE_ABIAS_CFG_REG,
5342f989f7eSM R Swami Reddy 3, 0, NULL, 0),
5352f989f7eSM R Swami Reddy SND_SOC_DAPM_SUPPLY("Main Mic Bias", ISABELLE_ABIAS_CFG_REG,
5362f989f7eSM R Swami Reddy 2, 0, NULL, 0),
5372f989f7eSM R Swami Reddy SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias",
5382f989f7eSM R Swami Reddy ISABELLE_DBIAS_CFG_REG, 3, 0, NULL, 0),
5392f989f7eSM R Swami Reddy SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias",
5402f989f7eSM R Swami Reddy ISABELLE_DBIAS_CFG_REG, 2, 0, NULL, 0),
5412f989f7eSM R Swami Reddy
5422f989f7eSM R Swami Reddy /* Mixers */
5432f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("Headset Left Mixer", SND_SOC_NOPM, 0, 0,
5442f989f7eSM R Swami Reddy isabelle_hs_left_mixer_controls,
5452f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_hs_left_mixer_controls)),
5462f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("Headset Right Mixer", SND_SOC_NOPM, 0, 0,
5472f989f7eSM R Swami Reddy isabelle_hs_right_mixer_controls,
5482f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_hs_right_mixer_controls)),
5492f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("Handsfree Left Mixer", SND_SOC_NOPM, 0, 0,
5502f989f7eSM R Swami Reddy isabelle_hf_left_mixer_controls,
5512f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_hf_left_mixer_controls)),
5522f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("Handsfree Right Mixer", SND_SOC_NOPM, 0, 0,
5532f989f7eSM R Swami Reddy isabelle_hf_right_mixer_controls,
5542f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_hf_right_mixer_controls)),
5552f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("LINEOUT1 Mixer", SND_SOC_NOPM, 0, 0,
5562f989f7eSM R Swami Reddy isabelle_aux_left_mixer_controls,
5572f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_aux_left_mixer_controls)),
5582f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("LINEOUT2 Mixer", SND_SOC_NOPM, 0, 0,
5592f989f7eSM R Swami Reddy isabelle_aux_right_mixer_controls,
5602f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_aux_right_mixer_controls)),
5612f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("Earphone Mixer", SND_SOC_NOPM, 0, 0,
5622f989f7eSM R Swami Reddy isabelle_ep_mixer_controls,
5632f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_ep_mixer_controls)),
5642f989f7eSM R Swami Reddy
5652f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("DPGA1L Mixer", SND_SOC_NOPM, 0, 0,
5662f989f7eSM R Swami Reddy isabelle_dpga1_left_mixer_controls,
5672f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_dpga1_left_mixer_controls)),
5682f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("DPGA1R Mixer", SND_SOC_NOPM, 0, 0,
5692f989f7eSM R Swami Reddy isabelle_dpga1_right_mixer_controls,
5702f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_dpga1_right_mixer_controls)),
5712f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("DPGA2L Mixer", SND_SOC_NOPM, 0, 0,
5722f989f7eSM R Swami Reddy isabelle_dpga2_left_mixer_controls,
5732f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_dpga2_left_mixer_controls)),
5742f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("DPGA2R Mixer", SND_SOC_NOPM, 0, 0,
5752f989f7eSM R Swami Reddy isabelle_dpga2_right_mixer_controls,
5762f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_dpga2_right_mixer_controls)),
5772f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("DPGA3L Mixer", SND_SOC_NOPM, 0, 0,
5782f989f7eSM R Swami Reddy isabelle_dpga3_left_mixer_controls,
5792f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_dpga3_left_mixer_controls)),
5802f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("DPGA3R Mixer", SND_SOC_NOPM, 0, 0,
5812f989f7eSM R Swami Reddy isabelle_dpga3_right_mixer_controls,
5822f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_dpga3_right_mixer_controls)),
5832f989f7eSM R Swami Reddy
5842f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("RX1 Mixer", SND_SOC_NOPM, 0, 0,
5852f989f7eSM R Swami Reddy isabelle_rx1_mixer_controls,
5862f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_rx1_mixer_controls)),
5872f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("RX2 Mixer", SND_SOC_NOPM, 0, 0,
5882f989f7eSM R Swami Reddy isabelle_rx2_mixer_controls,
5892f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_rx2_mixer_controls)),
5902f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("RX3 Mixer", SND_SOC_NOPM, 0, 0,
5912f989f7eSM R Swami Reddy isabelle_rx3_mixer_controls,
5922f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_rx3_mixer_controls)),
5932f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("RX4 Mixer", SND_SOC_NOPM, 0, 0,
5942f989f7eSM R Swami Reddy isabelle_rx4_mixer_controls,
5952f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_rx4_mixer_controls)),
5962f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("RX5 Mixer", SND_SOC_NOPM, 0, 0,
5972f989f7eSM R Swami Reddy isabelle_rx5_mixer_controls,
5982f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_rx5_mixer_controls)),
5992f989f7eSM R Swami Reddy SND_SOC_DAPM_MIXER("RX6 Mixer", SND_SOC_NOPM, 0, 0,
6002f989f7eSM R Swami Reddy isabelle_rx6_mixer_controls,
6012f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_rx6_mixer_controls)),
6022f989f7eSM R Swami Reddy
6032f989f7eSM R Swami Reddy /* DACs */
6042f989f7eSM R Swami Reddy SND_SOC_DAPM_DAC("DAC1L", "Headset Playback", ISABELLE_DAC_CFG_REG,
6052f989f7eSM R Swami Reddy 5, 0),
6062f989f7eSM R Swami Reddy SND_SOC_DAPM_DAC("DAC1R", "Headset Playback", ISABELLE_DAC_CFG_REG,
6072f989f7eSM R Swami Reddy 4, 0),
6082f989f7eSM R Swami Reddy SND_SOC_DAPM_DAC("DAC2L", "Handsfree Playback", ISABELLE_DAC_CFG_REG,
6092f989f7eSM R Swami Reddy 3, 0),
6102f989f7eSM R Swami Reddy SND_SOC_DAPM_DAC("DAC2R", "Handsfree Playback", ISABELLE_DAC_CFG_REG,
6112f989f7eSM R Swami Reddy 2, 0),
6122f989f7eSM R Swami Reddy SND_SOC_DAPM_DAC("DAC3L", "Lineout Playback", ISABELLE_DAC_CFG_REG,
6132f989f7eSM R Swami Reddy 1, 0),
6142f989f7eSM R Swami Reddy SND_SOC_DAPM_DAC("DAC3R", "Lineout Playback", ISABELLE_DAC_CFG_REG,
6152f989f7eSM R Swami Reddy 0, 0),
6162f989f7eSM R Swami Reddy
6172f989f7eSM R Swami Reddy /* Analog Playback PGAs */
6182f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("Sidetone Audio PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6192f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("Sidetone Voice PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6202f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("HF Left PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6212f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("HF Right PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6222f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DPGA1L", SND_SOC_NOPM, 0, 0, NULL, 0),
6232f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DPGA1R", SND_SOC_NOPM, 0, 0, NULL, 0),
6242f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DPGA2L", SND_SOC_NOPM, 0, 0, NULL, 0),
6252f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DPGA2R", SND_SOC_NOPM, 0, 0, NULL, 0),
6262f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DPGA3L", SND_SOC_NOPM, 0, 0, NULL, 0),
6272f989f7eSM R Swami Reddy SND_SOC_DAPM_PGA("DPGA3R", SND_SOC_NOPM, 0, 0, NULL, 0),
6282f989f7eSM R Swami Reddy
6292f989f7eSM R Swami Reddy /* Analog Playback Mux */
6302f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("RX1 Playback", ISABELLE_ALU_RX_EN_REG, 5, 0,
6312f989f7eSM R Swami Reddy &rx1_mux_controls),
6322f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("RX2 Playback", ISABELLE_ALU_RX_EN_REG, 4, 0,
6332f989f7eSM R Swami Reddy &rx2_mux_controls),
6342f989f7eSM R Swami Reddy
6352f989f7eSM R Swami Reddy /* TX Select */
6362f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("ATX Select", ISABELLE_TX_INPUT_CFG_REG,
6372f989f7eSM R Swami Reddy 7, 0, &atx_mux_controls),
6382f989f7eSM R Swami Reddy SND_SOC_DAPM_MUX("VTX Select", ISABELLE_TX_INPUT_CFG_REG,
6392f989f7eSM R Swami Reddy 6, 0, &vtx_mux_controls),
6402f989f7eSM R Swami Reddy
6412f989f7eSM R Swami Reddy SND_SOC_DAPM_SWITCH("Earphone Playback", SND_SOC_NOPM, 0, 0,
6422f989f7eSM R Swami Reddy &ep_path_enable_control),
6432f989f7eSM R Swami Reddy
6442f989f7eSM R Swami Reddy /* Output Drivers */
6452f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("HS Left Driver", ISABELLE_HSDRV_CFG2_REG,
6462f989f7eSM R Swami Reddy 1, 0, NULL, 0),
6472f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("HS Right Driver", ISABELLE_HSDRV_CFG2_REG,
6482f989f7eSM R Swami Reddy 0, 0, NULL, 0),
6492f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("LINEOUT1 Left Driver", ISABELLE_LINEAMP_CFG_REG,
6502f989f7eSM R Swami Reddy 1, 0, NULL, 0),
6512f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("LINEOUT2 Right Driver", ISABELLE_LINEAMP_CFG_REG,
6522f989f7eSM R Swami Reddy 0, 0, NULL, 0),
6532f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("Earphone Driver", ISABELLE_EARDRV_CFG2_REG,
6542f989f7eSM R Swami Reddy 1, 0, NULL, 0),
6552f989f7eSM R Swami Reddy
6562f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("HF Left Driver", ISABELLE_HFDRV_CFG_REG,
6572f989f7eSM R Swami Reddy 1, 0, NULL, 0),
6582f989f7eSM R Swami Reddy SND_SOC_DAPM_OUT_DRV("HF Right Driver", ISABELLE_HFDRV_CFG_REG,
6592f989f7eSM R Swami Reddy 0, 0, NULL, 0),
6602f989f7eSM R Swami Reddy };
6612f989f7eSM R Swami Reddy
6622f989f7eSM R Swami Reddy static const struct snd_soc_dapm_route isabelle_intercon[] = {
6632f989f7eSM R Swami Reddy /* Interface mapping */
6642f989f7eSM R Swami Reddy { "DL1", "DL12 Playback Switch", "INTF1_SDI" },
6652f989f7eSM R Swami Reddy { "DL2", "DL12 Playback Switch", "INTF1_SDI" },
6662f989f7eSM R Swami Reddy { "DL3", "DL34 Playback Switch", "INTF1_SDI" },
6672f989f7eSM R Swami Reddy { "DL4", "DL34 Playback Switch", "INTF1_SDI" },
6682f989f7eSM R Swami Reddy { "DL5", "DL56 Playback Switch", "INTF1_SDI" },
6692f989f7eSM R Swami Reddy { "DL6", "DL56 Playback Switch", "INTF1_SDI" },
6702f989f7eSM R Swami Reddy
6712f989f7eSM R Swami Reddy { "DL1", "DL12 Playback Switch", "INTF2_SDI" },
6722f989f7eSM R Swami Reddy { "DL2", "DL12 Playback Switch", "INTF2_SDI" },
6732f989f7eSM R Swami Reddy { "DL3", "DL34 Playback Switch", "INTF2_SDI" },
6742f989f7eSM R Swami Reddy { "DL4", "DL34 Playback Switch", "INTF2_SDI" },
6752f989f7eSM R Swami Reddy { "DL5", "DL56 Playback Switch", "INTF2_SDI" },
6762f989f7eSM R Swami Reddy { "DL6", "DL56 Playback Switch", "INTF2_SDI" },
6772f989f7eSM R Swami Reddy
6782f989f7eSM R Swami Reddy /* Input side mapping */
6792f989f7eSM R Swami Reddy { "Sidetone Audio PGA", NULL, "Sidetone Audio Playback" },
6802f989f7eSM R Swami Reddy { "Sidetone Voice PGA", NULL, "Sidetone Voice Playback" },
6812f989f7eSM R Swami Reddy
6822f989f7eSM R Swami Reddy { "RX1 Mixer", "ST1 Playback Switch", "Sidetone Audio PGA" },
6832f989f7eSM R Swami Reddy
6842f989f7eSM R Swami Reddy { "RX1 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
6852f989f7eSM R Swami Reddy { "RX1 Mixer", "DL1 Playback Switch", "DL1" },
6862f989f7eSM R Swami Reddy
6872f989f7eSM R Swami Reddy { "RX2 Mixer", "ST2 Playback Switch", "Sidetone Audio PGA" },
6882f989f7eSM R Swami Reddy
6892f989f7eSM R Swami Reddy { "RX2 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
6902f989f7eSM R Swami Reddy { "RX2 Mixer", "DL2 Playback Switch", "DL2" },
6912f989f7eSM R Swami Reddy
6922f989f7eSM R Swami Reddy { "RX3 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
6932f989f7eSM R Swami Reddy { "RX3 Mixer", "DL3 Playback Switch", "DL3" },
6942f989f7eSM R Swami Reddy
6952f989f7eSM R Swami Reddy { "RX4 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
6962f989f7eSM R Swami Reddy { "RX4 Mixer", "DL4 Playback Switch", "DL4" },
6972f989f7eSM R Swami Reddy
6982f989f7eSM R Swami Reddy { "RX5 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
6992f989f7eSM R Swami Reddy { "RX5 Mixer", "DL5 Playback Switch", "DL5" },
7002f989f7eSM R Swami Reddy
7012f989f7eSM R Swami Reddy { "RX6 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
7022f989f7eSM R Swami Reddy { "RX6 Mixer", "DL6 Playback Switch", "DL6" },
7032f989f7eSM R Swami Reddy
7042f989f7eSM R Swami Reddy /* Capture path */
7052f989f7eSM R Swami Reddy { "Analog Left Capture Route", "Headset Mic", "HSMIC" },
7062f989f7eSM R Swami Reddy { "Analog Left Capture Route", "Main Mic", "MAINMIC" },
7072f989f7eSM R Swami Reddy { "Analog Left Capture Route", "Aux/FM Left", "LINEIN1" },
7082f989f7eSM R Swami Reddy
7092f989f7eSM R Swami Reddy { "Analog Right Capture Route", "Sub Mic", "SUBMIC" },
7102f989f7eSM R Swami Reddy { "Analog Right Capture Route", "Aux/FM Right", "LINEIN2" },
7112f989f7eSM R Swami Reddy
7122f989f7eSM R Swami Reddy { "MicAmp1", NULL, "Analog Left Capture Route" },
7132f989f7eSM R Swami Reddy { "MicAmp2", NULL, "Analog Right Capture Route" },
7142f989f7eSM R Swami Reddy
7152f989f7eSM R Swami Reddy { "ADC1", NULL, "MicAmp1" },
7162f989f7eSM R Swami Reddy { "ADC2", NULL, "MicAmp2" },
7172f989f7eSM R Swami Reddy
7182f989f7eSM R Swami Reddy { "ATX Select", "AMIC1", "ADC1" },
7192f989f7eSM R Swami Reddy { "ATX Select", "DMIC", "DMICDAT" },
7202f989f7eSM R Swami Reddy { "ATX Select", "AMIC2", "ADC2" },
7212f989f7eSM R Swami Reddy
7222f989f7eSM R Swami Reddy { "VTX Select", "AMIC1", "ADC1" },
7232f989f7eSM R Swami Reddy { "VTX Select", "DMIC", "DMICDAT" },
7242f989f7eSM R Swami Reddy { "VTX Select", "AMIC2", "ADC2" },
7252f989f7eSM R Swami Reddy
7262f989f7eSM R Swami Reddy { "ULATX1", "ATX1 Filter Enable Switch", "ATX Select" },
7272f989f7eSM R Swami Reddy { "ULATX1", "ATX1 Filter Bypass Switch", "ATX Select" },
7282f989f7eSM R Swami Reddy { "ULATX2", "ATX2 Filter Enable Switch", "ATX Select" },
7292f989f7eSM R Swami Reddy { "ULATX2", "ATX2 Filter Bypass Switch", "ATX Select" },
7302f989f7eSM R Swami Reddy
7312f989f7eSM R Swami Reddy { "ULVTX1", "VTX1 Filter Enable Switch", "VTX Select" },
7322f989f7eSM R Swami Reddy { "ULVTX1", "VTX1 Filter Bypass Switch", "VTX Select" },
7332f989f7eSM R Swami Reddy { "ULVTX2", "VTX2 Filter Enable Switch", "VTX Select" },
7342f989f7eSM R Swami Reddy { "ULVTX2", "VTX2 Filter Bypass Switch", "VTX Select" },
7352f989f7eSM R Swami Reddy
7362f989f7eSM R Swami Reddy { "INTF1_SDO", "ULATX12 Capture Switch", "ULATX1" },
7372f989f7eSM R Swami Reddy { "INTF1_SDO", "ULATX12 Capture Switch", "ULATX2" },
7382f989f7eSM R Swami Reddy { "INTF2_SDO", "ULATX12 Capture Switch", "ULATX1" },
7392f989f7eSM R Swami Reddy { "INTF2_SDO", "ULATX12 Capture Switch", "ULATX2" },
7402f989f7eSM R Swami Reddy
7412f989f7eSM R Swami Reddy { "INTF1_SDO", NULL, "ULVTX1" },
7422f989f7eSM R Swami Reddy { "INTF1_SDO", NULL, "ULVTX2" },
7432f989f7eSM R Swami Reddy { "INTF2_SDO", NULL, "ULVTX1" },
7442f989f7eSM R Swami Reddy { "INTF2_SDO", NULL, "ULVTX2" },
7452f989f7eSM R Swami Reddy
7462f989f7eSM R Swami Reddy /* AFM Path */
7472f989f7eSM R Swami Reddy { "APGA1", NULL, "LINEIN1" },
7482f989f7eSM R Swami Reddy { "APGA2", NULL, "LINEIN2" },
7492f989f7eSM R Swami Reddy
7502f989f7eSM R Swami Reddy { "RX1 Playback", "VRX1 Filter Bypass Switch", "RX1 Mixer" },
7512f989f7eSM R Swami Reddy { "RX1 Playback", "ARX1 Filter Bypass Switch", "RX1 Mixer" },
7522f989f7eSM R Swami Reddy { "RX1 Playback", "RX1 Filter Enable Switch", "RX1 Mixer" },
7532f989f7eSM R Swami Reddy
7542f989f7eSM R Swami Reddy { "RX2 Playback", "VRX2 Filter Bypass Switch", "RX2 Mixer" },
7552f989f7eSM R Swami Reddy { "RX2 Playback", "ARX2 Filter Bypass Switch", "RX2 Mixer" },
7562f989f7eSM R Swami Reddy { "RX2 Playback", "RX2 Filter Enable Switch", "RX2 Mixer" },
7572f989f7eSM R Swami Reddy
7582f989f7eSM R Swami Reddy { "RX3 Playback", "ARX3 Filter Bypass Switch", "RX3 Mixer" },
7592f989f7eSM R Swami Reddy { "RX3 Playback", "RX3 Filter Enable Switch", "RX3 Mixer" },
7602f989f7eSM R Swami Reddy
7612f989f7eSM R Swami Reddy { "RX4 Playback", "ARX4 Filter Bypass Switch", "RX4 Mixer" },
7622f989f7eSM R Swami Reddy { "RX4 Playback", "RX4 Filter Enable Switch", "RX4 Mixer" },
7632f989f7eSM R Swami Reddy
7642f989f7eSM R Swami Reddy { "RX5 Playback", "ARX5 Filter Bypass Switch", "RX5 Mixer" },
7652f989f7eSM R Swami Reddy { "RX5 Playback", "RX5 Filter Enable Switch", "RX5 Mixer" },
7662f989f7eSM R Swami Reddy
7672f989f7eSM R Swami Reddy { "RX6 Playback", "ARX6 Filter Bypass Switch", "RX6 Mixer" },
7682f989f7eSM R Swami Reddy { "RX6 Playback", "RX6 Filter Enable Switch", "RX6 Mixer" },
7692f989f7eSM R Swami Reddy
7702f989f7eSM R Swami Reddy { "DPGA1L Mixer", "RX1 Playback Switch", "RX1 Playback" },
7712f989f7eSM R Swami Reddy { "DPGA1L Mixer", "RX3 Playback Switch", "RX3 Playback" },
7722f989f7eSM R Swami Reddy { "DPGA1L Mixer", "RX5 Playback Switch", "RX5 Playback" },
7732f989f7eSM R Swami Reddy
7742f989f7eSM R Swami Reddy { "DPGA1R Mixer", "RX2 Playback Switch", "RX2 Playback" },
7752f989f7eSM R Swami Reddy { "DPGA1R Mixer", "RX4 Playback Switch", "RX4 Playback" },
7762f989f7eSM R Swami Reddy { "DPGA1R Mixer", "RX6 Playback Switch", "RX6 Playback" },
7772f989f7eSM R Swami Reddy
7782f989f7eSM R Swami Reddy { "DPGA1L", NULL, "DPGA1L Mixer" },
7792f989f7eSM R Swami Reddy { "DPGA1R", NULL, "DPGA1R Mixer" },
7802f989f7eSM R Swami Reddy
7812f989f7eSM R Swami Reddy { "DAC1L", NULL, "DPGA1L" },
7822f989f7eSM R Swami Reddy { "DAC1R", NULL, "DPGA1R" },
7832f989f7eSM R Swami Reddy
7842f989f7eSM R Swami Reddy { "DPGA2L Mixer", "RX1 Playback Switch", "RX1 Playback" },
7852f989f7eSM R Swami Reddy { "DPGA2L Mixer", "RX2 Playback Switch", "RX2 Playback" },
7862f989f7eSM R Swami Reddy { "DPGA2L Mixer", "RX3 Playback Switch", "RX3 Playback" },
7872f989f7eSM R Swami Reddy { "DPGA2L Mixer", "RX4 Playback Switch", "RX4 Playback" },
7882f989f7eSM R Swami Reddy { "DPGA2L Mixer", "RX5 Playback Switch", "RX5 Playback" },
7892f989f7eSM R Swami Reddy { "DPGA2L Mixer", "RX6 Playback Switch", "RX6 Playback" },
7902f989f7eSM R Swami Reddy
7912f989f7eSM R Swami Reddy { "DPGA2R Mixer", "RX2 Playback Switch", "RX2 Playback" },
7922f989f7eSM R Swami Reddy { "DPGA2R Mixer", "RX4 Playback Switch", "RX4 Playback" },
7932f989f7eSM R Swami Reddy { "DPGA2R Mixer", "RX6 Playback Switch", "RX6 Playback" },
7942f989f7eSM R Swami Reddy
7952f989f7eSM R Swami Reddy { "DPGA2L", NULL, "DPGA2L Mixer" },
7962f989f7eSM R Swami Reddy { "DPGA2R", NULL, "DPGA2R Mixer" },
7972f989f7eSM R Swami Reddy
7982f989f7eSM R Swami Reddy { "DAC2L", NULL, "DPGA2L" },
7992f989f7eSM R Swami Reddy { "DAC2R", NULL, "DPGA2R" },
8002f989f7eSM R Swami Reddy
8012f989f7eSM R Swami Reddy { "DPGA3L Mixer", "RX1 Playback Switch", "RX1 Playback" },
8022f989f7eSM R Swami Reddy { "DPGA3L Mixer", "RX3 Playback Switch", "RX3 Playback" },
8032f989f7eSM R Swami Reddy { "DPGA3L Mixer", "RX5 Playback Switch", "RX5 Playback" },
8042f989f7eSM R Swami Reddy
8052f989f7eSM R Swami Reddy { "DPGA3R Mixer", "RX2 Playback Switch", "RX2 Playback" },
8062f989f7eSM R Swami Reddy { "DPGA3R Mixer", "RX4 Playback Switch", "RX4 Playback" },
8072f989f7eSM R Swami Reddy { "DPGA3R Mixer", "RX6 Playback Switch", "RX6 Playback" },
8082f989f7eSM R Swami Reddy
8092f989f7eSM R Swami Reddy { "DPGA3L", NULL, "DPGA3L Mixer" },
8102f989f7eSM R Swami Reddy { "DPGA3R", NULL, "DPGA3R Mixer" },
8112f989f7eSM R Swami Reddy
8122f989f7eSM R Swami Reddy { "DAC3L", NULL, "DPGA3L" },
8132f989f7eSM R Swami Reddy { "DAC3R", NULL, "DPGA3R" },
8142f989f7eSM R Swami Reddy
8152f989f7eSM R Swami Reddy { "Headset Left Mixer", "DAC1L Playback Switch", "DAC1L" },
8162f989f7eSM R Swami Reddy { "Headset Left Mixer", "APGA1 Playback Switch", "APGA1" },
8172f989f7eSM R Swami Reddy
8182f989f7eSM R Swami Reddy { "Headset Right Mixer", "DAC1R Playback Switch", "DAC1R" },
8192f989f7eSM R Swami Reddy { "Headset Right Mixer", "APGA2 Playback Switch", "APGA2" },
8202f989f7eSM R Swami Reddy
8212f989f7eSM R Swami Reddy { "HS Left Driver", NULL, "Headset Left Mixer" },
8222f989f7eSM R Swami Reddy { "HS Right Driver", NULL, "Headset Right Mixer" },
8232f989f7eSM R Swami Reddy
8242f989f7eSM R Swami Reddy { "HSOL", NULL, "HS Left Driver" },
8252f989f7eSM R Swami Reddy { "HSOR", NULL, "HS Right Driver" },
8262f989f7eSM R Swami Reddy
8272f989f7eSM R Swami Reddy /* Earphone playback path */
8282f989f7eSM R Swami Reddy { "Earphone Mixer", "DAC2L Playback Switch", "DAC2L" },
8292f989f7eSM R Swami Reddy { "Earphone Mixer", "APGA1 Playback Switch", "APGA1" },
8302f989f7eSM R Swami Reddy
8312f989f7eSM R Swami Reddy { "Earphone Playback", "Switch", "Earphone Mixer" },
8322f989f7eSM R Swami Reddy { "Earphone Driver", NULL, "Earphone Playback" },
8332f989f7eSM R Swami Reddy { "EP", NULL, "Earphone Driver" },
8342f989f7eSM R Swami Reddy
8352f989f7eSM R Swami Reddy { "Handsfree Left Mixer", "DAC2L Playback Switch", "DAC2L" },
8362f989f7eSM R Swami Reddy { "Handsfree Left Mixer", "APGA1 Playback Switch", "APGA1" },
8372f989f7eSM R Swami Reddy
8382f989f7eSM R Swami Reddy { "Handsfree Right Mixer", "DAC2R Playback Switch", "DAC2R" },
8392f989f7eSM R Swami Reddy { "Handsfree Right Mixer", "APGA2 Playback Switch", "APGA2" },
8402f989f7eSM R Swami Reddy
8412f989f7eSM R Swami Reddy { "HF Left PGA", NULL, "Handsfree Left Mixer" },
8422f989f7eSM R Swami Reddy { "HF Right PGA", NULL, "Handsfree Right Mixer" },
8432f989f7eSM R Swami Reddy
8442f989f7eSM R Swami Reddy { "HF Left Driver", NULL, "HF Left PGA" },
8452f989f7eSM R Swami Reddy { "HF Right Driver", NULL, "HF Right PGA" },
8462f989f7eSM R Swami Reddy
8472f989f7eSM R Swami Reddy { "HFL", NULL, "HF Left Driver" },
8482f989f7eSM R Swami Reddy { "HFR", NULL, "HF Right Driver" },
8492f989f7eSM R Swami Reddy
8502f989f7eSM R Swami Reddy { "LINEOUT1 Mixer", "DAC3L Playback Switch", "DAC3L" },
8512f989f7eSM R Swami Reddy { "LINEOUT1 Mixer", "APGA1 Playback Switch", "APGA1" },
8522f989f7eSM R Swami Reddy
8532f989f7eSM R Swami Reddy { "LINEOUT2 Mixer", "DAC3R Playback Switch", "DAC3R" },
8542f989f7eSM R Swami Reddy { "LINEOUT2 Mixer", "APGA2 Playback Switch", "APGA2" },
8552f989f7eSM R Swami Reddy
8562f989f7eSM R Swami Reddy { "LINEOUT1 Driver", NULL, "LINEOUT1 Mixer" },
8572f989f7eSM R Swami Reddy { "LINEOUT2 Driver", NULL, "LINEOUT2 Mixer" },
8582f989f7eSM R Swami Reddy
8592f989f7eSM R Swami Reddy { "LINEOUT1", NULL, "LINEOUT1 Driver" },
8602f989f7eSM R Swami Reddy { "LINEOUT2", NULL, "LINEOUT2 Driver" },
8612f989f7eSM R Swami Reddy };
8622f989f7eSM R Swami Reddy
isabelle_hs_mute(struct snd_soc_dai * dai,int mute,int direction)86354b59270SKuninori Morimoto static int isabelle_hs_mute(struct snd_soc_dai *dai, int mute, int direction)
8642f989f7eSM R Swami Reddy {
865f572634cSKuninori Morimoto snd_soc_component_update_bits(dai->component, ISABELLE_DAC1_SOFTRAMP_REG,
8662f989f7eSM R Swami Reddy BIT(4), (mute ? BIT(4) : 0));
8672f989f7eSM R Swami Reddy
8682f989f7eSM R Swami Reddy return 0;
8692f989f7eSM R Swami Reddy }
8702f989f7eSM R Swami Reddy
isabelle_hf_mute(struct snd_soc_dai * dai,int mute,int direction)87154b59270SKuninori Morimoto static int isabelle_hf_mute(struct snd_soc_dai *dai, int mute, int direction)
8722f989f7eSM R Swami Reddy {
873f572634cSKuninori Morimoto snd_soc_component_update_bits(dai->component, ISABELLE_DAC2_SOFTRAMP_REG,
8742f989f7eSM R Swami Reddy BIT(4), (mute ? BIT(4) : 0));
8752f989f7eSM R Swami Reddy
8762f989f7eSM R Swami Reddy return 0;
8772f989f7eSM R Swami Reddy }
8782f989f7eSM R Swami Reddy
isabelle_line_mute(struct snd_soc_dai * dai,int mute,int direction)87954b59270SKuninori Morimoto static int isabelle_line_mute(struct snd_soc_dai *dai, int mute, int direction)
8802f989f7eSM R Swami Reddy {
881f572634cSKuninori Morimoto snd_soc_component_update_bits(dai->component, ISABELLE_DAC3_SOFTRAMP_REG,
8822f989f7eSM R Swami Reddy BIT(4), (mute ? BIT(4) : 0));
8832f989f7eSM R Swami Reddy
8842f989f7eSM R Swami Reddy return 0;
8852f989f7eSM R Swami Reddy }
8862f989f7eSM R Swami Reddy
isabelle_set_bias_level(struct snd_soc_component * component,enum snd_soc_bias_level level)887f572634cSKuninori Morimoto static int isabelle_set_bias_level(struct snd_soc_component *component,
8882f989f7eSM R Swami Reddy enum snd_soc_bias_level level)
8892f989f7eSM R Swami Reddy {
8902f989f7eSM R Swami Reddy switch (level) {
8912f989f7eSM R Swami Reddy case SND_SOC_BIAS_ON:
8922f989f7eSM R Swami Reddy break;
8932f989f7eSM R Swami Reddy case SND_SOC_BIAS_PREPARE:
8942f989f7eSM R Swami Reddy break;
8952f989f7eSM R Swami Reddy
8962f989f7eSM R Swami Reddy case SND_SOC_BIAS_STANDBY:
897f572634cSKuninori Morimoto snd_soc_component_update_bits(component, ISABELLE_PWR_EN_REG,
8982f989f7eSM R Swami Reddy ISABELLE_CHIP_EN, BIT(0));
8992f989f7eSM R Swami Reddy break;
9002f989f7eSM R Swami Reddy
9012f989f7eSM R Swami Reddy case SND_SOC_BIAS_OFF:
902f572634cSKuninori Morimoto snd_soc_component_update_bits(component, ISABELLE_PWR_EN_REG,
9032f989f7eSM R Swami Reddy ISABELLE_CHIP_EN, 0);
9042f989f7eSM R Swami Reddy break;
9052f989f7eSM R Swami Reddy }
9062f989f7eSM R Swami Reddy
9072f989f7eSM R Swami Reddy return 0;
9082f989f7eSM R Swami Reddy }
9092f989f7eSM R Swami Reddy
isabelle_hw_params(struct snd_pcm_substream * substream,struct snd_pcm_hw_params * params,struct snd_soc_dai * dai)9102f989f7eSM R Swami Reddy static int isabelle_hw_params(struct snd_pcm_substream *substream,
9112f989f7eSM R Swami Reddy struct snd_pcm_hw_params *params,
9122f989f7eSM R Swami Reddy struct snd_soc_dai *dai)
9132f989f7eSM R Swami Reddy {
914f572634cSKuninori Morimoto struct snd_soc_component *component = dai->component;
9152f989f7eSM R Swami Reddy u16 aif = 0;
9162f989f7eSM R Swami Reddy unsigned int fs_val = 0;
9172f989f7eSM R Swami Reddy
9182f989f7eSM R Swami Reddy switch (params_rate(params)) {
9192f989f7eSM R Swami Reddy case 8000:
9202f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_8;
9212f989f7eSM R Swami Reddy break;
9222f989f7eSM R Swami Reddy case 11025:
9232f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_11;
9242f989f7eSM R Swami Reddy break;
9252f989f7eSM R Swami Reddy case 12000:
9262f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_12;
9272f989f7eSM R Swami Reddy break;
9282f989f7eSM R Swami Reddy case 16000:
9292f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_16;
9302f989f7eSM R Swami Reddy break;
9312f989f7eSM R Swami Reddy case 22050:
9322f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_22;
9332f989f7eSM R Swami Reddy break;
9342f989f7eSM R Swami Reddy case 24000:
9352f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_24;
9362f989f7eSM R Swami Reddy break;
9372f989f7eSM R Swami Reddy case 32000:
9382f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_32;
9392f989f7eSM R Swami Reddy break;
9402f989f7eSM R Swami Reddy case 44100:
9412f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_44;
9422f989f7eSM R Swami Reddy break;
9432f989f7eSM R Swami Reddy case 48000:
9442f989f7eSM R Swami Reddy fs_val = ISABELLE_FS_RATE_48;
9452f989f7eSM R Swami Reddy break;
9462f989f7eSM R Swami Reddy default:
9472f989f7eSM R Swami Reddy return -EINVAL;
9482f989f7eSM R Swami Reddy }
9492f989f7eSM R Swami Reddy
950f572634cSKuninori Morimoto snd_soc_component_update_bits(component, ISABELLE_FS_RATE_CFG_REG,
9512f989f7eSM R Swami Reddy ISABELLE_FS_RATE_MASK, fs_val);
9522f989f7eSM R Swami Reddy
9532f989f7eSM R Swami Reddy /* bit size */
954359e2ae8SMark Brown switch (params_width(params)) {
955359e2ae8SMark Brown case 20:
9562f989f7eSM R Swami Reddy aif |= ISABELLE_AIF_LENGTH_20;
9572f989f7eSM R Swami Reddy break;
958359e2ae8SMark Brown case 32:
9592f989f7eSM R Swami Reddy aif |= ISABELLE_AIF_LENGTH_32;
9602f989f7eSM R Swami Reddy break;
9612f989f7eSM R Swami Reddy default:
9622f989f7eSM R Swami Reddy return -EINVAL;
9632f989f7eSM R Swami Reddy }
9642f989f7eSM R Swami Reddy
965f572634cSKuninori Morimoto snd_soc_component_update_bits(component, ISABELLE_INTF_CFG_REG,
9662f989f7eSM R Swami Reddy ISABELLE_AIF_LENGTH_MASK, aif);
9672f989f7eSM R Swami Reddy
9682f989f7eSM R Swami Reddy return 0;
9692f989f7eSM R Swami Reddy }
9702f989f7eSM R Swami Reddy
isabelle_set_dai_fmt(struct snd_soc_dai * codec_dai,unsigned int fmt)9712f989f7eSM R Swami Reddy static int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
9722f989f7eSM R Swami Reddy {
973f572634cSKuninori Morimoto struct snd_soc_component *component = codec_dai->component;
9742f989f7eSM R Swami Reddy unsigned int aif_val = 0;
9752f989f7eSM R Swami Reddy
976addeb10cSMark Brown switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
977addeb10cSMark Brown case SND_SOC_DAIFMT_CBC_CFC:
9782f989f7eSM R Swami Reddy aif_val &= ~ISABELLE_AIF_MS;
9792f989f7eSM R Swami Reddy break;
980addeb10cSMark Brown case SND_SOC_DAIFMT_CBP_CFP:
9812f989f7eSM R Swami Reddy aif_val |= ISABELLE_AIF_MS;
9822f989f7eSM R Swami Reddy break;
9832f989f7eSM R Swami Reddy default:
9842f989f7eSM R Swami Reddy return -EINVAL;
9852f989f7eSM R Swami Reddy }
9862f989f7eSM R Swami Reddy
9872f989f7eSM R Swami Reddy switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
9882f989f7eSM R Swami Reddy case SND_SOC_DAIFMT_I2S:
9892f989f7eSM R Swami Reddy aif_val |= ISABELLE_I2S_MODE;
9902f989f7eSM R Swami Reddy break;
9912f989f7eSM R Swami Reddy case SND_SOC_DAIFMT_LEFT_J:
9922f989f7eSM R Swami Reddy aif_val |= ISABELLE_LEFT_J_MODE;
9932f989f7eSM R Swami Reddy break;
9942f989f7eSM R Swami Reddy case SND_SOC_DAIFMT_PDM:
9952f989f7eSM R Swami Reddy aif_val |= ISABELLE_PDM_MODE;
9962f989f7eSM R Swami Reddy break;
9972f989f7eSM R Swami Reddy default:
9982f989f7eSM R Swami Reddy return -EINVAL;
9992f989f7eSM R Swami Reddy }
10002f989f7eSM R Swami Reddy
1001f572634cSKuninori Morimoto snd_soc_component_update_bits(component, ISABELLE_INTF_CFG_REG,
10022f989f7eSM R Swami Reddy (ISABELLE_AIF_MS | ISABELLE_AIF_FMT_MASK), aif_val);
10032f989f7eSM R Swami Reddy
10042f989f7eSM R Swami Reddy return 0;
10052f989f7eSM R Swami Reddy }
10062f989f7eSM R Swami Reddy
10072f989f7eSM R Swami Reddy /* Rates supported by Isabelle driver */
10082f989f7eSM R Swami Reddy #define ISABELLE_RATES SNDRV_PCM_RATE_8000_48000
10092f989f7eSM R Swami Reddy
10102f989f7eSM R Swami Reddy /* Formates supported by Isabelle driver. */
10112f989f7eSM R Swami Reddy #define ISABELLE_FORMATS (SNDRV_PCM_FMTBIT_S20_3LE |\
10122f989f7eSM R Swami Reddy SNDRV_PCM_FMTBIT_S32_LE)
10132f989f7eSM R Swami Reddy
101464793047SAxel Lin static const struct snd_soc_dai_ops isabelle_hs_dai_ops = {
10152f989f7eSM R Swami Reddy .hw_params = isabelle_hw_params,
10162f989f7eSM R Swami Reddy .set_fmt = isabelle_set_dai_fmt,
101754b59270SKuninori Morimoto .mute_stream = isabelle_hs_mute,
101854b59270SKuninori Morimoto .no_capture_mute = 1,
10192f989f7eSM R Swami Reddy };
10202f989f7eSM R Swami Reddy
102164793047SAxel Lin static const struct snd_soc_dai_ops isabelle_hf_dai_ops = {
10222f989f7eSM R Swami Reddy .hw_params = isabelle_hw_params,
10232f989f7eSM R Swami Reddy .set_fmt = isabelle_set_dai_fmt,
102454b59270SKuninori Morimoto .mute_stream = isabelle_hf_mute,
102554b59270SKuninori Morimoto .no_capture_mute = 1,
10262f989f7eSM R Swami Reddy };
10272f989f7eSM R Swami Reddy
102864793047SAxel Lin static const struct snd_soc_dai_ops isabelle_line_dai_ops = {
10292f989f7eSM R Swami Reddy .hw_params = isabelle_hw_params,
10302f989f7eSM R Swami Reddy .set_fmt = isabelle_set_dai_fmt,
103154b59270SKuninori Morimoto .mute_stream = isabelle_line_mute,
103254b59270SKuninori Morimoto .no_capture_mute = 1,
10332f989f7eSM R Swami Reddy };
10342f989f7eSM R Swami Reddy
103564793047SAxel Lin static const struct snd_soc_dai_ops isabelle_ul_dai_ops = {
10362f989f7eSM R Swami Reddy .hw_params = isabelle_hw_params,
10372f989f7eSM R Swami Reddy .set_fmt = isabelle_set_dai_fmt,
10382f989f7eSM R Swami Reddy };
10392f989f7eSM R Swami Reddy
10402f989f7eSM R Swami Reddy /* ISABELLE dai structure */
1041bb1591b3SMark Brown static struct snd_soc_dai_driver isabelle_dai[] = {
10422f989f7eSM R Swami Reddy {
10432f989f7eSM R Swami Reddy .name = "isabelle-dl1",
10442f989f7eSM R Swami Reddy .playback = {
10452f989f7eSM R Swami Reddy .stream_name = "Headset Playback",
10462f989f7eSM R Swami Reddy .channels_min = 1,
10472f989f7eSM R Swami Reddy .channels_max = 2,
10482f989f7eSM R Swami Reddy .rates = ISABELLE_RATES,
10492f989f7eSM R Swami Reddy .formats = ISABELLE_FORMATS,
10502f989f7eSM R Swami Reddy },
10512f989f7eSM R Swami Reddy .ops = &isabelle_hs_dai_ops,
10522f989f7eSM R Swami Reddy },
10532f989f7eSM R Swami Reddy {
10542f989f7eSM R Swami Reddy .name = "isabelle-dl2",
10552f989f7eSM R Swami Reddy .playback = {
10562f989f7eSM R Swami Reddy .stream_name = "Handsfree Playback",
10572f989f7eSM R Swami Reddy .channels_min = 1,
10582f989f7eSM R Swami Reddy .channels_max = 2,
10592f989f7eSM R Swami Reddy .rates = ISABELLE_RATES,
10602f989f7eSM R Swami Reddy .formats = ISABELLE_FORMATS,
10612f989f7eSM R Swami Reddy },
10622f989f7eSM R Swami Reddy .ops = &isabelle_hf_dai_ops,
10632f989f7eSM R Swami Reddy },
10642f989f7eSM R Swami Reddy {
10652f989f7eSM R Swami Reddy .name = "isabelle-lineout",
10662f989f7eSM R Swami Reddy .playback = {
10672f989f7eSM R Swami Reddy .stream_name = "Lineout Playback",
10682f989f7eSM R Swami Reddy .channels_min = 1,
10692f989f7eSM R Swami Reddy .channels_max = 2,
10702f989f7eSM R Swami Reddy .rates = ISABELLE_RATES,
10712f989f7eSM R Swami Reddy .formats = ISABELLE_FORMATS,
10722f989f7eSM R Swami Reddy },
10732f989f7eSM R Swami Reddy .ops = &isabelle_line_dai_ops,
10742f989f7eSM R Swami Reddy },
10752f989f7eSM R Swami Reddy {
10762f989f7eSM R Swami Reddy .name = "isabelle-ul",
10772f989f7eSM R Swami Reddy .capture = {
10782f989f7eSM R Swami Reddy .stream_name = "Capture",
10792f989f7eSM R Swami Reddy .channels_min = 1,
10802f989f7eSM R Swami Reddy .channels_max = 2,
10812f989f7eSM R Swami Reddy .rates = ISABELLE_RATES,
10822f989f7eSM R Swami Reddy .formats = ISABELLE_FORMATS,
10832f989f7eSM R Swami Reddy },
10842f989f7eSM R Swami Reddy .ops = &isabelle_ul_dai_ops,
10852f989f7eSM R Swami Reddy },
10862f989f7eSM R Swami Reddy };
10872f989f7eSM R Swami Reddy
1088f572634cSKuninori Morimoto static const struct snd_soc_component_driver soc_component_dev_isabelle = {
10892f989f7eSM R Swami Reddy .set_bias_level = isabelle_set_bias_level,
10902f989f7eSM R Swami Reddy .controls = isabelle_snd_controls,
10912f989f7eSM R Swami Reddy .num_controls = ARRAY_SIZE(isabelle_snd_controls),
10922f989f7eSM R Swami Reddy .dapm_widgets = isabelle_dapm_widgets,
10932f989f7eSM R Swami Reddy .num_dapm_widgets = ARRAY_SIZE(isabelle_dapm_widgets),
10942f989f7eSM R Swami Reddy .dapm_routes = isabelle_intercon,
10952f989f7eSM R Swami Reddy .num_dapm_routes = ARRAY_SIZE(isabelle_intercon),
1096f572634cSKuninori Morimoto .use_pmdown_time = 1,
1097f572634cSKuninori Morimoto .endianness = 1,
10982f989f7eSM R Swami Reddy };
10992f989f7eSM R Swami Reddy
11002f989f7eSM R Swami Reddy static const struct regmap_config isabelle_regmap_config = {
11012f989f7eSM R Swami Reddy .reg_bits = 8,
11022f989f7eSM R Swami Reddy .val_bits = 8,
11032f989f7eSM R Swami Reddy
11042f989f7eSM R Swami Reddy .max_register = ISABELLE_MAX_REGISTER,
11052f989f7eSM R Swami Reddy .reg_defaults = isabelle_reg_defs,
11062f989f7eSM R Swami Reddy .num_reg_defaults = ARRAY_SIZE(isabelle_reg_defs),
11072f989f7eSM R Swami Reddy .cache_type = REGCACHE_RBTREE,
11082f989f7eSM R Swami Reddy };
11092f989f7eSM R Swami Reddy
isabelle_i2c_probe(struct i2c_client * i2c)11106b84012eSStephen Kitt static int isabelle_i2c_probe(struct i2c_client *i2c)
11112f989f7eSM R Swami Reddy {
11122f989f7eSM R Swami Reddy struct regmap *isabelle_regmap;
11132f989f7eSM R Swami Reddy int ret = 0;
11142f989f7eSM R Swami Reddy
11152f989f7eSM R Swami Reddy isabelle_regmap = devm_regmap_init_i2c(i2c, &isabelle_regmap_config);
11162f989f7eSM R Swami Reddy if (IS_ERR(isabelle_regmap)) {
11172f989f7eSM R Swami Reddy ret = PTR_ERR(isabelle_regmap);
11182f989f7eSM R Swami Reddy dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
11192f989f7eSM R Swami Reddy ret);
11202f989f7eSM R Swami Reddy return ret;
11212f989f7eSM R Swami Reddy }
112240820105SDan Carpenter i2c_set_clientdata(i2c, isabelle_regmap);
11232f989f7eSM R Swami Reddy
1124f572634cSKuninori Morimoto ret = devm_snd_soc_register_component(&i2c->dev,
1125f572634cSKuninori Morimoto &soc_component_dev_isabelle, isabelle_dai,
11262f989f7eSM R Swami Reddy ARRAY_SIZE(isabelle_dai));
11272f989f7eSM R Swami Reddy if (ret < 0) {
1128f572634cSKuninori Morimoto dev_err(&i2c->dev, "Failed to register component: %d\n", ret);
11292f989f7eSM R Swami Reddy return ret;
11302f989f7eSM R Swami Reddy }
11312f989f7eSM R Swami Reddy
11322f989f7eSM R Swami Reddy return ret;
11332f989f7eSM R Swami Reddy }
11342f989f7eSM R Swami Reddy
11352f989f7eSM R Swami Reddy static const struct i2c_device_id isabelle_i2c_id[] = {
1136*ba2a2c37SUwe Kleine-König { "isabelle" },
11372f989f7eSM R Swami Reddy { }
11382f989f7eSM R Swami Reddy };
11392f989f7eSM R Swami Reddy MODULE_DEVICE_TABLE(i2c, isabelle_i2c_id);
11402f989f7eSM R Swami Reddy
11412f989f7eSM R Swami Reddy static struct i2c_driver isabelle_i2c_driver = {
11422f989f7eSM R Swami Reddy .driver = {
11432f989f7eSM R Swami Reddy .name = "isabelle",
11442f989f7eSM R Swami Reddy },
11459abcd240SUwe Kleine-König .probe = isabelle_i2c_probe,
11462f989f7eSM R Swami Reddy .id_table = isabelle_i2c_id,
11472f989f7eSM R Swami Reddy };
11482f989f7eSM R Swami Reddy
11492f989f7eSM R Swami Reddy module_i2c_driver(isabelle_i2c_driver);
11502f989f7eSM R Swami Reddy
11512f989f7eSM R Swami Reddy MODULE_DESCRIPTION("ASoC ISABELLE driver");
11522f989f7eSM R Swami Reddy MODULE_AUTHOR("Vishwas A Deshpande <vishwas.a.deshpande@ti.com>");
11532f989f7eSM R Swami Reddy MODULE_AUTHOR("M R Swami Reddy <MR.Swami.Reddy@ti.com>");
11542f989f7eSM R Swami Reddy MODULE_LICENSE("GPL v2");
1155