xref: /openbmc/linux/sound/soc/codecs/isabelle.c (revision 359e2ae8)
12f989f7eSM R Swami Reddy /*
22f989f7eSM R Swami Reddy  * isabelle.c - Low power high fidelity audio codec driver
32f989f7eSM R Swami Reddy  *
42f989f7eSM R Swami Reddy  * Copyright (c) 2012 Texas Instruments, Inc
52f989f7eSM R Swami Reddy  *
62f989f7eSM R Swami Reddy  * This program is free software; you can redistribute it and/or modify
72f989f7eSM R Swami Reddy  * it under the terms of the GNU General Public License as published by
82f989f7eSM R Swami Reddy  * the Free Software Foundation; version 2 of the License.
92f989f7eSM R Swami Reddy  *
102f989f7eSM R Swami Reddy  *
112f989f7eSM R Swami Reddy  * Initially based on sound/soc/codecs/twl6040.c
122f989f7eSM R Swami Reddy  *
132f989f7eSM R Swami Reddy  */
142f989f7eSM R Swami Reddy #include <linux/module.h>
152f989f7eSM R Swami Reddy #include <linux/moduleparam.h>
162f989f7eSM R Swami Reddy #include <linux/kernel.h>
172f989f7eSM R Swami Reddy #include <linux/init.h>
182f989f7eSM R Swami Reddy #include <linux/delay.h>
192f989f7eSM R Swami Reddy #include <linux/pm.h>
202f989f7eSM R Swami Reddy #include <linux/regmap.h>
212f989f7eSM R Swami Reddy #include <linux/i2c.h>
222f989f7eSM R Swami Reddy #include <linux/slab.h>
232f989f7eSM R Swami Reddy #include <sound/core.h>
242f989f7eSM R Swami Reddy #include <sound/pcm.h>
252f989f7eSM R Swami Reddy #include <sound/pcm_params.h>
262f989f7eSM R Swami Reddy #include <sound/soc.h>
272f989f7eSM R Swami Reddy #include <sound/soc-dapm.h>
282f989f7eSM R Swami Reddy #include <sound/tlv.h>
292f989f7eSM R Swami Reddy #include <sound/jack.h>
302f989f7eSM R Swami Reddy #include <sound/initval.h>
312f989f7eSM R Swami Reddy #include <asm/div64.h>
322f989f7eSM R Swami Reddy #include "isabelle.h"
332f989f7eSM R Swami Reddy 
342f989f7eSM R Swami Reddy 
352f989f7eSM R Swami Reddy /* Register default values for ISABELLE driver. */
362f989f7eSM R Swami Reddy static struct reg_default isabelle_reg_defs[] = {
372f989f7eSM R Swami Reddy 	{ 0, 0x00 },
382f989f7eSM R Swami Reddy 	{ 1, 0x00 },
392f989f7eSM R Swami Reddy 	{ 2, 0x00 },
402f989f7eSM R Swami Reddy 	{ 3, 0x00 },
412f989f7eSM R Swami Reddy 	{ 4, 0x00 },
422f989f7eSM R Swami Reddy 	{ 5, 0x00 },
432f989f7eSM R Swami Reddy 	{ 6, 0x00 },
442f989f7eSM R Swami Reddy 	{ 7, 0x00 },
452f989f7eSM R Swami Reddy 	{ 8, 0x00 },
462f989f7eSM R Swami Reddy 	{ 9, 0x00 },
472f989f7eSM R Swami Reddy 	{ 10, 0x00 },
482f989f7eSM R Swami Reddy 	{ 11, 0x00 },
492f989f7eSM R Swami Reddy 	{ 12, 0x00 },
502f989f7eSM R Swami Reddy 	{ 13, 0x00 },
512f989f7eSM R Swami Reddy 	{ 14, 0x00 },
522f989f7eSM R Swami Reddy 	{ 15, 0x00 },
532f989f7eSM R Swami Reddy 	{ 16, 0x00 },
542f989f7eSM R Swami Reddy 	{ 17, 0x00 },
552f989f7eSM R Swami Reddy 	{ 18, 0x00 },
562f989f7eSM R Swami Reddy 	{ 19, 0x00 },
572f989f7eSM R Swami Reddy 	{ 20, 0x00 },
582f989f7eSM R Swami Reddy 	{ 21, 0x02 },
592f989f7eSM R Swami Reddy 	{ 22, 0x02 },
602f989f7eSM R Swami Reddy 	{ 23, 0x02 },
612f989f7eSM R Swami Reddy 	{ 24, 0x02 },
622f989f7eSM R Swami Reddy 	{ 25, 0x0F },
632f989f7eSM R Swami Reddy 	{ 26, 0x8F },
642f989f7eSM R Swami Reddy 	{ 27, 0x0F },
652f989f7eSM R Swami Reddy 	{ 28, 0x8F },
662f989f7eSM R Swami Reddy 	{ 29, 0x00 },
672f989f7eSM R Swami Reddy 	{ 30, 0x00 },
682f989f7eSM R Swami Reddy 	{ 31, 0x00 },
692f989f7eSM R Swami Reddy 	{ 32, 0x00 },
702f989f7eSM R Swami Reddy 	{ 33, 0x00 },
712f989f7eSM R Swami Reddy 	{ 34, 0x00 },
722f989f7eSM R Swami Reddy 	{ 35, 0x00 },
732f989f7eSM R Swami Reddy 	{ 36, 0x00 },
742f989f7eSM R Swami Reddy 	{ 37, 0x00 },
752f989f7eSM R Swami Reddy 	{ 38, 0x00 },
762f989f7eSM R Swami Reddy 	{ 39, 0x00 },
772f989f7eSM R Swami Reddy 	{ 40, 0x00 },
782f989f7eSM R Swami Reddy 	{ 41, 0x00 },
792f989f7eSM R Swami Reddy 	{ 42, 0x00 },
802f989f7eSM R Swami Reddy 	{ 43, 0x00 },
812f989f7eSM R Swami Reddy 	{ 44, 0x00 },
822f989f7eSM R Swami Reddy 	{ 45, 0x00 },
832f989f7eSM R Swami Reddy 	{ 46, 0x00 },
842f989f7eSM R Swami Reddy 	{ 47, 0x00 },
852f989f7eSM R Swami Reddy 	{ 48, 0x00 },
862f989f7eSM R Swami Reddy 	{ 49, 0x00 },
872f989f7eSM R Swami Reddy 	{ 50, 0x00 },
882f989f7eSM R Swami Reddy 	{ 51, 0x00 },
892f989f7eSM R Swami Reddy 	{ 52, 0x00 },
902f989f7eSM R Swami Reddy 	{ 53, 0x00 },
912f989f7eSM R Swami Reddy 	{ 54, 0x00 },
922f989f7eSM R Swami Reddy 	{ 55, 0x00 },
932f989f7eSM R Swami Reddy 	{ 56, 0x00 },
942f989f7eSM R Swami Reddy 	{ 57, 0x00 },
952f989f7eSM R Swami Reddy 	{ 58, 0x00 },
962f989f7eSM R Swami Reddy 	{ 59, 0x00 },
972f989f7eSM R Swami Reddy 	{ 60, 0x00 },
982f989f7eSM R Swami Reddy 	{ 61, 0x00 },
992f989f7eSM R Swami Reddy 	{ 62, 0x00 },
1002f989f7eSM R Swami Reddy 	{ 63, 0x00 },
1012f989f7eSM R Swami Reddy 	{ 64, 0x00 },
1022f989f7eSM R Swami Reddy 	{ 65, 0x00 },
1032f989f7eSM R Swami Reddy 	{ 66, 0x00 },
1042f989f7eSM R Swami Reddy 	{ 67, 0x00 },
1052f989f7eSM R Swami Reddy 	{ 68, 0x00 },
1062f989f7eSM R Swami Reddy 	{ 69, 0x90 },
1072f989f7eSM R Swami Reddy 	{ 70, 0x90 },
1082f989f7eSM R Swami Reddy 	{ 71, 0x90 },
1092f989f7eSM R Swami Reddy 	{ 72, 0x00 },
1102f989f7eSM R Swami Reddy 	{ 73, 0x00 },
1112f989f7eSM R Swami Reddy 	{ 74, 0x00 },
1122f989f7eSM R Swami Reddy 	{ 75, 0x00 },
1132f989f7eSM R Swami Reddy 	{ 76, 0x00 },
1142f989f7eSM R Swami Reddy 	{ 77, 0x00 },
1152f989f7eSM R Swami Reddy 	{ 78, 0x00 },
1162f989f7eSM R Swami Reddy 	{ 79, 0x00 },
1172f989f7eSM R Swami Reddy 	{ 80, 0x00 },
1182f989f7eSM R Swami Reddy 	{ 81, 0x00 },
1192f989f7eSM R Swami Reddy 	{ 82, 0x00 },
1202f989f7eSM R Swami Reddy 	{ 83, 0x00 },
1212f989f7eSM R Swami Reddy 	{ 84, 0x00 },
1222f989f7eSM R Swami Reddy 	{ 85, 0x07 },
1232f989f7eSM R Swami Reddy 	{ 86, 0x00 },
1242f989f7eSM R Swami Reddy 	{ 87, 0x00 },
1252f989f7eSM R Swami Reddy 	{ 88, 0x00 },
1262f989f7eSM R Swami Reddy 	{ 89, 0x07 },
1272f989f7eSM R Swami Reddy 	{ 90, 0x80 },
1282f989f7eSM R Swami Reddy 	{ 91, 0x07 },
1292f989f7eSM R Swami Reddy 	{ 92, 0x07 },
1302f989f7eSM R Swami Reddy 	{ 93, 0x00 },
1312f989f7eSM R Swami Reddy 	{ 94, 0x00 },
1322f989f7eSM R Swami Reddy 	{ 95, 0x00 },
1332f989f7eSM R Swami Reddy 	{ 96, 0x00 },
1342f989f7eSM R Swami Reddy 	{ 97, 0x00 },
1352f989f7eSM R Swami Reddy 	{ 98, 0x00 },
1362f989f7eSM R Swami Reddy 	{ 99, 0x00 },
1372f989f7eSM R Swami Reddy };
1382f989f7eSM R Swami Reddy 
1392f989f7eSM R Swami Reddy static const char *isabelle_rx1_texts[] = {"VRX1", "ARX1"};
1402f989f7eSM R Swami Reddy static const char *isabelle_rx2_texts[] = {"VRX2", "ARX2"};
1412f989f7eSM R Swami Reddy 
1422f989f7eSM R Swami Reddy static const struct soc_enum isabelle_rx1_enum[] = {
1432f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, 1, isabelle_rx1_texts),
1442f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, 1, isabelle_rx1_texts),
1452f989f7eSM R Swami Reddy };
1462f989f7eSM R Swami Reddy 
1472f989f7eSM R Swami Reddy static const struct soc_enum isabelle_rx2_enum[] = {
1482f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2, 1, isabelle_rx2_texts),
1492f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4, 1, isabelle_rx2_texts),
1502f989f7eSM R Swami Reddy };
1512f989f7eSM R Swami Reddy 
1522f989f7eSM R Swami Reddy /* Headset DAC playback switches */
1532f989f7eSM R Swami Reddy static const struct snd_kcontrol_new rx1_mux_controls =
1542f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_rx1_enum);
1552f989f7eSM R Swami Reddy 
1562f989f7eSM R Swami Reddy static const struct snd_kcontrol_new rx2_mux_controls =
1572f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_rx2_enum);
1582f989f7eSM R Swami Reddy 
1592f989f7eSM R Swami Reddy /* TX input selection */
1602f989f7eSM R Swami Reddy static const char *isabelle_atx_texts[] = {"AMIC1", "DMIC"};
1612f989f7eSM R Swami Reddy static const char *isabelle_vtx_texts[] = {"AMIC2", "DMIC"};
1622f989f7eSM R Swami Reddy 
1632f989f7eSM R Swami Reddy static const struct soc_enum isabelle_atx_enum[] = {
1642f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7, 1, isabelle_atx_texts),
1652f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_atx_texts),
1662f989f7eSM R Swami Reddy };
1672f989f7eSM R Swami Reddy 
1682f989f7eSM R Swami Reddy static const struct soc_enum isabelle_vtx_enum[] = {
1692f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6, 1, isabelle_vtx_texts),
1702f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_vtx_texts),
1712f989f7eSM R Swami Reddy };
1722f989f7eSM R Swami Reddy 
1732f989f7eSM R Swami Reddy static const struct snd_kcontrol_new atx_mux_controls =
1742f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_atx_enum);
1752f989f7eSM R Swami Reddy 
1762f989f7eSM R Swami Reddy static const struct snd_kcontrol_new vtx_mux_controls =
1772f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_vtx_enum);
1782f989f7eSM R Swami Reddy 
1792f989f7eSM R Swami Reddy /* Left analog microphone selection */
1802f989f7eSM R Swami Reddy static const char *isabelle_amic1_texts[] = {
1812f989f7eSM R Swami Reddy 	"Main Mic", "Headset Mic", "Aux/FM Left"};
1822f989f7eSM R Swami Reddy 
1832f989f7eSM R Swami Reddy /* Left analog microphone selection */
1842f989f7eSM R Swami Reddy static const char *isabelle_amic2_texts[] = {"Sub Mic", "Aux/FM Right"};
1852f989f7eSM R Swami Reddy 
1862f989f7eSM R Swami Reddy static const struct soc_enum isabelle_amic1_enum[] = {
1872f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 5,
1882f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_amic1_texts),
1892f989f7eSM R Swami Reddy 			isabelle_amic1_texts),
1902f989f7eSM R Swami Reddy };
1912f989f7eSM R Swami Reddy 
1922f989f7eSM R Swami Reddy static const struct soc_enum isabelle_amic2_enum[] = {
1932f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 4,
1942f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_amic2_texts),
1952f989f7eSM R Swami Reddy 			isabelle_amic2_texts),
1962f989f7eSM R Swami Reddy };
1972f989f7eSM R Swami Reddy 
1982f989f7eSM R Swami Reddy static const struct snd_kcontrol_new amic1_control =
1992f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_amic1_enum);
2002f989f7eSM R Swami Reddy 
2012f989f7eSM R Swami Reddy static const struct snd_kcontrol_new amic2_control =
2022f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_amic2_enum);
2032f989f7eSM R Swami Reddy 
2042f989f7eSM R Swami Reddy static const char *isabelle_st_audio_texts[] = {"ATX1", "ATX2"};
2052f989f7eSM R Swami Reddy 
2062f989f7eSM R Swami Reddy static const char *isabelle_st_voice_texts[] = {"VTX1", "VTX2"};
2072f989f7eSM R Swami Reddy 
2082f989f7eSM R Swami Reddy static const struct soc_enum isabelle_st_audio_enum[] = {
2092f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7, 1,
2102f989f7eSM R Swami Reddy 			isabelle_st_audio_texts),
2112f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7, 1,
2122f989f7eSM R Swami Reddy 			isabelle_st_audio_texts),
2132f989f7eSM R Swami Reddy };
2142f989f7eSM R Swami Reddy 
2152f989f7eSM R Swami Reddy static const struct soc_enum isabelle_st_voice_enum[] = {
2162f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7, 1,
2172f989f7eSM R Swami Reddy 			isabelle_st_voice_texts),
2182f989f7eSM R Swami Reddy 	SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7, 1,
2192f989f7eSM R Swami Reddy 			isabelle_st_voice_texts),
2202f989f7eSM R Swami Reddy };
2212f989f7eSM R Swami Reddy 
2222f989f7eSM R Swami Reddy static const struct snd_kcontrol_new st_audio_control =
2232f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_st_audio_enum);
2242f989f7eSM R Swami Reddy 
2252f989f7eSM R Swami Reddy static const struct snd_kcontrol_new st_voice_control =
2262f989f7eSM R Swami Reddy 	SOC_DAPM_ENUM("Route", isabelle_st_voice_enum);
2272f989f7eSM R Swami Reddy 
2282f989f7eSM R Swami Reddy /* Mixer controls */
2292f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hs_left_mixer_controls[] = {
2302f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC1L Playback Switch", ISABELLE_HSDRV_CFG1_REG, 7, 1, 0),
2312f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 6, 1, 0),
2322f989f7eSM R Swami Reddy };
2332f989f7eSM R Swami Reddy 
2342f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hs_right_mixer_controls[] = {
2352f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC1R Playback Switch", ISABELLE_HSDRV_CFG1_REG, 5, 1, 0),
2362f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 4, 1, 0),
2372f989f7eSM R Swami Reddy };
2382f989f7eSM R Swami Reddy 
2392f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hf_left_mixer_controls[] = {
2402f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_HFLPGA_CFG_REG, 7, 1, 0),
2412f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HFLPGA_CFG_REG, 6, 1, 0),
2422f989f7eSM R Swami Reddy };
2432f989f7eSM R Swami Reddy 
2442f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_hf_right_mixer_controls[] = {
2452f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC2R Playback Switch", ISABELLE_HFRPGA_CFG_REG, 7, 1, 0),
2462f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HFRPGA_CFG_REG, 6, 1, 0),
2472f989f7eSM R Swami Reddy };
2482f989f7eSM R Swami Reddy 
2492f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_ep_mixer_controls[] = {
2502f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_EARDRV_CFG1_REG, 7, 1, 0),
2512f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_EARDRV_CFG1_REG, 6, 1, 0),
2522f989f7eSM R Swami Reddy };
2532f989f7eSM R Swami Reddy 
2542f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_aux_left_mixer_controls[] = {
2552f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC3L Playback Switch", ISABELLE_LINEAMP_CFG_REG, 7, 1, 0),
2562f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 6, 1, 0),
2572f989f7eSM R Swami Reddy };
2582f989f7eSM R Swami Reddy 
2592f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_aux_right_mixer_controls[] = {
2602f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DAC3R Playback Switch", ISABELLE_LINEAMP_CFG_REG, 5, 1, 0),
2612f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 4, 1, 0),
2622f989f7eSM R Swami Reddy };
2632f989f7eSM R Swami Reddy 
2642f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga1_left_mixer_controls[] = {
2652f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 7, 1, 0),
2662f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 6, 1, 0),
2672f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 5, 1, 0),
2682f989f7eSM R Swami Reddy };
2692f989f7eSM R Swami Reddy 
2702f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga1_right_mixer_controls[] = {
2712f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 3, 1, 0),
2722f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 2, 1, 0),
2732f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 1, 1, 0),
2742f989f7eSM R Swami Reddy };
2752f989f7eSM R Swami Reddy 
2762f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga2_left_mixer_controls[] = {
2772f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 7, 1, 0),
2782f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 6, 1, 0),
2792f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 5, 1, 0),
2802f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 4, 1, 0),
2812f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 3, 1, 0),
2822f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 2, 1, 0),
2832f989f7eSM R Swami Reddy };
2842f989f7eSM R Swami Reddy 
2852f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga2_right_mixer_controls[] = {
2862f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("USNC Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 7, 1, 0),
2872f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 3, 1, 0),
2882f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 2, 1, 0),
2892f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 1, 1, 0),
2902f989f7eSM R Swami Reddy };
2912f989f7eSM R Swami Reddy 
2922f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga3_left_mixer_controls[] = {
2932f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 7, 1, 0),
2942f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 6, 1, 0),
2952f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 5, 1, 0),
2962f989f7eSM R Swami Reddy };
2972f989f7eSM R Swami Reddy 
2982f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_dpga3_right_mixer_controls[] = {
2992f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 3, 1, 0),
3002f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 2, 1, 0),
3012f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 1, 1, 0),
3022f989f7eSM R Swami Reddy };
3032f989f7eSM R Swami Reddy 
3042f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx1_mixer_controls[] = {
3052f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 7, 1, 0),
3062f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 6, 1, 0),
3072f989f7eSM R Swami Reddy };
3082f989f7eSM R Swami Reddy 
3092f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx2_mixer_controls[] = {
3102f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 5, 1, 0),
3112f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 4, 1, 0),
3122f989f7eSM R Swami Reddy };
3132f989f7eSM R Swami Reddy 
3142f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx3_mixer_controls[] = {
3152f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 3, 1, 0),
3162f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL3 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 2, 1, 0),
3172f989f7eSM R Swami Reddy };
3182f989f7eSM R Swami Reddy 
3192f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx4_mixer_controls[] = {
3202f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 1, 1, 0),
3212f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL4 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 0, 1, 0),
3222f989f7eSM R Swami Reddy };
3232f989f7eSM R Swami Reddy 
3242f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx5_mixer_controls[] = {
3252f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 7, 1, 0),
3262f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL5 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 6, 1, 0),
3272f989f7eSM R Swami Reddy };
3282f989f7eSM R Swami Reddy 
3292f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_rx6_mixer_controls[] = {
3302f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 5, 1, 0),
3312f989f7eSM R Swami Reddy SOC_DAPM_SINGLE("DL6 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 4, 1, 0),
3322f989f7eSM R Swami Reddy };
3332f989f7eSM R Swami Reddy 
3342f989f7eSM R Swami Reddy static const struct snd_kcontrol_new ep_path_enable_control =
3352f989f7eSM R Swami Reddy 	SOC_DAPM_SINGLE("Switch", ISABELLE_EARDRV_CFG2_REG, 0, 1, 0);
3362f989f7eSM R Swami Reddy 
3372f989f7eSM R Swami Reddy /* TLV Declarations */
3382f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(mic_amp_tlv, 0, 100, 0);
3392f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(afm_amp_tlv, -3300, 300, 0);
3402f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(dac_tlv, -1200, 200, 0);
3412f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(hf_tlv, -5000, 200, 0);
3422f989f7eSM R Swami Reddy 
3432f989f7eSM R Swami Reddy /* from -63 to 0 dB in 1 dB steps */
3442f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(dpga_tlv, -6300, 100, 1);
3452f989f7eSM R Swami Reddy 
3462f989f7eSM R Swami Reddy /* from -63 to 9 dB in 1 dB steps */
3472f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(rx_tlv, -6300, 100, 1);
3482f989f7eSM R Swami Reddy 
3492f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(st_tlv, -2700, 300, 1);
3502f989f7eSM R Swami Reddy static const DECLARE_TLV_DB_SCALE(tx_tlv, -600, 100, 0);
3512f989f7eSM R Swami Reddy 
3522f989f7eSM R Swami Reddy static const struct snd_kcontrol_new isabelle_snd_controls[] = {
3532f989f7eSM R Swami Reddy 	SOC_DOUBLE_TLV("Headset Playback Volume", ISABELLE_HSDRV_GAIN_REG,
3542f989f7eSM R Swami Reddy 			4, 0, 0xF, 0, dac_tlv),
3552f989f7eSM R Swami Reddy 	SOC_DOUBLE_R_TLV("Handsfree Playback Volume",
3562f989f7eSM R Swami Reddy 			ISABELLE_HFLPGA_CFG_REG, ISABELLE_HFRPGA_CFG_REG,
3572f989f7eSM R Swami Reddy 			0, 0x1F, 0, hf_tlv),
3582f989f7eSM R Swami Reddy 	SOC_DOUBLE_TLV("Aux Playback Volume", ISABELLE_LINEAMP_GAIN_REG,
3592f989f7eSM R Swami Reddy 			4, 0, 0xF, 0, dac_tlv),
3602f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Earpiece Playback Volume", ISABELLE_EARDRV_CFG1_REG,
3612f989f7eSM R Swami Reddy 			0, 0xF, 0, dac_tlv),
3622f989f7eSM R Swami Reddy 
3632f989f7eSM R Swami Reddy 	SOC_DOUBLE_TLV("Aux FM Volume", ISABELLE_APGA_GAIN_REG, 4, 0, 0xF, 0,
3642f989f7eSM R Swami Reddy 			afm_amp_tlv),
3652f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Mic1 Capture Volume", ISABELLE_MIC1_GAIN_REG, 3, 0x1F,
3662f989f7eSM R Swami Reddy 			0, mic_amp_tlv),
3672f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Mic2 Capture Volume", ISABELLE_MIC2_GAIN_REG, 3, 0x1F,
3682f989f7eSM R Swami Reddy 			0, mic_amp_tlv),
3692f989f7eSM R Swami Reddy 
3702f989f7eSM R Swami Reddy 	SOC_DOUBLE_R_TLV("DPGA1 Volume", ISABELLE_DPGA1L_GAIN_REG,
3712f989f7eSM R Swami Reddy 			ISABELLE_DPGA1R_GAIN_REG, 0, 0x3F, 0, dpga_tlv),
3722f989f7eSM R Swami Reddy 	SOC_DOUBLE_R_TLV("DPGA2 Volume", ISABELLE_DPGA2L_GAIN_REG,
3732f989f7eSM R Swami Reddy 			ISABELLE_DPGA2R_GAIN_REG, 0, 0x3F, 0, dpga_tlv),
3742f989f7eSM R Swami Reddy 	SOC_DOUBLE_R_TLV("DPGA3 Volume", ISABELLE_DPGA3L_GAIN_REG,
3752f989f7eSM R Swami Reddy 			ISABELLE_DPGA3R_GAIN_REG, 0, 0x3F, 0, dpga_tlv),
3762f989f7eSM R Swami Reddy 
3772f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Sidetone Audio TX1 Volume",
3782f989f7eSM R Swami Reddy 			ISABELLE_ATX_STPGA1_CFG_REG, 0, 0xF, 0, st_tlv),
3792f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Sidetone Audio TX2 Volume",
3802f989f7eSM R Swami Reddy 			ISABELLE_ATX_STPGA2_CFG_REG, 0, 0xF, 0, st_tlv),
3812f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Sidetone Voice TX1 Volume",
3822f989f7eSM R Swami Reddy 			ISABELLE_VTX_STPGA1_CFG_REG, 0, 0xF, 0, st_tlv),
3832f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Sidetone Voice TX2 Volume",
3842f989f7eSM R Swami Reddy 			ISABELLE_VTX2_STPGA2_CFG_REG, 0, 0xF, 0, st_tlv),
3852f989f7eSM R Swami Reddy 
3862f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Audio TX1 Volume", ISABELLE_ATX1_DPGA_REG, 4, 0xF, 0,
3872f989f7eSM R Swami Reddy 			tx_tlv),
3882f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Audio TX2 Volume", ISABELLE_ATX2_DPGA_REG, 4, 0xF, 0,
3892f989f7eSM R Swami Reddy 			tx_tlv),
3902f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Voice TX1 Volume", ISABELLE_VTX1_DPGA_REG, 4, 0xF, 0,
3912f989f7eSM R Swami Reddy 			tx_tlv),
3922f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("Voice TX2 Volume", ISABELLE_VTX2_DPGA_REG, 4, 0xF, 0,
3932f989f7eSM R Swami Reddy 			tx_tlv),
3942f989f7eSM R Swami Reddy 
3952f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("RX1 DPGA Volume", ISABELLE_RX1_DPGA_REG, 0, 0x3F, 0,
3962f989f7eSM R Swami Reddy 			rx_tlv),
3972f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("RX2 DPGA Volume", ISABELLE_RX2_DPGA_REG, 0, 0x3F, 0,
3982f989f7eSM R Swami Reddy 			rx_tlv),
3992f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("RX3 DPGA Volume", ISABELLE_RX3_DPGA_REG, 0, 0x3F, 0,
4002f989f7eSM R Swami Reddy 			rx_tlv),
4012f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("RX4 DPGA Volume", ISABELLE_RX4_DPGA_REG, 0, 0x3F, 0,
4022f989f7eSM R Swami Reddy 			rx_tlv),
4032f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("RX5 DPGA Volume", ISABELLE_RX5_DPGA_REG, 0, 0x3F, 0,
4042f989f7eSM R Swami Reddy 			rx_tlv),
4052f989f7eSM R Swami Reddy 	SOC_SINGLE_TLV("RX6 DPGA Volume", ISABELLE_RX6_DPGA_REG, 0, 0x3F, 0,
4062f989f7eSM R Swami Reddy 			rx_tlv),
4072f989f7eSM R Swami Reddy 
4082f989f7eSM R Swami Reddy 	SOC_SINGLE("Headset Noise Gate", ISABELLE_HS_NG_CFG1_REG, 7, 1, 0),
4092f989f7eSM R Swami Reddy 	SOC_SINGLE("Handsfree Noise Gate", ISABELLE_HF_NG_CFG1_REG, 7, 1, 0),
4102f989f7eSM R Swami Reddy 
4112f989f7eSM R Swami Reddy 	SOC_SINGLE("ATX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4122f989f7eSM R Swami Reddy 		7, 1, 0),
4132f989f7eSM R Swami Reddy 	SOC_SINGLE("ATX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4142f989f7eSM R Swami Reddy 		6, 1, 0),
4152f989f7eSM R Swami Reddy 	SOC_SINGLE("ARX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4162f989f7eSM R Swami Reddy 		5, 1, 0),
4172f989f7eSM R Swami Reddy 	SOC_SINGLE("ARX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4182f989f7eSM R Swami Reddy 		4, 1, 0),
4192f989f7eSM R Swami Reddy 	SOC_SINGLE("ARX3 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4202f989f7eSM R Swami Reddy 		3, 1, 0),
4212f989f7eSM R Swami Reddy 	SOC_SINGLE("ARX4 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4222f989f7eSM R Swami Reddy 		2, 1, 0),
4232f989f7eSM R Swami Reddy 	SOC_SINGLE("ARX5 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4242f989f7eSM R Swami Reddy 		1, 1, 0),
4252f989f7eSM R Swami Reddy 	SOC_SINGLE("ARX6 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4262f989f7eSM R Swami Reddy 		0, 1, 0),
4272f989f7eSM R Swami Reddy 	SOC_SINGLE("VRX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4282f989f7eSM R Swami Reddy 		3, 1, 0),
4292f989f7eSM R Swami Reddy 	SOC_SINGLE("VRX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG,
4302f989f7eSM R Swami Reddy 		2, 1, 0),
4312f989f7eSM R Swami Reddy 
4322f989f7eSM R Swami Reddy 	SOC_SINGLE("ATX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4332f989f7eSM R Swami Reddy 		7, 1, 0),
4342f989f7eSM R Swami Reddy 	SOC_SINGLE("ATX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4352f989f7eSM R Swami Reddy 		6, 1, 0),
4362f989f7eSM R Swami Reddy 	SOC_SINGLE("VTX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4372f989f7eSM R Swami Reddy 		5, 1, 0),
4382f989f7eSM R Swami Reddy 	SOC_SINGLE("VTX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG,
4392f989f7eSM R Swami Reddy 		4, 1, 0),
4402f989f7eSM R Swami Reddy 	SOC_SINGLE("RX1 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4412f989f7eSM R Swami Reddy 		5, 1, 0),
4422f989f7eSM R Swami Reddy 	SOC_SINGLE("RX2 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4432f989f7eSM R Swami Reddy 		4, 1, 0),
4442f989f7eSM R Swami Reddy 	SOC_SINGLE("RX3 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4452f989f7eSM R Swami Reddy 		3, 1, 0),
4462f989f7eSM R Swami Reddy 	SOC_SINGLE("RX4 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4472f989f7eSM R Swami Reddy 		2, 1, 0),
4482f989f7eSM R Swami Reddy 	SOC_SINGLE("RX5 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4492f989f7eSM R Swami Reddy 		1, 1, 0),
4502f989f7eSM R Swami Reddy 	SOC_SINGLE("RX6 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG,
4512f989f7eSM R Swami Reddy 		0, 1, 0),
4522f989f7eSM R Swami Reddy 
4532f989f7eSM R Swami Reddy 	SOC_SINGLE("ULATX12 Capture Switch", ISABELLE_ULATX12_INTF_CFG_REG,
4542f989f7eSM R Swami Reddy 		7, 1, 0),
4552f989f7eSM R Swami Reddy 
4562f989f7eSM R Swami Reddy 	SOC_SINGLE("DL12 Playback Switch", ISABELLE_DL12_INTF_CFG_REG,
4572f989f7eSM R Swami Reddy 		7, 1, 0),
4582f989f7eSM R Swami Reddy 	SOC_SINGLE("DL34 Playback Switch", ISABELLE_DL34_INTF_CFG_REG,
4592f989f7eSM R Swami Reddy 		7, 1, 0),
4602f989f7eSM R Swami Reddy 	SOC_SINGLE("DL56 Playback Switch", ISABELLE_DL56_INTF_CFG_REG,
4612f989f7eSM R Swami Reddy 		7, 1, 0),
4622f989f7eSM R Swami Reddy 
4632f989f7eSM R Swami Reddy 	/* DMIC Switch */
4642f989f7eSM R Swami Reddy 	SOC_SINGLE("DMIC Switch", ISABELLE_DMIC_CFG_REG, 0, 1, 0),
4652f989f7eSM R Swami Reddy };
4662f989f7eSM R Swami Reddy 
4672f989f7eSM R Swami Reddy static const struct snd_soc_dapm_widget isabelle_dapm_widgets[] = {
4682f989f7eSM R Swami Reddy 	/* Inputs */
4692f989f7eSM R Swami Reddy 	SND_SOC_DAPM_INPUT("MAINMIC"),
4702f989f7eSM R Swami Reddy 	SND_SOC_DAPM_INPUT("HSMIC"),
4712f989f7eSM R Swami Reddy 	SND_SOC_DAPM_INPUT("SUBMIC"),
4722f989f7eSM R Swami Reddy 	SND_SOC_DAPM_INPUT("LINEIN1"),
4732f989f7eSM R Swami Reddy 	SND_SOC_DAPM_INPUT("LINEIN2"),
4742f989f7eSM R Swami Reddy 	SND_SOC_DAPM_INPUT("DMICDAT"),
4752f989f7eSM R Swami Reddy 
4762f989f7eSM R Swami Reddy 	/* Outputs */
4772f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUTPUT("HSOL"),
4782f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUTPUT("HSOR"),
4792f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUTPUT("HFL"),
4802f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUTPUT("HFR"),
4812f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUTPUT("EP"),
4822f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUTPUT("LINEOUT1"),
4832f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUTPUT("LINEOUT2"),
4842f989f7eSM R Swami Reddy 
4852f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DL1", SND_SOC_NOPM, 0, 0, NULL, 0),
4862f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DL2", SND_SOC_NOPM, 0, 0, NULL, 0),
4872f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DL3", SND_SOC_NOPM, 0, 0, NULL, 0),
4882f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DL4", SND_SOC_NOPM, 0, 0, NULL, 0),
4892f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DL5", SND_SOC_NOPM, 0, 0, NULL, 0),
4902f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DL6", SND_SOC_NOPM, 0, 0, NULL, 0),
4912f989f7eSM R Swami Reddy 
4922f989f7eSM R Swami Reddy 	/* Analog input muxes for the capture amplifiers */
4932f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("Analog Left Capture Route",
4942f989f7eSM R Swami Reddy 			SND_SOC_NOPM, 0, 0, &amic1_control),
4952f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("Analog Right Capture Route",
4962f989f7eSM R Swami Reddy 			SND_SOC_NOPM, 0, 0, &amic2_control),
4972f989f7eSM R Swami Reddy 
4982f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("Sidetone Audio Playback", SND_SOC_NOPM, 0, 0,
4992f989f7eSM R Swami Reddy 			&st_audio_control),
5002f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("Sidetone Voice Playback", SND_SOC_NOPM, 0, 0,
5012f989f7eSM R Swami Reddy 			&st_voice_control),
5022f989f7eSM R Swami Reddy 
5032f989f7eSM R Swami Reddy 	/* AIF */
5042f989f7eSM R Swami Reddy 	SND_SOC_DAPM_AIF_IN("INTF1_SDI", NULL, 0, ISABELLE_INTF_EN_REG, 7, 0),
5052f989f7eSM R Swami Reddy 	SND_SOC_DAPM_AIF_IN("INTF2_SDI", NULL, 0, ISABELLE_INTF_EN_REG, 6, 0),
5062f989f7eSM R Swami Reddy 
5072f989f7eSM R Swami Reddy 	SND_SOC_DAPM_AIF_OUT("INTF1_SDO", NULL, 0, ISABELLE_INTF_EN_REG, 5, 0),
5082f989f7eSM R Swami Reddy 	SND_SOC_DAPM_AIF_OUT("INTF2_SDO", NULL, 0, ISABELLE_INTF_EN_REG, 4, 0),
5092f989f7eSM R Swami Reddy 
5102f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("ULATX1", SND_SOC_NOPM, 0, 0, NULL, 0),
5112f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("ULATX2", SND_SOC_NOPM, 0, 0, NULL, 0),
5122f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("ULVTX1", SND_SOC_NOPM, 0, 0, NULL, 0),
5132f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("ULVTX2", SND_SOC_NOPM, 0, 0, NULL, 0),
5142f989f7eSM R Swami Reddy 
5152f989f7eSM R Swami Reddy 	/* Analog Capture PGAs */
5162f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("MicAmp1", ISABELLE_AMIC_CFG_REG, 5, 0, NULL, 0),
5172f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("MicAmp2", ISABELLE_AMIC_CFG_REG, 4, 0, NULL, 0),
5182f989f7eSM R Swami Reddy 
5192f989f7eSM R Swami Reddy 	/* Auxiliary FM PGAs */
5202f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("APGA1", ISABELLE_APGA_CFG_REG, 7, 0, NULL, 0),
5212f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("APGA2", ISABELLE_APGA_CFG_REG, 6, 0, NULL, 0),
5222f989f7eSM R Swami Reddy 
5232f989f7eSM R Swami Reddy 	/* ADCs */
5242f989f7eSM R Swami Reddy 	SND_SOC_DAPM_ADC("ADC1", "Left Front Capture",
5252f989f7eSM R Swami Reddy 			ISABELLE_AMIC_CFG_REG, 7, 0),
5262f989f7eSM R Swami Reddy 	SND_SOC_DAPM_ADC("ADC2", "Right Front Capture",
5272f989f7eSM R Swami Reddy 			ISABELLE_AMIC_CFG_REG, 6, 0),
5282f989f7eSM R Swami Reddy 
5292f989f7eSM R Swami Reddy 	/* Microphone Bias */
5302f989f7eSM R Swami Reddy 	SND_SOC_DAPM_SUPPLY("Headset Mic Bias", ISABELLE_ABIAS_CFG_REG,
5312f989f7eSM R Swami Reddy 			3, 0, NULL, 0),
5322f989f7eSM R Swami Reddy 	SND_SOC_DAPM_SUPPLY("Main Mic Bias", ISABELLE_ABIAS_CFG_REG,
5332f989f7eSM R Swami Reddy 			2, 0, NULL, 0),
5342f989f7eSM R Swami Reddy 	SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias",
5352f989f7eSM R Swami Reddy 			ISABELLE_DBIAS_CFG_REG, 3, 0, NULL, 0),
5362f989f7eSM R Swami Reddy 	SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias",
5372f989f7eSM R Swami Reddy 			ISABELLE_DBIAS_CFG_REG, 2, 0, NULL, 0),
5382f989f7eSM R Swami Reddy 
5392f989f7eSM R Swami Reddy 	/* Mixers */
5402f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("Headset Left Mixer", SND_SOC_NOPM, 0, 0,
5412f989f7eSM R Swami Reddy 			isabelle_hs_left_mixer_controls,
5422f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_hs_left_mixer_controls)),
5432f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("Headset Right Mixer", SND_SOC_NOPM, 0, 0,
5442f989f7eSM R Swami Reddy 			isabelle_hs_right_mixer_controls,
5452f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_hs_right_mixer_controls)),
5462f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("Handsfree Left Mixer", SND_SOC_NOPM, 0, 0,
5472f989f7eSM R Swami Reddy 			isabelle_hf_left_mixer_controls,
5482f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_hf_left_mixer_controls)),
5492f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("Handsfree Right Mixer", SND_SOC_NOPM, 0, 0,
5502f989f7eSM R Swami Reddy 			isabelle_hf_right_mixer_controls,
5512f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_hf_right_mixer_controls)),
5522f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("LINEOUT1 Mixer", SND_SOC_NOPM, 0, 0,
5532f989f7eSM R Swami Reddy 			isabelle_aux_left_mixer_controls,
5542f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_aux_left_mixer_controls)),
5552f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("LINEOUT2 Mixer", SND_SOC_NOPM, 0, 0,
5562f989f7eSM R Swami Reddy 			isabelle_aux_right_mixer_controls,
5572f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_aux_right_mixer_controls)),
5582f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("Earphone Mixer", SND_SOC_NOPM, 0, 0,
5592f989f7eSM R Swami Reddy 			isabelle_ep_mixer_controls,
5602f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_ep_mixer_controls)),
5612f989f7eSM R Swami Reddy 
5622f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("DPGA1L Mixer", SND_SOC_NOPM, 0, 0,
5632f989f7eSM R Swami Reddy 			isabelle_dpga1_left_mixer_controls,
5642f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_dpga1_left_mixer_controls)),
5652f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("DPGA1R Mixer", SND_SOC_NOPM, 0, 0,
5662f989f7eSM R Swami Reddy 			isabelle_dpga1_right_mixer_controls,
5672f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_dpga1_right_mixer_controls)),
5682f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("DPGA2L Mixer", SND_SOC_NOPM, 0, 0,
5692f989f7eSM R Swami Reddy 			isabelle_dpga2_left_mixer_controls,
5702f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_dpga2_left_mixer_controls)),
5712f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("DPGA2R Mixer", SND_SOC_NOPM, 0, 0,
5722f989f7eSM R Swami Reddy 			isabelle_dpga2_right_mixer_controls,
5732f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_dpga2_right_mixer_controls)),
5742f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("DPGA3L Mixer", SND_SOC_NOPM, 0, 0,
5752f989f7eSM R Swami Reddy 			isabelle_dpga3_left_mixer_controls,
5762f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_dpga3_left_mixer_controls)),
5772f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("DPGA3R Mixer", SND_SOC_NOPM, 0, 0,
5782f989f7eSM R Swami Reddy 			isabelle_dpga3_right_mixer_controls,
5792f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_dpga3_right_mixer_controls)),
5802f989f7eSM R Swami Reddy 
5812f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("RX1 Mixer", SND_SOC_NOPM, 0, 0,
5822f989f7eSM R Swami Reddy 			isabelle_rx1_mixer_controls,
5832f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_rx1_mixer_controls)),
5842f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("RX2 Mixer", SND_SOC_NOPM, 0, 0,
5852f989f7eSM R Swami Reddy 			isabelle_rx2_mixer_controls,
5862f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_rx2_mixer_controls)),
5872f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("RX3 Mixer", SND_SOC_NOPM, 0, 0,
5882f989f7eSM R Swami Reddy 			isabelle_rx3_mixer_controls,
5892f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_rx3_mixer_controls)),
5902f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("RX4 Mixer", SND_SOC_NOPM, 0, 0,
5912f989f7eSM R Swami Reddy 			isabelle_rx4_mixer_controls,
5922f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_rx4_mixer_controls)),
5932f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("RX5 Mixer", SND_SOC_NOPM, 0, 0,
5942f989f7eSM R Swami Reddy 			isabelle_rx5_mixer_controls,
5952f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_rx5_mixer_controls)),
5962f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MIXER("RX6 Mixer", SND_SOC_NOPM, 0, 0,
5972f989f7eSM R Swami Reddy 			isabelle_rx6_mixer_controls,
5982f989f7eSM R Swami Reddy 			ARRAY_SIZE(isabelle_rx6_mixer_controls)),
5992f989f7eSM R Swami Reddy 
6002f989f7eSM R Swami Reddy 	/* DACs */
6012f989f7eSM R Swami Reddy 	SND_SOC_DAPM_DAC("DAC1L", "Headset Playback", ISABELLE_DAC_CFG_REG,
6022f989f7eSM R Swami Reddy 			5, 0),
6032f989f7eSM R Swami Reddy 	SND_SOC_DAPM_DAC("DAC1R", "Headset Playback", ISABELLE_DAC_CFG_REG,
6042f989f7eSM R Swami Reddy 			4, 0),
6052f989f7eSM R Swami Reddy 	SND_SOC_DAPM_DAC("DAC2L", "Handsfree Playback", ISABELLE_DAC_CFG_REG,
6062f989f7eSM R Swami Reddy 			3, 0),
6072f989f7eSM R Swami Reddy 	SND_SOC_DAPM_DAC("DAC2R", "Handsfree Playback", ISABELLE_DAC_CFG_REG,
6082f989f7eSM R Swami Reddy 			2, 0),
6092f989f7eSM R Swami Reddy 	SND_SOC_DAPM_DAC("DAC3L", "Lineout Playback", ISABELLE_DAC_CFG_REG,
6102f989f7eSM R Swami Reddy 			1, 0),
6112f989f7eSM R Swami Reddy 	SND_SOC_DAPM_DAC("DAC3R", "Lineout Playback", ISABELLE_DAC_CFG_REG,
6122f989f7eSM R Swami Reddy 			0, 0),
6132f989f7eSM R Swami Reddy 
6142f989f7eSM R Swami Reddy 	/* Analog Playback PGAs */
6152f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("Sidetone Audio PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6162f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("Sidetone Voice PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6172f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("HF Left PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6182f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("HF Right PGA", SND_SOC_NOPM, 0, 0, NULL, 0),
6192f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DPGA1L", SND_SOC_NOPM, 0, 0, NULL, 0),
6202f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DPGA1R", SND_SOC_NOPM, 0, 0, NULL, 0),
6212f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DPGA2L", SND_SOC_NOPM, 0, 0, NULL, 0),
6222f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DPGA2R", SND_SOC_NOPM, 0, 0, NULL, 0),
6232f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DPGA3L", SND_SOC_NOPM, 0, 0, NULL, 0),
6242f989f7eSM R Swami Reddy 	SND_SOC_DAPM_PGA("DPGA3R", SND_SOC_NOPM, 0, 0, NULL, 0),
6252f989f7eSM R Swami Reddy 
6262f989f7eSM R Swami Reddy 	/* Analog Playback Mux */
6272f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("RX1 Playback", ISABELLE_ALU_RX_EN_REG, 5, 0,
6282f989f7eSM R Swami Reddy 			&rx1_mux_controls),
6292f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("RX2 Playback", ISABELLE_ALU_RX_EN_REG, 4, 0,
6302f989f7eSM R Swami Reddy 			&rx2_mux_controls),
6312f989f7eSM R Swami Reddy 
6322f989f7eSM R Swami Reddy 	/* TX Select */
6332f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("ATX Select", ISABELLE_TX_INPUT_CFG_REG,
6342f989f7eSM R Swami Reddy 			7, 0, &atx_mux_controls),
6352f989f7eSM R Swami Reddy 	SND_SOC_DAPM_MUX("VTX Select", ISABELLE_TX_INPUT_CFG_REG,
6362f989f7eSM R Swami Reddy 			6, 0, &vtx_mux_controls),
6372f989f7eSM R Swami Reddy 
6382f989f7eSM R Swami Reddy 	SND_SOC_DAPM_SWITCH("Earphone Playback", SND_SOC_NOPM, 0, 0,
6392f989f7eSM R Swami Reddy 			&ep_path_enable_control),
6402f989f7eSM R Swami Reddy 
6412f989f7eSM R Swami Reddy 	/* Output Drivers */
6422f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("HS Left Driver", ISABELLE_HSDRV_CFG2_REG,
6432f989f7eSM R Swami Reddy 			1, 0, NULL, 0),
6442f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("HS Right Driver", ISABELLE_HSDRV_CFG2_REG,
6452f989f7eSM R Swami Reddy 			0, 0, NULL, 0),
6462f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("LINEOUT1 Left Driver", ISABELLE_LINEAMP_CFG_REG,
6472f989f7eSM R Swami Reddy 			1, 0, NULL, 0),
6482f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("LINEOUT2 Right Driver", ISABELLE_LINEAMP_CFG_REG,
6492f989f7eSM R Swami Reddy 			0, 0, NULL, 0),
6502f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("Earphone Driver", ISABELLE_EARDRV_CFG2_REG,
6512f989f7eSM R Swami Reddy 			1, 0, NULL, 0),
6522f989f7eSM R Swami Reddy 
6532f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("HF Left Driver", ISABELLE_HFDRV_CFG_REG,
6542f989f7eSM R Swami Reddy 			1, 0, NULL, 0),
6552f989f7eSM R Swami Reddy 	SND_SOC_DAPM_OUT_DRV("HF Right Driver", ISABELLE_HFDRV_CFG_REG,
6562f989f7eSM R Swami Reddy 			0, 0, NULL, 0),
6572f989f7eSM R Swami Reddy };
6582f989f7eSM R Swami Reddy 
6592f989f7eSM R Swami Reddy static const struct snd_soc_dapm_route isabelle_intercon[] = {
6602f989f7eSM R Swami Reddy 	/* Interface mapping */
6612f989f7eSM R Swami Reddy 	{ "DL1", "DL12 Playback Switch", "INTF1_SDI" },
6622f989f7eSM R Swami Reddy 	{ "DL2", "DL12 Playback Switch", "INTF1_SDI" },
6632f989f7eSM R Swami Reddy 	{ "DL3", "DL34 Playback Switch", "INTF1_SDI" },
6642f989f7eSM R Swami Reddy 	{ "DL4", "DL34 Playback Switch", "INTF1_SDI" },
6652f989f7eSM R Swami Reddy 	{ "DL5", "DL56 Playback Switch", "INTF1_SDI" },
6662f989f7eSM R Swami Reddy 	{ "DL6", "DL56 Playback Switch", "INTF1_SDI" },
6672f989f7eSM R Swami Reddy 
6682f989f7eSM R Swami Reddy 	{ "DL1", "DL12 Playback Switch", "INTF2_SDI" },
6692f989f7eSM R Swami Reddy 	{ "DL2", "DL12 Playback Switch", "INTF2_SDI" },
6702f989f7eSM R Swami Reddy 	{ "DL3", "DL34 Playback Switch", "INTF2_SDI" },
6712f989f7eSM R Swami Reddy 	{ "DL4", "DL34 Playback Switch", "INTF2_SDI" },
6722f989f7eSM R Swami Reddy 	{ "DL5", "DL56 Playback Switch", "INTF2_SDI" },
6732f989f7eSM R Swami Reddy 	{ "DL6", "DL56 Playback Switch", "INTF2_SDI" },
6742f989f7eSM R Swami Reddy 
6752f989f7eSM R Swami Reddy 	/* Input side mapping */
6762f989f7eSM R Swami Reddy 	{ "Sidetone Audio PGA", NULL, "Sidetone Audio Playback" },
6772f989f7eSM R Swami Reddy 	{ "Sidetone Voice PGA", NULL, "Sidetone Voice Playback" },
6782f989f7eSM R Swami Reddy 
6792f989f7eSM R Swami Reddy 	{ "RX1 Mixer", "ST1 Playback Switch", "Sidetone Audio PGA" },
6802f989f7eSM R Swami Reddy 
6812f989f7eSM R Swami Reddy 	{ "RX1 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
6822f989f7eSM R Swami Reddy 	{ "RX1 Mixer", "DL1 Playback Switch", "DL1" },
6832f989f7eSM R Swami Reddy 
6842f989f7eSM R Swami Reddy 	{ "RX2 Mixer", "ST2 Playback Switch", "Sidetone Audio PGA" },
6852f989f7eSM R Swami Reddy 
6862f989f7eSM R Swami Reddy 	{ "RX2 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
6872f989f7eSM R Swami Reddy 	{ "RX2 Mixer", "DL2 Playback Switch", "DL2" },
6882f989f7eSM R Swami Reddy 
6892f989f7eSM R Swami Reddy 	{ "RX3 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
6902f989f7eSM R Swami Reddy 	{ "RX3 Mixer", "DL3 Playback Switch", "DL3" },
6912f989f7eSM R Swami Reddy 
6922f989f7eSM R Swami Reddy 	{ "RX4 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
6932f989f7eSM R Swami Reddy 	{ "RX4 Mixer", "DL4 Playback Switch", "DL4" },
6942f989f7eSM R Swami Reddy 
6952f989f7eSM R Swami Reddy 	{ "RX5 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" },
6962f989f7eSM R Swami Reddy 	{ "RX5 Mixer", "DL5 Playback Switch", "DL5" },
6972f989f7eSM R Swami Reddy 
6982f989f7eSM R Swami Reddy 	{ "RX6 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" },
6992f989f7eSM R Swami Reddy 	{ "RX6 Mixer", "DL6 Playback Switch", "DL6" },
7002f989f7eSM R Swami Reddy 
7012f989f7eSM R Swami Reddy 	/* Capture path */
7022f989f7eSM R Swami Reddy 	{ "Analog Left Capture Route", "Headset Mic", "HSMIC" },
7032f989f7eSM R Swami Reddy 	{ "Analog Left Capture Route", "Main Mic", "MAINMIC" },
7042f989f7eSM R Swami Reddy 	{ "Analog Left Capture Route", "Aux/FM Left", "LINEIN1" },
7052f989f7eSM R Swami Reddy 
7062f989f7eSM R Swami Reddy 	{ "Analog Right Capture Route", "Sub Mic", "SUBMIC" },
7072f989f7eSM R Swami Reddy 	{ "Analog Right Capture Route", "Aux/FM Right", "LINEIN2" },
7082f989f7eSM R Swami Reddy 
7092f989f7eSM R Swami Reddy 	{ "MicAmp1", NULL, "Analog Left Capture Route" },
7102f989f7eSM R Swami Reddy 	{ "MicAmp2", NULL, "Analog Right Capture Route" },
7112f989f7eSM R Swami Reddy 
7122f989f7eSM R Swami Reddy 	{ "ADC1", NULL, "MicAmp1" },
7132f989f7eSM R Swami Reddy 	{ "ADC2", NULL, "MicAmp2" },
7142f989f7eSM R Swami Reddy 
7152f989f7eSM R Swami Reddy 	{ "ATX Select", "AMIC1", "ADC1" },
7162f989f7eSM R Swami Reddy 	{ "ATX Select", "DMIC", "DMICDAT" },
7172f989f7eSM R Swami Reddy 	{ "ATX Select", "AMIC2", "ADC2" },
7182f989f7eSM R Swami Reddy 
7192f989f7eSM R Swami Reddy 	{ "VTX Select", "AMIC1", "ADC1" },
7202f989f7eSM R Swami Reddy 	{ "VTX Select", "DMIC", "DMICDAT" },
7212f989f7eSM R Swami Reddy 	{ "VTX Select", "AMIC2", "ADC2" },
7222f989f7eSM R Swami Reddy 
7232f989f7eSM R Swami Reddy 	{ "ULATX1", "ATX1 Filter Enable Switch", "ATX Select" },
7242f989f7eSM R Swami Reddy 	{ "ULATX1", "ATX1 Filter Bypass Switch", "ATX Select" },
7252f989f7eSM R Swami Reddy 	{ "ULATX2", "ATX2 Filter Enable Switch", "ATX Select" },
7262f989f7eSM R Swami Reddy 	{ "ULATX2", "ATX2 Filter Bypass Switch", "ATX Select" },
7272f989f7eSM R Swami Reddy 
7282f989f7eSM R Swami Reddy 	{ "ULVTX1", "VTX1 Filter Enable Switch", "VTX Select" },
7292f989f7eSM R Swami Reddy 	{ "ULVTX1", "VTX1 Filter Bypass Switch", "VTX Select" },
7302f989f7eSM R Swami Reddy 	{ "ULVTX2", "VTX2 Filter Enable Switch", "VTX Select" },
7312f989f7eSM R Swami Reddy 	{ "ULVTX2", "VTX2 Filter Bypass Switch", "VTX Select" },
7322f989f7eSM R Swami Reddy 
7332f989f7eSM R Swami Reddy 	{ "INTF1_SDO", "ULATX12 Capture Switch", "ULATX1" },
7342f989f7eSM R Swami Reddy 	{ "INTF1_SDO", "ULATX12 Capture Switch", "ULATX2" },
7352f989f7eSM R Swami Reddy 	{ "INTF2_SDO", "ULATX12 Capture Switch", "ULATX1" },
7362f989f7eSM R Swami Reddy 	{ "INTF2_SDO", "ULATX12 Capture Switch", "ULATX2" },
7372f989f7eSM R Swami Reddy 
7382f989f7eSM R Swami Reddy 	{ "INTF1_SDO", NULL, "ULVTX1" },
7392f989f7eSM R Swami Reddy 	{ "INTF1_SDO", NULL, "ULVTX2" },
7402f989f7eSM R Swami Reddy 	{ "INTF2_SDO", NULL, "ULVTX1" },
7412f989f7eSM R Swami Reddy 	{ "INTF2_SDO", NULL, "ULVTX2" },
7422f989f7eSM R Swami Reddy 
7432f989f7eSM R Swami Reddy 	/* AFM Path */
7442f989f7eSM R Swami Reddy 	{ "APGA1", NULL, "LINEIN1" },
7452f989f7eSM R Swami Reddy 	{ "APGA2", NULL, "LINEIN2" },
7462f989f7eSM R Swami Reddy 
7472f989f7eSM R Swami Reddy 	{ "RX1 Playback", "VRX1 Filter Bypass Switch", "RX1 Mixer" },
7482f989f7eSM R Swami Reddy 	{ "RX1 Playback", "ARX1 Filter Bypass Switch", "RX1 Mixer" },
7492f989f7eSM R Swami Reddy 	{ "RX1 Playback", "RX1 Filter Enable Switch", "RX1 Mixer" },
7502f989f7eSM R Swami Reddy 
7512f989f7eSM R Swami Reddy 	{ "RX2 Playback", "VRX2 Filter Bypass Switch", "RX2 Mixer" },
7522f989f7eSM R Swami Reddy 	{ "RX2 Playback", "ARX2 Filter Bypass Switch", "RX2 Mixer" },
7532f989f7eSM R Swami Reddy 	{ "RX2 Playback", "RX2 Filter Enable Switch", "RX2 Mixer" },
7542f989f7eSM R Swami Reddy 
7552f989f7eSM R Swami Reddy 	{ "RX3 Playback", "ARX3 Filter Bypass Switch", "RX3 Mixer" },
7562f989f7eSM R Swami Reddy 	{ "RX3 Playback", "RX3 Filter Enable Switch", "RX3 Mixer" },
7572f989f7eSM R Swami Reddy 
7582f989f7eSM R Swami Reddy 	{ "RX4 Playback", "ARX4 Filter Bypass Switch", "RX4 Mixer" },
7592f989f7eSM R Swami Reddy 	{ "RX4 Playback", "RX4 Filter Enable Switch", "RX4 Mixer" },
7602f989f7eSM R Swami Reddy 
7612f989f7eSM R Swami Reddy 	{ "RX5 Playback", "ARX5 Filter Bypass Switch", "RX5 Mixer" },
7622f989f7eSM R Swami Reddy 	{ "RX5 Playback", "RX5 Filter Enable Switch", "RX5 Mixer" },
7632f989f7eSM R Swami Reddy 
7642f989f7eSM R Swami Reddy 	{ "RX6 Playback", "ARX6 Filter Bypass Switch", "RX6 Mixer" },
7652f989f7eSM R Swami Reddy 	{ "RX6 Playback", "RX6 Filter Enable Switch", "RX6 Mixer" },
7662f989f7eSM R Swami Reddy 
7672f989f7eSM R Swami Reddy 	{ "DPGA1L Mixer", "RX1 Playback Switch", "RX1 Playback" },
7682f989f7eSM R Swami Reddy 	{ "DPGA1L Mixer", "RX3 Playback Switch", "RX3 Playback" },
7692f989f7eSM R Swami Reddy 	{ "DPGA1L Mixer", "RX5 Playback Switch", "RX5 Playback" },
7702f989f7eSM R Swami Reddy 
7712f989f7eSM R Swami Reddy 	{ "DPGA1R Mixer", "RX2 Playback Switch", "RX2 Playback" },
7722f989f7eSM R Swami Reddy 	{ "DPGA1R Mixer", "RX4 Playback Switch", "RX4 Playback" },
7732f989f7eSM R Swami Reddy 	{ "DPGA1R Mixer", "RX6 Playback Switch", "RX6 Playback" },
7742f989f7eSM R Swami Reddy 
7752f989f7eSM R Swami Reddy 	{ "DPGA1L", NULL, "DPGA1L Mixer" },
7762f989f7eSM R Swami Reddy 	{ "DPGA1R", NULL, "DPGA1R Mixer" },
7772f989f7eSM R Swami Reddy 
7782f989f7eSM R Swami Reddy 	{ "DAC1L", NULL, "DPGA1L" },
7792f989f7eSM R Swami Reddy 	{ "DAC1R", NULL, "DPGA1R" },
7802f989f7eSM R Swami Reddy 
7812f989f7eSM R Swami Reddy 	{ "DPGA2L Mixer", "RX1 Playback Switch", "RX1 Playback" },
7822f989f7eSM R Swami Reddy 	{ "DPGA2L Mixer", "RX2 Playback Switch", "RX2 Playback" },
7832f989f7eSM R Swami Reddy 	{ "DPGA2L Mixer", "RX3 Playback Switch", "RX3 Playback" },
7842f989f7eSM R Swami Reddy 	{ "DPGA2L Mixer", "RX4 Playback Switch", "RX4 Playback" },
7852f989f7eSM R Swami Reddy 	{ "DPGA2L Mixer", "RX5 Playback Switch", "RX5 Playback" },
7862f989f7eSM R Swami Reddy 	{ "DPGA2L Mixer", "RX6 Playback Switch", "RX6 Playback" },
7872f989f7eSM R Swami Reddy 
7882f989f7eSM R Swami Reddy 	{ "DPGA2R Mixer", "RX2 Playback Switch", "RX2 Playback" },
7892f989f7eSM R Swami Reddy 	{ "DPGA2R Mixer", "RX4 Playback Switch", "RX4 Playback" },
7902f989f7eSM R Swami Reddy 	{ "DPGA2R Mixer", "RX6 Playback Switch", "RX6 Playback" },
7912f989f7eSM R Swami Reddy 
7922f989f7eSM R Swami Reddy 	{ "DPGA2L", NULL, "DPGA2L Mixer" },
7932f989f7eSM R Swami Reddy 	{ "DPGA2R", NULL, "DPGA2R Mixer" },
7942f989f7eSM R Swami Reddy 
7952f989f7eSM R Swami Reddy 	{ "DAC2L", NULL, "DPGA2L" },
7962f989f7eSM R Swami Reddy 	{ "DAC2R", NULL, "DPGA2R" },
7972f989f7eSM R Swami Reddy 
7982f989f7eSM R Swami Reddy 	{ "DPGA3L Mixer", "RX1 Playback Switch", "RX1 Playback" },
7992f989f7eSM R Swami Reddy 	{ "DPGA3L Mixer", "RX3 Playback Switch", "RX3 Playback" },
8002f989f7eSM R Swami Reddy 	{ "DPGA3L Mixer", "RX5 Playback Switch", "RX5 Playback" },
8012f989f7eSM R Swami Reddy 
8022f989f7eSM R Swami Reddy 	{ "DPGA3R Mixer", "RX2 Playback Switch", "RX2 Playback" },
8032f989f7eSM R Swami Reddy 	{ "DPGA3R Mixer", "RX4 Playback Switch", "RX4 Playback" },
8042f989f7eSM R Swami Reddy 	{ "DPGA3R Mixer", "RX6 Playback Switch", "RX6 Playback" },
8052f989f7eSM R Swami Reddy 
8062f989f7eSM R Swami Reddy 	{ "DPGA3L", NULL, "DPGA3L Mixer" },
8072f989f7eSM R Swami Reddy 	{ "DPGA3R", NULL, "DPGA3R Mixer" },
8082f989f7eSM R Swami Reddy 
8092f989f7eSM R Swami Reddy 	{ "DAC3L", NULL, "DPGA3L" },
8102f989f7eSM R Swami Reddy 	{ "DAC3R", NULL, "DPGA3R" },
8112f989f7eSM R Swami Reddy 
8122f989f7eSM R Swami Reddy 	{ "Headset Left Mixer", "DAC1L Playback Switch", "DAC1L" },
8132f989f7eSM R Swami Reddy 	{ "Headset Left Mixer", "APGA1 Playback Switch", "APGA1" },
8142f989f7eSM R Swami Reddy 
8152f989f7eSM R Swami Reddy 	{ "Headset Right Mixer", "DAC1R Playback Switch", "DAC1R" },
8162f989f7eSM R Swami Reddy 	{ "Headset Right Mixer", "APGA2 Playback Switch", "APGA2" },
8172f989f7eSM R Swami Reddy 
8182f989f7eSM R Swami Reddy 	{ "HS Left Driver", NULL, "Headset Left Mixer" },
8192f989f7eSM R Swami Reddy 	{ "HS Right Driver", NULL, "Headset Right Mixer" },
8202f989f7eSM R Swami Reddy 
8212f989f7eSM R Swami Reddy 	{ "HSOL", NULL, "HS Left Driver" },
8222f989f7eSM R Swami Reddy 	{ "HSOR", NULL, "HS Right Driver" },
8232f989f7eSM R Swami Reddy 
8242f989f7eSM R Swami Reddy 	/* Earphone playback path */
8252f989f7eSM R Swami Reddy 	{ "Earphone Mixer", "DAC2L Playback Switch", "DAC2L" },
8262f989f7eSM R Swami Reddy 	{ "Earphone Mixer", "APGA1 Playback Switch", "APGA1" },
8272f989f7eSM R Swami Reddy 
8282f989f7eSM R Swami Reddy 	{ "Earphone Playback", "Switch", "Earphone Mixer" },
8292f989f7eSM R Swami Reddy 	{ "Earphone Driver", NULL, "Earphone Playback" },
8302f989f7eSM R Swami Reddy 	{ "EP", NULL, "Earphone Driver" },
8312f989f7eSM R Swami Reddy 
8322f989f7eSM R Swami Reddy 	{ "Handsfree Left Mixer", "DAC2L Playback Switch", "DAC2L" },
8332f989f7eSM R Swami Reddy 	{ "Handsfree Left Mixer", "APGA1 Playback Switch", "APGA1" },
8342f989f7eSM R Swami Reddy 
8352f989f7eSM R Swami Reddy 	{ "Handsfree Right Mixer", "DAC2R Playback Switch", "DAC2R" },
8362f989f7eSM R Swami Reddy 	{ "Handsfree Right Mixer", "APGA2 Playback Switch", "APGA2" },
8372f989f7eSM R Swami Reddy 
8382f989f7eSM R Swami Reddy 	{ "HF Left PGA", NULL, "Handsfree Left Mixer" },
8392f989f7eSM R Swami Reddy 	{ "HF Right PGA", NULL, "Handsfree Right Mixer" },
8402f989f7eSM R Swami Reddy 
8412f989f7eSM R Swami Reddy 	{ "HF Left Driver", NULL, "HF Left PGA" },
8422f989f7eSM R Swami Reddy 	{ "HF Right Driver", NULL, "HF Right PGA" },
8432f989f7eSM R Swami Reddy 
8442f989f7eSM R Swami Reddy 	{ "HFL", NULL, "HF Left Driver" },
8452f989f7eSM R Swami Reddy 	{ "HFR", NULL, "HF Right Driver" },
8462f989f7eSM R Swami Reddy 
8472f989f7eSM R Swami Reddy 	{ "LINEOUT1 Mixer", "DAC3L Playback Switch", "DAC3L" },
8482f989f7eSM R Swami Reddy 	{ "LINEOUT1 Mixer", "APGA1 Playback Switch", "APGA1" },
8492f989f7eSM R Swami Reddy 
8502f989f7eSM R Swami Reddy 	{ "LINEOUT2 Mixer", "DAC3R Playback Switch", "DAC3R" },
8512f989f7eSM R Swami Reddy 	{ "LINEOUT2 Mixer", "APGA2 Playback Switch", "APGA2" },
8522f989f7eSM R Swami Reddy 
8532f989f7eSM R Swami Reddy 	{ "LINEOUT1 Driver", NULL, "LINEOUT1 Mixer" },
8542f989f7eSM R Swami Reddy 	{ "LINEOUT2 Driver", NULL, "LINEOUT2 Mixer" },
8552f989f7eSM R Swami Reddy 
8562f989f7eSM R Swami Reddy 	{ "LINEOUT1", NULL, "LINEOUT1 Driver" },
8572f989f7eSM R Swami Reddy 	{ "LINEOUT2", NULL, "LINEOUT2 Driver" },
8582f989f7eSM R Swami Reddy };
8592f989f7eSM R Swami Reddy 
8602f989f7eSM R Swami Reddy static int isabelle_hs_mute(struct snd_soc_dai *dai, int mute)
8612f989f7eSM R Swami Reddy {
8622f989f7eSM R Swami Reddy 	snd_soc_update_bits(dai->codec, ISABELLE_DAC1_SOFTRAMP_REG,
8632f989f7eSM R Swami Reddy 			BIT(4), (mute ? BIT(4) : 0));
8642f989f7eSM R Swami Reddy 
8652f989f7eSM R Swami Reddy 	return 0;
8662f989f7eSM R Swami Reddy }
8672f989f7eSM R Swami Reddy 
8682f989f7eSM R Swami Reddy static int isabelle_hf_mute(struct snd_soc_dai *dai, int mute)
8692f989f7eSM R Swami Reddy {
8702f989f7eSM R Swami Reddy 	snd_soc_update_bits(dai->codec, ISABELLE_DAC2_SOFTRAMP_REG,
8712f989f7eSM R Swami Reddy 			BIT(4), (mute ? BIT(4) : 0));
8722f989f7eSM R Swami Reddy 
8732f989f7eSM R Swami Reddy 	return 0;
8742f989f7eSM R Swami Reddy }
8752f989f7eSM R Swami Reddy 
8762f989f7eSM R Swami Reddy static int isabelle_line_mute(struct snd_soc_dai *dai, int mute)
8772f989f7eSM R Swami Reddy {
8782f989f7eSM R Swami Reddy 	snd_soc_update_bits(dai->codec, ISABELLE_DAC3_SOFTRAMP_REG,
8792f989f7eSM R Swami Reddy 			BIT(4), (mute ? BIT(4) : 0));
8802f989f7eSM R Swami Reddy 
8812f989f7eSM R Swami Reddy 	return 0;
8822f989f7eSM R Swami Reddy }
8832f989f7eSM R Swami Reddy 
8842f989f7eSM R Swami Reddy static int isabelle_set_bias_level(struct snd_soc_codec *codec,
8852f989f7eSM R Swami Reddy 				enum snd_soc_bias_level level)
8862f989f7eSM R Swami Reddy {
8872f989f7eSM R Swami Reddy 	switch (level) {
8882f989f7eSM R Swami Reddy 	case SND_SOC_BIAS_ON:
8892f989f7eSM R Swami Reddy 		break;
8902f989f7eSM R Swami Reddy 	case SND_SOC_BIAS_PREPARE:
8912f989f7eSM R Swami Reddy 		break;
8922f989f7eSM R Swami Reddy 
8932f989f7eSM R Swami Reddy 	case SND_SOC_BIAS_STANDBY:
8942f989f7eSM R Swami Reddy 		snd_soc_update_bits(codec, ISABELLE_PWR_EN_REG,
8952f989f7eSM R Swami Reddy 				ISABELLE_CHIP_EN, BIT(0));
8962f989f7eSM R Swami Reddy 		break;
8972f989f7eSM R Swami Reddy 
8982f989f7eSM R Swami Reddy 	case SND_SOC_BIAS_OFF:
8992f989f7eSM R Swami Reddy 		snd_soc_update_bits(codec, ISABELLE_PWR_EN_REG,
9002f989f7eSM R Swami Reddy 				ISABELLE_CHIP_EN, 0);
9012f989f7eSM R Swami Reddy 		break;
9022f989f7eSM R Swami Reddy 	}
9032f989f7eSM R Swami Reddy 
9042f989f7eSM R Swami Reddy 	codec->dapm.bias_level = level;
9052f989f7eSM R Swami Reddy 
9062f989f7eSM R Swami Reddy 	return 0;
9072f989f7eSM R Swami Reddy }
9082f989f7eSM R Swami Reddy 
9092f989f7eSM R Swami Reddy static int isabelle_hw_params(struct snd_pcm_substream *substream,
9102f989f7eSM R Swami Reddy 			      struct snd_pcm_hw_params *params,
9112f989f7eSM R Swami Reddy 			      struct snd_soc_dai *dai)
9122f989f7eSM R Swami Reddy {
9132f989f7eSM R Swami Reddy 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
9142f989f7eSM R Swami Reddy 	struct snd_soc_codec *codec = rtd->codec;
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 
9502f989f7eSM R Swami Reddy 	snd_soc_update_bits(codec, 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 
9652f989f7eSM R Swami Reddy 	snd_soc_update_bits(codec, 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 
9712f989f7eSM R Swami Reddy static int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
9722f989f7eSM R Swami Reddy {
9732f989f7eSM R Swami Reddy 	struct snd_soc_codec *codec = codec_dai->codec;
9742f989f7eSM R Swami Reddy 	unsigned int aif_val = 0;
9752f989f7eSM R Swami Reddy 
9762f989f7eSM R Swami Reddy 	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
9772f989f7eSM R Swami Reddy 	case SND_SOC_DAIFMT_CBS_CFS:
9782f989f7eSM R Swami Reddy 		aif_val &= ~ISABELLE_AIF_MS;
9792f989f7eSM R Swami Reddy 		break;
9802f989f7eSM R Swami Reddy 	case SND_SOC_DAIFMT_CBM_CFM:
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 
10012f989f7eSM R Swami Reddy 	snd_soc_update_bits(codec, 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 
10142f989f7eSM R Swami Reddy static 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,
10172f989f7eSM R Swami Reddy 	.digital_mute	= isabelle_hs_mute,
10182f989f7eSM R Swami Reddy };
10192f989f7eSM R Swami Reddy 
10202f989f7eSM R Swami Reddy static struct snd_soc_dai_ops isabelle_hf_dai_ops = {
10212f989f7eSM R Swami Reddy 	.hw_params	= isabelle_hw_params,
10222f989f7eSM R Swami Reddy 	.set_fmt	= isabelle_set_dai_fmt,
10232f989f7eSM R Swami Reddy 	.digital_mute	= isabelle_hf_mute,
10242f989f7eSM R Swami Reddy };
10252f989f7eSM R Swami Reddy 
10262f989f7eSM R Swami Reddy static struct snd_soc_dai_ops isabelle_line_dai_ops = {
10272f989f7eSM R Swami Reddy 	.hw_params	= isabelle_hw_params,
10282f989f7eSM R Swami Reddy 	.set_fmt	= isabelle_set_dai_fmt,
10292f989f7eSM R Swami Reddy 	.digital_mute	= isabelle_line_mute,
10302f989f7eSM R Swami Reddy };
10312f989f7eSM R Swami Reddy 
10322f989f7eSM R Swami Reddy static struct snd_soc_dai_ops isabelle_ul_dai_ops = {
10332f989f7eSM R Swami Reddy 	.hw_params	= isabelle_hw_params,
10342f989f7eSM R Swami Reddy 	.set_fmt	= isabelle_set_dai_fmt,
10352f989f7eSM R Swami Reddy };
10362f989f7eSM R Swami Reddy 
10372f989f7eSM R Swami Reddy /* ISABELLE dai structure */
1038bb1591b3SMark Brown static struct snd_soc_dai_driver isabelle_dai[] = {
10392f989f7eSM R Swami Reddy 	{
10402f989f7eSM R Swami Reddy 		.name = "isabelle-dl1",
10412f989f7eSM R Swami Reddy 		.playback = {
10422f989f7eSM R Swami Reddy 			.stream_name = "Headset Playback",
10432f989f7eSM R Swami Reddy 			.channels_min = 1,
10442f989f7eSM R Swami Reddy 			.channels_max = 2,
10452f989f7eSM R Swami Reddy 			.rates = ISABELLE_RATES,
10462f989f7eSM R Swami Reddy 			.formats = ISABELLE_FORMATS,
10472f989f7eSM R Swami Reddy 		},
10482f989f7eSM R Swami Reddy 		.ops = &isabelle_hs_dai_ops,
10492f989f7eSM R Swami Reddy 	},
10502f989f7eSM R Swami Reddy 	{
10512f989f7eSM R Swami Reddy 		.name = "isabelle-dl2",
10522f989f7eSM R Swami Reddy 		.playback = {
10532f989f7eSM R Swami Reddy 			.stream_name = "Handsfree Playback",
10542f989f7eSM R Swami Reddy 			.channels_min = 1,
10552f989f7eSM R Swami Reddy 			.channels_max = 2,
10562f989f7eSM R Swami Reddy 			.rates = ISABELLE_RATES,
10572f989f7eSM R Swami Reddy 			.formats = ISABELLE_FORMATS,
10582f989f7eSM R Swami Reddy 		},
10592f989f7eSM R Swami Reddy 		.ops = &isabelle_hf_dai_ops,
10602f989f7eSM R Swami Reddy 	},
10612f989f7eSM R Swami Reddy 	{
10622f989f7eSM R Swami Reddy 		.name = "isabelle-lineout",
10632f989f7eSM R Swami Reddy 		.playback = {
10642f989f7eSM R Swami Reddy 			.stream_name = "Lineout Playback",
10652f989f7eSM R Swami Reddy 			.channels_min = 1,
10662f989f7eSM R Swami Reddy 			.channels_max = 2,
10672f989f7eSM R Swami Reddy 			.rates = ISABELLE_RATES,
10682f989f7eSM R Swami Reddy 			.formats = ISABELLE_FORMATS,
10692f989f7eSM R Swami Reddy 		},
10702f989f7eSM R Swami Reddy 		.ops = &isabelle_line_dai_ops,
10712f989f7eSM R Swami Reddy 	},
10722f989f7eSM R Swami Reddy 	{
10732f989f7eSM R Swami Reddy 		.name = "isabelle-ul",
10742f989f7eSM R Swami Reddy 		.capture = {
10752f989f7eSM R Swami Reddy 			.stream_name = "Capture",
10762f989f7eSM R Swami Reddy 			.channels_min = 1,
10772f989f7eSM R Swami Reddy 			.channels_max = 2,
10782f989f7eSM R Swami Reddy 			.rates = ISABELLE_RATES,
10792f989f7eSM R Swami Reddy 			.formats = ISABELLE_FORMATS,
10802f989f7eSM R Swami Reddy 		},
10812f989f7eSM R Swami Reddy 		.ops = &isabelle_ul_dai_ops,
10822f989f7eSM R Swami Reddy 	},
10832f989f7eSM R Swami Reddy };
10842f989f7eSM R Swami Reddy 
10852f989f7eSM R Swami Reddy static int isabelle_probe(struct snd_soc_codec *codec)
10862f989f7eSM R Swami Reddy {
10872f989f7eSM R Swami Reddy 	int ret = 0;
10882f989f7eSM R Swami Reddy 
10892f989f7eSM R Swami Reddy 	codec->control_data = dev_get_regmap(codec->dev, NULL);
10902f989f7eSM R Swami Reddy 
10912f989f7eSM R Swami Reddy 	ret = snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
10922f989f7eSM R Swami Reddy 	if (ret < 0) {
10932f989f7eSM R Swami Reddy 		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
10942f989f7eSM R Swami Reddy 		return ret;
10952f989f7eSM R Swami Reddy 	}
10962f989f7eSM R Swami Reddy 
10972f989f7eSM R Swami Reddy 	return 0;
10982f989f7eSM R Swami Reddy }
10992f989f7eSM R Swami Reddy 
11002f989f7eSM R Swami Reddy static struct snd_soc_codec_driver soc_codec_dev_isabelle = {
11012f989f7eSM R Swami Reddy 	.probe = isabelle_probe,
11022f989f7eSM R Swami Reddy 	.set_bias_level = isabelle_set_bias_level,
11032f989f7eSM R Swami Reddy 	.controls = isabelle_snd_controls,
11042f989f7eSM R Swami Reddy 	.num_controls = ARRAY_SIZE(isabelle_snd_controls),
11052f989f7eSM R Swami Reddy 	.dapm_widgets = isabelle_dapm_widgets,
11062f989f7eSM R Swami Reddy 	.num_dapm_widgets = ARRAY_SIZE(isabelle_dapm_widgets),
11072f989f7eSM R Swami Reddy 	.dapm_routes = isabelle_intercon,
11082f989f7eSM R Swami Reddy 	.num_dapm_routes = ARRAY_SIZE(isabelle_intercon),
11092f989f7eSM R Swami Reddy 	.idle_bias_off = true,
11102f989f7eSM R Swami Reddy };
11112f989f7eSM R Swami Reddy 
11122f989f7eSM R Swami Reddy static const struct regmap_config isabelle_regmap_config = {
11132f989f7eSM R Swami Reddy 	.reg_bits = 8,
11142f989f7eSM R Swami Reddy 	.val_bits = 8,
11152f989f7eSM R Swami Reddy 
11162f989f7eSM R Swami Reddy 	.max_register = ISABELLE_MAX_REGISTER,
11172f989f7eSM R Swami Reddy 	.reg_defaults = isabelle_reg_defs,
11182f989f7eSM R Swami Reddy 	.num_reg_defaults = ARRAY_SIZE(isabelle_reg_defs),
11192f989f7eSM R Swami Reddy 	.cache_type = REGCACHE_RBTREE,
11202f989f7eSM R Swami Reddy };
11212f989f7eSM R Swami Reddy 
1122c88f3de8SBill Pemberton static int isabelle_i2c_probe(struct i2c_client *i2c,
11232f989f7eSM R Swami Reddy 			      const struct i2c_device_id *id)
11242f989f7eSM R Swami Reddy {
11252f989f7eSM R Swami Reddy 	struct regmap *isabelle_regmap;
11262f989f7eSM R Swami Reddy 	int ret = 0;
11272f989f7eSM R Swami Reddy 
11282f989f7eSM R Swami Reddy 	isabelle_regmap = devm_regmap_init_i2c(i2c, &isabelle_regmap_config);
11292f989f7eSM R Swami Reddy 	if (IS_ERR(isabelle_regmap)) {
11302f989f7eSM R Swami Reddy 		ret = PTR_ERR(isabelle_regmap);
11312f989f7eSM R Swami Reddy 		dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
11322f989f7eSM R Swami Reddy 			ret);
11332f989f7eSM R Swami Reddy 		return ret;
11342f989f7eSM R Swami Reddy 	}
113540820105SDan Carpenter 	i2c_set_clientdata(i2c, isabelle_regmap);
11362f989f7eSM R Swami Reddy 
11372f989f7eSM R Swami Reddy 	ret =  snd_soc_register_codec(&i2c->dev,
11382f989f7eSM R Swami Reddy 				&soc_codec_dev_isabelle, isabelle_dai,
11392f989f7eSM R Swami Reddy 				ARRAY_SIZE(isabelle_dai));
11402f989f7eSM R Swami Reddy 	if (ret < 0) {
11412f989f7eSM R Swami Reddy 		dev_err(&i2c->dev, "Failed to register codec: %d\n", ret);
11422f989f7eSM R Swami Reddy 		return ret;
11432f989f7eSM R Swami Reddy 	}
11442f989f7eSM R Swami Reddy 
11452f989f7eSM R Swami Reddy 	return ret;
11462f989f7eSM R Swami Reddy }
11472f989f7eSM R Swami Reddy 
1148c88f3de8SBill Pemberton static int isabelle_i2c_remove(struct i2c_client *client)
11492f989f7eSM R Swami Reddy {
11502f989f7eSM R Swami Reddy 	snd_soc_unregister_codec(&client->dev);
11512f989f7eSM R Swami Reddy 	return 0;
11522f989f7eSM R Swami Reddy }
11532f989f7eSM R Swami Reddy 
11542f989f7eSM R Swami Reddy static const struct i2c_device_id isabelle_i2c_id[] = {
11552f989f7eSM R Swami Reddy 	{ "isabelle", 0 },
11562f989f7eSM R Swami Reddy 	{ }
11572f989f7eSM R Swami Reddy };
11582f989f7eSM R Swami Reddy MODULE_DEVICE_TABLE(i2c, isabelle_i2c_id);
11592f989f7eSM R Swami Reddy 
11602f989f7eSM R Swami Reddy static struct i2c_driver isabelle_i2c_driver = {
11612f989f7eSM R Swami Reddy 	.driver = {
11622f989f7eSM R Swami Reddy 		.name = "isabelle",
11632f989f7eSM R Swami Reddy 		.owner = THIS_MODULE,
11642f989f7eSM R Swami Reddy 	},
11652f989f7eSM R Swami Reddy 	.probe = isabelle_i2c_probe,
1166c88f3de8SBill Pemberton 	.remove = isabelle_i2c_remove,
11672f989f7eSM R Swami Reddy 	.id_table = isabelle_i2c_id,
11682f989f7eSM R Swami Reddy };
11692f989f7eSM R Swami Reddy 
11702f989f7eSM R Swami Reddy module_i2c_driver(isabelle_i2c_driver);
11712f989f7eSM R Swami Reddy 
11722f989f7eSM R Swami Reddy MODULE_DESCRIPTION("ASoC ISABELLE driver");
11732f989f7eSM R Swami Reddy MODULE_AUTHOR("Vishwas A Deshpande <vishwas.a.deshpande@ti.com>");
11742f989f7eSM R Swami Reddy MODULE_AUTHOR("M R Swami Reddy <MR.Swami.Reddy@ti.com>");
11752f989f7eSM R Swami Reddy MODULE_LICENSE("GPL v2");
1176