18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * isabelle.c - Low power high fidelity audio codec driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2012 Texas Instruments, Inc 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Initially based on sound/soc/codecs/twl6040.c 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci#include <linux/module.h> 108c2ecf20Sopenharmony_ci#include <linux/moduleparam.h> 118c2ecf20Sopenharmony_ci#include <linux/kernel.h> 128c2ecf20Sopenharmony_ci#include <linux/init.h> 138c2ecf20Sopenharmony_ci#include <linux/delay.h> 148c2ecf20Sopenharmony_ci#include <linux/pm.h> 158c2ecf20Sopenharmony_ci#include <linux/regmap.h> 168c2ecf20Sopenharmony_ci#include <linux/i2c.h> 178c2ecf20Sopenharmony_ci#include <linux/slab.h> 188c2ecf20Sopenharmony_ci#include <sound/core.h> 198c2ecf20Sopenharmony_ci#include <sound/pcm.h> 208c2ecf20Sopenharmony_ci#include <sound/pcm_params.h> 218c2ecf20Sopenharmony_ci#include <sound/soc.h> 228c2ecf20Sopenharmony_ci#include <sound/soc-dapm.h> 238c2ecf20Sopenharmony_ci#include <sound/tlv.h> 248c2ecf20Sopenharmony_ci#include <sound/jack.h> 258c2ecf20Sopenharmony_ci#include <sound/initval.h> 268c2ecf20Sopenharmony_ci#include <asm/div64.h> 278c2ecf20Sopenharmony_ci#include "isabelle.h" 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* Register default values for ISABELLE driver. */ 318c2ecf20Sopenharmony_cistatic const struct reg_default isabelle_reg_defs[] = { 328c2ecf20Sopenharmony_ci { 0, 0x00 }, 338c2ecf20Sopenharmony_ci { 1, 0x00 }, 348c2ecf20Sopenharmony_ci { 2, 0x00 }, 358c2ecf20Sopenharmony_ci { 3, 0x00 }, 368c2ecf20Sopenharmony_ci { 4, 0x00 }, 378c2ecf20Sopenharmony_ci { 5, 0x00 }, 388c2ecf20Sopenharmony_ci { 6, 0x00 }, 398c2ecf20Sopenharmony_ci { 7, 0x00 }, 408c2ecf20Sopenharmony_ci { 8, 0x00 }, 418c2ecf20Sopenharmony_ci { 9, 0x00 }, 428c2ecf20Sopenharmony_ci { 10, 0x00 }, 438c2ecf20Sopenharmony_ci { 11, 0x00 }, 448c2ecf20Sopenharmony_ci { 12, 0x00 }, 458c2ecf20Sopenharmony_ci { 13, 0x00 }, 468c2ecf20Sopenharmony_ci { 14, 0x00 }, 478c2ecf20Sopenharmony_ci { 15, 0x00 }, 488c2ecf20Sopenharmony_ci { 16, 0x00 }, 498c2ecf20Sopenharmony_ci { 17, 0x00 }, 508c2ecf20Sopenharmony_ci { 18, 0x00 }, 518c2ecf20Sopenharmony_ci { 19, 0x00 }, 528c2ecf20Sopenharmony_ci { 20, 0x00 }, 538c2ecf20Sopenharmony_ci { 21, 0x02 }, 548c2ecf20Sopenharmony_ci { 22, 0x02 }, 558c2ecf20Sopenharmony_ci { 23, 0x02 }, 568c2ecf20Sopenharmony_ci { 24, 0x02 }, 578c2ecf20Sopenharmony_ci { 25, 0x0F }, 588c2ecf20Sopenharmony_ci { 26, 0x8F }, 598c2ecf20Sopenharmony_ci { 27, 0x0F }, 608c2ecf20Sopenharmony_ci { 28, 0x8F }, 618c2ecf20Sopenharmony_ci { 29, 0x00 }, 628c2ecf20Sopenharmony_ci { 30, 0x00 }, 638c2ecf20Sopenharmony_ci { 31, 0x00 }, 648c2ecf20Sopenharmony_ci { 32, 0x00 }, 658c2ecf20Sopenharmony_ci { 33, 0x00 }, 668c2ecf20Sopenharmony_ci { 34, 0x00 }, 678c2ecf20Sopenharmony_ci { 35, 0x00 }, 688c2ecf20Sopenharmony_ci { 36, 0x00 }, 698c2ecf20Sopenharmony_ci { 37, 0x00 }, 708c2ecf20Sopenharmony_ci { 38, 0x00 }, 718c2ecf20Sopenharmony_ci { 39, 0x00 }, 728c2ecf20Sopenharmony_ci { 40, 0x00 }, 738c2ecf20Sopenharmony_ci { 41, 0x00 }, 748c2ecf20Sopenharmony_ci { 42, 0x00 }, 758c2ecf20Sopenharmony_ci { 43, 0x00 }, 768c2ecf20Sopenharmony_ci { 44, 0x00 }, 778c2ecf20Sopenharmony_ci { 45, 0x00 }, 788c2ecf20Sopenharmony_ci { 46, 0x00 }, 798c2ecf20Sopenharmony_ci { 47, 0x00 }, 808c2ecf20Sopenharmony_ci { 48, 0x00 }, 818c2ecf20Sopenharmony_ci { 49, 0x00 }, 828c2ecf20Sopenharmony_ci { 50, 0x00 }, 838c2ecf20Sopenharmony_ci { 51, 0x00 }, 848c2ecf20Sopenharmony_ci { 52, 0x00 }, 858c2ecf20Sopenharmony_ci { 53, 0x00 }, 868c2ecf20Sopenharmony_ci { 54, 0x00 }, 878c2ecf20Sopenharmony_ci { 55, 0x00 }, 888c2ecf20Sopenharmony_ci { 56, 0x00 }, 898c2ecf20Sopenharmony_ci { 57, 0x00 }, 908c2ecf20Sopenharmony_ci { 58, 0x00 }, 918c2ecf20Sopenharmony_ci { 59, 0x00 }, 928c2ecf20Sopenharmony_ci { 60, 0x00 }, 938c2ecf20Sopenharmony_ci { 61, 0x00 }, 948c2ecf20Sopenharmony_ci { 62, 0x00 }, 958c2ecf20Sopenharmony_ci { 63, 0x00 }, 968c2ecf20Sopenharmony_ci { 64, 0x00 }, 978c2ecf20Sopenharmony_ci { 65, 0x00 }, 988c2ecf20Sopenharmony_ci { 66, 0x00 }, 998c2ecf20Sopenharmony_ci { 67, 0x00 }, 1008c2ecf20Sopenharmony_ci { 68, 0x00 }, 1018c2ecf20Sopenharmony_ci { 69, 0x90 }, 1028c2ecf20Sopenharmony_ci { 70, 0x90 }, 1038c2ecf20Sopenharmony_ci { 71, 0x90 }, 1048c2ecf20Sopenharmony_ci { 72, 0x00 }, 1058c2ecf20Sopenharmony_ci { 73, 0x00 }, 1068c2ecf20Sopenharmony_ci { 74, 0x00 }, 1078c2ecf20Sopenharmony_ci { 75, 0x00 }, 1088c2ecf20Sopenharmony_ci { 76, 0x00 }, 1098c2ecf20Sopenharmony_ci { 77, 0x00 }, 1108c2ecf20Sopenharmony_ci { 78, 0x00 }, 1118c2ecf20Sopenharmony_ci { 79, 0x00 }, 1128c2ecf20Sopenharmony_ci { 80, 0x00 }, 1138c2ecf20Sopenharmony_ci { 81, 0x00 }, 1148c2ecf20Sopenharmony_ci { 82, 0x00 }, 1158c2ecf20Sopenharmony_ci { 83, 0x00 }, 1168c2ecf20Sopenharmony_ci { 84, 0x00 }, 1178c2ecf20Sopenharmony_ci { 85, 0x07 }, 1188c2ecf20Sopenharmony_ci { 86, 0x00 }, 1198c2ecf20Sopenharmony_ci { 87, 0x00 }, 1208c2ecf20Sopenharmony_ci { 88, 0x00 }, 1218c2ecf20Sopenharmony_ci { 89, 0x07 }, 1228c2ecf20Sopenharmony_ci { 90, 0x80 }, 1238c2ecf20Sopenharmony_ci { 91, 0x07 }, 1248c2ecf20Sopenharmony_ci { 92, 0x07 }, 1258c2ecf20Sopenharmony_ci { 93, 0x00 }, 1268c2ecf20Sopenharmony_ci { 94, 0x00 }, 1278c2ecf20Sopenharmony_ci { 95, 0x00 }, 1288c2ecf20Sopenharmony_ci { 96, 0x00 }, 1298c2ecf20Sopenharmony_ci { 97, 0x00 }, 1308c2ecf20Sopenharmony_ci { 98, 0x00 }, 1318c2ecf20Sopenharmony_ci { 99, 0x00 }, 1328c2ecf20Sopenharmony_ci}; 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_cistatic const char *isabelle_rx1_texts[] = {"VRX1", "ARX1"}; 1358c2ecf20Sopenharmony_cistatic const char *isabelle_rx2_texts[] = {"VRX2", "ARX2"}; 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_cistatic const struct soc_enum isabelle_rx1_enum[] = { 1388c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, 1398c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts), 1408c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, 1418c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts), 1428c2ecf20Sopenharmony_ci}; 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_cistatic const struct soc_enum isabelle_rx2_enum[] = { 1458c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2, 1468c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts), 1478c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4, 1488c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts), 1498c2ecf20Sopenharmony_ci}; 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci/* Headset DAC playback switches */ 1528c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new rx1_mux_controls = 1538c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_rx1_enum); 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new rx2_mux_controls = 1568c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_rx2_enum); 1578c2ecf20Sopenharmony_ci 1588c2ecf20Sopenharmony_ci/* TX input selection */ 1598c2ecf20Sopenharmony_cistatic const char *isabelle_atx_texts[] = {"AMIC1", "DMIC"}; 1608c2ecf20Sopenharmony_cistatic const char *isabelle_vtx_texts[] = {"AMIC2", "DMIC"}; 1618c2ecf20Sopenharmony_ci 1628c2ecf20Sopenharmony_cistatic const struct soc_enum isabelle_atx_enum[] = { 1638c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7, 1648c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts), 1658c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1668c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts), 1678c2ecf20Sopenharmony_ci}; 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_cistatic const struct soc_enum isabelle_vtx_enum[] = { 1708c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6, 1718c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts), 1728c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1738c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts), 1748c2ecf20Sopenharmony_ci}; 1758c2ecf20Sopenharmony_ci 1768c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new atx_mux_controls = 1778c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_atx_enum); 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new vtx_mux_controls = 1808c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_vtx_enum); 1818c2ecf20Sopenharmony_ci 1828c2ecf20Sopenharmony_ci/* Left analog microphone selection */ 1838c2ecf20Sopenharmony_cistatic const char *isabelle_amic1_texts[] = { 1848c2ecf20Sopenharmony_ci "Main Mic", "Headset Mic", "Aux/FM Left"}; 1858c2ecf20Sopenharmony_ci 1868c2ecf20Sopenharmony_ci/* Left analog microphone selection */ 1878c2ecf20Sopenharmony_cistatic const char *isabelle_amic2_texts[] = {"Sub Mic", "Aux/FM Right"}; 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_cistatic SOC_ENUM_SINGLE_DECL(isabelle_amic1_enum, 1908c2ecf20Sopenharmony_ci ISABELLE_AMIC_CFG_REG, 5, 1918c2ecf20Sopenharmony_ci isabelle_amic1_texts); 1928c2ecf20Sopenharmony_ci 1938c2ecf20Sopenharmony_cistatic SOC_ENUM_SINGLE_DECL(isabelle_amic2_enum, 1948c2ecf20Sopenharmony_ci ISABELLE_AMIC_CFG_REG, 4, 1958c2ecf20Sopenharmony_ci isabelle_amic2_texts); 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new amic1_control = 1988c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_amic1_enum); 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new amic2_control = 2018c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_amic2_enum); 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_cistatic const char *isabelle_st_audio_texts[] = {"ATX1", "ATX2"}; 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_cistatic const char *isabelle_st_voice_texts[] = {"VTX1", "VTX2"}; 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_cistatic const struct soc_enum isabelle_st_audio_enum[] = { 2088c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7, 2098c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_st_audio_texts), 2108c2ecf20Sopenharmony_ci isabelle_st_audio_texts), 2118c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7, 2128c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_st_audio_texts), 2138c2ecf20Sopenharmony_ci isabelle_st_audio_texts), 2148c2ecf20Sopenharmony_ci}; 2158c2ecf20Sopenharmony_ci 2168c2ecf20Sopenharmony_cistatic const struct soc_enum isabelle_st_voice_enum[] = { 2178c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7, 2188c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_st_voice_texts), 2198c2ecf20Sopenharmony_ci isabelle_st_voice_texts), 2208c2ecf20Sopenharmony_ci SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7, 2218c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_st_voice_texts), 2228c2ecf20Sopenharmony_ci isabelle_st_voice_texts), 2238c2ecf20Sopenharmony_ci}; 2248c2ecf20Sopenharmony_ci 2258c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new st_audio_control = 2268c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_st_audio_enum); 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new st_voice_control = 2298c2ecf20Sopenharmony_ci SOC_DAPM_ENUM("Route", isabelle_st_voice_enum); 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_ci/* Mixer controls */ 2328c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_hs_left_mixer_controls[] = { 2338c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DAC1L Playback Switch", ISABELLE_HSDRV_CFG1_REG, 7, 1, 0), 2348c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 6, 1, 0), 2358c2ecf20Sopenharmony_ci}; 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_hs_right_mixer_controls[] = { 2388c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DAC1R Playback Switch", ISABELLE_HSDRV_CFG1_REG, 5, 1, 0), 2398c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HSDRV_CFG1_REG, 4, 1, 0), 2408c2ecf20Sopenharmony_ci}; 2418c2ecf20Sopenharmony_ci 2428c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_hf_left_mixer_controls[] = { 2438c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_HFLPGA_CFG_REG, 7, 1, 0), 2448c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_HFLPGA_CFG_REG, 6, 1, 0), 2458c2ecf20Sopenharmony_ci}; 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_hf_right_mixer_controls[] = { 2488c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DAC2R Playback Switch", ISABELLE_HFRPGA_CFG_REG, 7, 1, 0), 2498c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_HFRPGA_CFG_REG, 6, 1, 0), 2508c2ecf20Sopenharmony_ci}; 2518c2ecf20Sopenharmony_ci 2528c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_ep_mixer_controls[] = { 2538c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DAC2L Playback Switch", ISABELLE_EARDRV_CFG1_REG, 7, 1, 0), 2548c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_EARDRV_CFG1_REG, 6, 1, 0), 2558c2ecf20Sopenharmony_ci}; 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_aux_left_mixer_controls[] = { 2588c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DAC3L Playback Switch", ISABELLE_LINEAMP_CFG_REG, 7, 1, 0), 2598c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("APGA1 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 6, 1, 0), 2608c2ecf20Sopenharmony_ci}; 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_aux_right_mixer_controls[] = { 2638c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DAC3R Playback Switch", ISABELLE_LINEAMP_CFG_REG, 5, 1, 0), 2648c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("APGA2 Playback Switch", ISABELLE_LINEAMP_CFG_REG, 4, 1, 0), 2658c2ecf20Sopenharmony_ci}; 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_dpga1_left_mixer_controls[] = { 2688c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 7, 1, 0), 2698c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 6, 1, 0), 2708c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 5, 1, 0), 2718c2ecf20Sopenharmony_ci}; 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_dpga1_right_mixer_controls[] = { 2748c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 3, 1, 0), 2758c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 2, 1, 0), 2768c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA1LR_IN_SEL_REG, 1, 1, 0), 2778c2ecf20Sopenharmony_ci}; 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_dpga2_left_mixer_controls[] = { 2808c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 7, 1, 0), 2818c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 6, 1, 0), 2828c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 5, 1, 0), 2838c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 4, 1, 0), 2848c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 3, 1, 0), 2858c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2L_IN_SEL_REG, 2, 1, 0), 2868c2ecf20Sopenharmony_ci}; 2878c2ecf20Sopenharmony_ci 2888c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_dpga2_right_mixer_controls[] = { 2898c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("USNC Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 7, 1, 0), 2908c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 3, 1, 0), 2918c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 2, 1, 0), 2928c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA2R_IN_SEL_REG, 1, 1, 0), 2938c2ecf20Sopenharmony_ci}; 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_dpga3_left_mixer_controls[] = { 2968c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX1 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 7, 1, 0), 2978c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX3 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 6, 1, 0), 2988c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX5 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 5, 1, 0), 2998c2ecf20Sopenharmony_ci}; 3008c2ecf20Sopenharmony_ci 3018c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_dpga3_right_mixer_controls[] = { 3028c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX2 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 3, 1, 0), 3038c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX4 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 2, 1, 0), 3048c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("RX6 Playback Switch", ISABELLE_DPGA3LR_IN_SEL_REG, 1, 1, 0), 3058c2ecf20Sopenharmony_ci}; 3068c2ecf20Sopenharmony_ci 3078c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_rx1_mixer_controls[] = { 3088c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 7, 1, 0), 3098c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DL1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 6, 1, 0), 3108c2ecf20Sopenharmony_ci}; 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_rx2_mixer_controls[] = { 3138c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 5, 1, 0), 3148c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DL2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 4, 1, 0), 3158c2ecf20Sopenharmony_ci}; 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_rx3_mixer_controls[] = { 3188c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 3, 1, 0), 3198c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DL3 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 2, 1, 0), 3208c2ecf20Sopenharmony_ci}; 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_rx4_mixer_controls[] = { 3238c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 1, 1, 0), 3248c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DL4 Playback Switch", ISABELLE_RX_INPUT_CFG_REG, 0, 1, 0), 3258c2ecf20Sopenharmony_ci}; 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_rx5_mixer_controls[] = { 3288c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ST1 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 7, 1, 0), 3298c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DL5 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 6, 1, 0), 3308c2ecf20Sopenharmony_ci}; 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_rx6_mixer_controls[] = { 3338c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ST2 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 5, 1, 0), 3348c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DL6 Playback Switch", ISABELLE_RX_INPUT_CFG2_REG, 4, 1, 0), 3358c2ecf20Sopenharmony_ci}; 3368c2ecf20Sopenharmony_ci 3378c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new ep_path_enable_control = 3388c2ecf20Sopenharmony_ci SOC_DAPM_SINGLE("Switch", ISABELLE_EARDRV_CFG2_REG, 0, 1, 0); 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_ci/* TLV Declarations */ 3418c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(mic_amp_tlv, 0, 100, 0); 3428c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(afm_amp_tlv, -3300, 300, 0); 3438c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(dac_tlv, -1200, 200, 0); 3448c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(hf_tlv, -5000, 200, 0); 3458c2ecf20Sopenharmony_ci 3468c2ecf20Sopenharmony_ci/* from -63 to 0 dB in 1 dB steps */ 3478c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(dpga_tlv, -6300, 100, 1); 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ci/* from -63 to 9 dB in 1 dB steps */ 3508c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(rx_tlv, -6300, 100, 1); 3518c2ecf20Sopenharmony_ci 3528c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(st_tlv, -2700, 300, 1); 3538c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(tx_tlv, -600, 100, 0); 3548c2ecf20Sopenharmony_ci 3558c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new isabelle_snd_controls[] = { 3568c2ecf20Sopenharmony_ci SOC_DOUBLE_TLV("Headset Playback Volume", ISABELLE_HSDRV_GAIN_REG, 3578c2ecf20Sopenharmony_ci 4, 0, 0xF, 0, dac_tlv), 3588c2ecf20Sopenharmony_ci SOC_DOUBLE_R_TLV("Handsfree Playback Volume", 3598c2ecf20Sopenharmony_ci ISABELLE_HFLPGA_CFG_REG, ISABELLE_HFRPGA_CFG_REG, 3608c2ecf20Sopenharmony_ci 0, 0x1F, 0, hf_tlv), 3618c2ecf20Sopenharmony_ci SOC_DOUBLE_TLV("Aux Playback Volume", ISABELLE_LINEAMP_GAIN_REG, 3628c2ecf20Sopenharmony_ci 4, 0, 0xF, 0, dac_tlv), 3638c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Earpiece Playback Volume", ISABELLE_EARDRV_CFG1_REG, 3648c2ecf20Sopenharmony_ci 0, 0xF, 0, dac_tlv), 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_ci SOC_DOUBLE_TLV("Aux FM Volume", ISABELLE_APGA_GAIN_REG, 4, 0, 0xF, 0, 3678c2ecf20Sopenharmony_ci afm_amp_tlv), 3688c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Mic1 Capture Volume", ISABELLE_MIC1_GAIN_REG, 3, 0x1F, 3698c2ecf20Sopenharmony_ci 0, mic_amp_tlv), 3708c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Mic2 Capture Volume", ISABELLE_MIC2_GAIN_REG, 3, 0x1F, 3718c2ecf20Sopenharmony_ci 0, mic_amp_tlv), 3728c2ecf20Sopenharmony_ci 3738c2ecf20Sopenharmony_ci SOC_DOUBLE_R_TLV("DPGA1 Volume", ISABELLE_DPGA1L_GAIN_REG, 3748c2ecf20Sopenharmony_ci ISABELLE_DPGA1R_GAIN_REG, 0, 0x3F, 0, dpga_tlv), 3758c2ecf20Sopenharmony_ci SOC_DOUBLE_R_TLV("DPGA2 Volume", ISABELLE_DPGA2L_GAIN_REG, 3768c2ecf20Sopenharmony_ci ISABELLE_DPGA2R_GAIN_REG, 0, 0x3F, 0, dpga_tlv), 3778c2ecf20Sopenharmony_ci SOC_DOUBLE_R_TLV("DPGA3 Volume", ISABELLE_DPGA3L_GAIN_REG, 3788c2ecf20Sopenharmony_ci ISABELLE_DPGA3R_GAIN_REG, 0, 0x3F, 0, dpga_tlv), 3798c2ecf20Sopenharmony_ci 3808c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Sidetone Audio TX1 Volume", 3818c2ecf20Sopenharmony_ci ISABELLE_ATX_STPGA1_CFG_REG, 0, 0xF, 0, st_tlv), 3828c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Sidetone Audio TX2 Volume", 3838c2ecf20Sopenharmony_ci ISABELLE_ATX_STPGA2_CFG_REG, 0, 0xF, 0, st_tlv), 3848c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Sidetone Voice TX1 Volume", 3858c2ecf20Sopenharmony_ci ISABELLE_VTX_STPGA1_CFG_REG, 0, 0xF, 0, st_tlv), 3868c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Sidetone Voice TX2 Volume", 3878c2ecf20Sopenharmony_ci ISABELLE_VTX2_STPGA2_CFG_REG, 0, 0xF, 0, st_tlv), 3888c2ecf20Sopenharmony_ci 3898c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Audio TX1 Volume", ISABELLE_ATX1_DPGA_REG, 4, 0xF, 0, 3908c2ecf20Sopenharmony_ci tx_tlv), 3918c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Audio TX2 Volume", ISABELLE_ATX2_DPGA_REG, 4, 0xF, 0, 3928c2ecf20Sopenharmony_ci tx_tlv), 3938c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Voice TX1 Volume", ISABELLE_VTX1_DPGA_REG, 4, 0xF, 0, 3948c2ecf20Sopenharmony_ci tx_tlv), 3958c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("Voice TX2 Volume", ISABELLE_VTX2_DPGA_REG, 4, 0xF, 0, 3968c2ecf20Sopenharmony_ci tx_tlv), 3978c2ecf20Sopenharmony_ci 3988c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("RX1 DPGA Volume", ISABELLE_RX1_DPGA_REG, 0, 0x3F, 0, 3998c2ecf20Sopenharmony_ci rx_tlv), 4008c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("RX2 DPGA Volume", ISABELLE_RX2_DPGA_REG, 0, 0x3F, 0, 4018c2ecf20Sopenharmony_ci rx_tlv), 4028c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("RX3 DPGA Volume", ISABELLE_RX3_DPGA_REG, 0, 0x3F, 0, 4038c2ecf20Sopenharmony_ci rx_tlv), 4048c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("RX4 DPGA Volume", ISABELLE_RX4_DPGA_REG, 0, 0x3F, 0, 4058c2ecf20Sopenharmony_ci rx_tlv), 4068c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("RX5 DPGA Volume", ISABELLE_RX5_DPGA_REG, 0, 0x3F, 0, 4078c2ecf20Sopenharmony_ci rx_tlv), 4088c2ecf20Sopenharmony_ci SOC_SINGLE_TLV("RX6 DPGA Volume", ISABELLE_RX6_DPGA_REG, 0, 0x3F, 0, 4098c2ecf20Sopenharmony_ci rx_tlv), 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_ci SOC_SINGLE("Headset Noise Gate", ISABELLE_HS_NG_CFG1_REG, 7, 1, 0), 4128c2ecf20Sopenharmony_ci SOC_SINGLE("Handsfree Noise Gate", ISABELLE_HF_NG_CFG1_REG, 7, 1, 0), 4138c2ecf20Sopenharmony_ci 4148c2ecf20Sopenharmony_ci SOC_SINGLE("ATX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4158c2ecf20Sopenharmony_ci 7, 1, 0), 4168c2ecf20Sopenharmony_ci SOC_SINGLE("ATX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4178c2ecf20Sopenharmony_ci 6, 1, 0), 4188c2ecf20Sopenharmony_ci SOC_SINGLE("ARX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4198c2ecf20Sopenharmony_ci 5, 1, 0), 4208c2ecf20Sopenharmony_ci SOC_SINGLE("ARX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4218c2ecf20Sopenharmony_ci 4, 1, 0), 4228c2ecf20Sopenharmony_ci SOC_SINGLE("ARX3 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4238c2ecf20Sopenharmony_ci 3, 1, 0), 4248c2ecf20Sopenharmony_ci SOC_SINGLE("ARX4 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4258c2ecf20Sopenharmony_ci 2, 1, 0), 4268c2ecf20Sopenharmony_ci SOC_SINGLE("ARX5 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4278c2ecf20Sopenharmony_ci 1, 1, 0), 4288c2ecf20Sopenharmony_ci SOC_SINGLE("ARX6 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4298c2ecf20Sopenharmony_ci 0, 1, 0), 4308c2ecf20Sopenharmony_ci SOC_SINGLE("VRX1 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4318c2ecf20Sopenharmony_ci 3, 1, 0), 4328c2ecf20Sopenharmony_ci SOC_SINGLE("VRX2 Filter Bypass Switch", ISABELLE_AUDIO_HPF_CFG_REG, 4338c2ecf20Sopenharmony_ci 2, 1, 0), 4348c2ecf20Sopenharmony_ci 4358c2ecf20Sopenharmony_ci SOC_SINGLE("ATX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG, 4368c2ecf20Sopenharmony_ci 7, 1, 0), 4378c2ecf20Sopenharmony_ci SOC_SINGLE("ATX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG, 4388c2ecf20Sopenharmony_ci 6, 1, 0), 4398c2ecf20Sopenharmony_ci SOC_SINGLE("VTX1 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG, 4408c2ecf20Sopenharmony_ci 5, 1, 0), 4418c2ecf20Sopenharmony_ci SOC_SINGLE("VTX2 Filter Enable Switch", ISABELLE_ALU_TX_EN_REG, 4428c2ecf20Sopenharmony_ci 4, 1, 0), 4438c2ecf20Sopenharmony_ci SOC_SINGLE("RX1 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG, 4448c2ecf20Sopenharmony_ci 5, 1, 0), 4458c2ecf20Sopenharmony_ci SOC_SINGLE("RX2 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG, 4468c2ecf20Sopenharmony_ci 4, 1, 0), 4478c2ecf20Sopenharmony_ci SOC_SINGLE("RX3 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG, 4488c2ecf20Sopenharmony_ci 3, 1, 0), 4498c2ecf20Sopenharmony_ci SOC_SINGLE("RX4 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG, 4508c2ecf20Sopenharmony_ci 2, 1, 0), 4518c2ecf20Sopenharmony_ci SOC_SINGLE("RX5 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG, 4528c2ecf20Sopenharmony_ci 1, 1, 0), 4538c2ecf20Sopenharmony_ci SOC_SINGLE("RX6 Filter Enable Switch", ISABELLE_ALU_RX_EN_REG, 4548c2ecf20Sopenharmony_ci 0, 1, 0), 4558c2ecf20Sopenharmony_ci 4568c2ecf20Sopenharmony_ci SOC_SINGLE("ULATX12 Capture Switch", ISABELLE_ULATX12_INTF_CFG_REG, 4578c2ecf20Sopenharmony_ci 7, 1, 0), 4588c2ecf20Sopenharmony_ci 4598c2ecf20Sopenharmony_ci SOC_SINGLE("DL12 Playback Switch", ISABELLE_DL12_INTF_CFG_REG, 4608c2ecf20Sopenharmony_ci 7, 1, 0), 4618c2ecf20Sopenharmony_ci SOC_SINGLE("DL34 Playback Switch", ISABELLE_DL34_INTF_CFG_REG, 4628c2ecf20Sopenharmony_ci 7, 1, 0), 4638c2ecf20Sopenharmony_ci SOC_SINGLE("DL56 Playback Switch", ISABELLE_DL56_INTF_CFG_REG, 4648c2ecf20Sopenharmony_ci 7, 1, 0), 4658c2ecf20Sopenharmony_ci 4668c2ecf20Sopenharmony_ci /* DMIC Switch */ 4678c2ecf20Sopenharmony_ci SOC_SINGLE("DMIC Switch", ISABELLE_DMIC_CFG_REG, 0, 1, 0), 4688c2ecf20Sopenharmony_ci}; 4698c2ecf20Sopenharmony_ci 4708c2ecf20Sopenharmony_cistatic const struct snd_soc_dapm_widget isabelle_dapm_widgets[] = { 4718c2ecf20Sopenharmony_ci /* Inputs */ 4728c2ecf20Sopenharmony_ci SND_SOC_DAPM_INPUT("MAINMIC"), 4738c2ecf20Sopenharmony_ci SND_SOC_DAPM_INPUT("HSMIC"), 4748c2ecf20Sopenharmony_ci SND_SOC_DAPM_INPUT("SUBMIC"), 4758c2ecf20Sopenharmony_ci SND_SOC_DAPM_INPUT("LINEIN1"), 4768c2ecf20Sopenharmony_ci SND_SOC_DAPM_INPUT("LINEIN2"), 4778c2ecf20Sopenharmony_ci SND_SOC_DAPM_INPUT("DMICDAT"), 4788c2ecf20Sopenharmony_ci 4798c2ecf20Sopenharmony_ci /* Outputs */ 4808c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUTPUT("HSOL"), 4818c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUTPUT("HSOR"), 4828c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUTPUT("HFL"), 4838c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUTPUT("HFR"), 4848c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUTPUT("EP"), 4858c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUTPUT("LINEOUT1"), 4868c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUTPUT("LINEOUT2"), 4878c2ecf20Sopenharmony_ci 4888c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DL1", SND_SOC_NOPM, 0, 0, NULL, 0), 4898c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DL2", SND_SOC_NOPM, 0, 0, NULL, 0), 4908c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DL3", SND_SOC_NOPM, 0, 0, NULL, 0), 4918c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DL4", SND_SOC_NOPM, 0, 0, NULL, 0), 4928c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DL5", SND_SOC_NOPM, 0, 0, NULL, 0), 4938c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DL6", SND_SOC_NOPM, 0, 0, NULL, 0), 4948c2ecf20Sopenharmony_ci 4958c2ecf20Sopenharmony_ci /* Analog input muxes for the capture amplifiers */ 4968c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("Analog Left Capture Route", 4978c2ecf20Sopenharmony_ci SND_SOC_NOPM, 0, 0, &amic1_control), 4988c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("Analog Right Capture Route", 4998c2ecf20Sopenharmony_ci SND_SOC_NOPM, 0, 0, &amic2_control), 5008c2ecf20Sopenharmony_ci 5018c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("Sidetone Audio Playback", SND_SOC_NOPM, 0, 0, 5028c2ecf20Sopenharmony_ci &st_audio_control), 5038c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("Sidetone Voice Playback", SND_SOC_NOPM, 0, 0, 5048c2ecf20Sopenharmony_ci &st_voice_control), 5058c2ecf20Sopenharmony_ci 5068c2ecf20Sopenharmony_ci /* AIF */ 5078c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("INTF1_SDI", NULL, 0, ISABELLE_INTF_EN_REG, 7, 0), 5088c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_IN("INTF2_SDI", NULL, 0, ISABELLE_INTF_EN_REG, 6, 0), 5098c2ecf20Sopenharmony_ci 5108c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("INTF1_SDO", NULL, 0, ISABELLE_INTF_EN_REG, 5, 0), 5118c2ecf20Sopenharmony_ci SND_SOC_DAPM_AIF_OUT("INTF2_SDO", NULL, 0, ISABELLE_INTF_EN_REG, 4, 0), 5128c2ecf20Sopenharmony_ci 5138c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("ULATX1", SND_SOC_NOPM, 0, 0, NULL, 0), 5148c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("ULATX2", SND_SOC_NOPM, 0, 0, NULL, 0), 5158c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("ULVTX1", SND_SOC_NOPM, 0, 0, NULL, 0), 5168c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("ULVTX2", SND_SOC_NOPM, 0, 0, NULL, 0), 5178c2ecf20Sopenharmony_ci 5188c2ecf20Sopenharmony_ci /* Analog Capture PGAs */ 5198c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("MicAmp1", ISABELLE_AMIC_CFG_REG, 5, 0, NULL, 0), 5208c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("MicAmp2", ISABELLE_AMIC_CFG_REG, 4, 0, NULL, 0), 5218c2ecf20Sopenharmony_ci 5228c2ecf20Sopenharmony_ci /* Auxiliary FM PGAs */ 5238c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("APGA1", ISABELLE_APGA_CFG_REG, 7, 0, NULL, 0), 5248c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("APGA2", ISABELLE_APGA_CFG_REG, 6, 0, NULL, 0), 5258c2ecf20Sopenharmony_ci 5268c2ecf20Sopenharmony_ci /* ADCs */ 5278c2ecf20Sopenharmony_ci SND_SOC_DAPM_ADC("ADC1", "Left Front Capture", 5288c2ecf20Sopenharmony_ci ISABELLE_AMIC_CFG_REG, 7, 0), 5298c2ecf20Sopenharmony_ci SND_SOC_DAPM_ADC("ADC2", "Right Front Capture", 5308c2ecf20Sopenharmony_ci ISABELLE_AMIC_CFG_REG, 6, 0), 5318c2ecf20Sopenharmony_ci 5328c2ecf20Sopenharmony_ci /* Microphone Bias */ 5338c2ecf20Sopenharmony_ci SND_SOC_DAPM_SUPPLY("Headset Mic Bias", ISABELLE_ABIAS_CFG_REG, 5348c2ecf20Sopenharmony_ci 3, 0, NULL, 0), 5358c2ecf20Sopenharmony_ci SND_SOC_DAPM_SUPPLY("Main Mic Bias", ISABELLE_ABIAS_CFG_REG, 5368c2ecf20Sopenharmony_ci 2, 0, NULL, 0), 5378c2ecf20Sopenharmony_ci SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias", 5388c2ecf20Sopenharmony_ci ISABELLE_DBIAS_CFG_REG, 3, 0, NULL, 0), 5398c2ecf20Sopenharmony_ci SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias", 5408c2ecf20Sopenharmony_ci ISABELLE_DBIAS_CFG_REG, 2, 0, NULL, 0), 5418c2ecf20Sopenharmony_ci 5428c2ecf20Sopenharmony_ci /* Mixers */ 5438c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("Headset Left Mixer", SND_SOC_NOPM, 0, 0, 5448c2ecf20Sopenharmony_ci isabelle_hs_left_mixer_controls, 5458c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_hs_left_mixer_controls)), 5468c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("Headset Right Mixer", SND_SOC_NOPM, 0, 0, 5478c2ecf20Sopenharmony_ci isabelle_hs_right_mixer_controls, 5488c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_hs_right_mixer_controls)), 5498c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("Handsfree Left Mixer", SND_SOC_NOPM, 0, 0, 5508c2ecf20Sopenharmony_ci isabelle_hf_left_mixer_controls, 5518c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_hf_left_mixer_controls)), 5528c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("Handsfree Right Mixer", SND_SOC_NOPM, 0, 0, 5538c2ecf20Sopenharmony_ci isabelle_hf_right_mixer_controls, 5548c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_hf_right_mixer_controls)), 5558c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("LINEOUT1 Mixer", SND_SOC_NOPM, 0, 0, 5568c2ecf20Sopenharmony_ci isabelle_aux_left_mixer_controls, 5578c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_aux_left_mixer_controls)), 5588c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("LINEOUT2 Mixer", SND_SOC_NOPM, 0, 0, 5598c2ecf20Sopenharmony_ci isabelle_aux_right_mixer_controls, 5608c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_aux_right_mixer_controls)), 5618c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("Earphone Mixer", SND_SOC_NOPM, 0, 0, 5628c2ecf20Sopenharmony_ci isabelle_ep_mixer_controls, 5638c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_ep_mixer_controls)), 5648c2ecf20Sopenharmony_ci 5658c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("DPGA1L Mixer", SND_SOC_NOPM, 0, 0, 5668c2ecf20Sopenharmony_ci isabelle_dpga1_left_mixer_controls, 5678c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_dpga1_left_mixer_controls)), 5688c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("DPGA1R Mixer", SND_SOC_NOPM, 0, 0, 5698c2ecf20Sopenharmony_ci isabelle_dpga1_right_mixer_controls, 5708c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_dpga1_right_mixer_controls)), 5718c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("DPGA2L Mixer", SND_SOC_NOPM, 0, 0, 5728c2ecf20Sopenharmony_ci isabelle_dpga2_left_mixer_controls, 5738c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_dpga2_left_mixer_controls)), 5748c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("DPGA2R Mixer", SND_SOC_NOPM, 0, 0, 5758c2ecf20Sopenharmony_ci isabelle_dpga2_right_mixer_controls, 5768c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_dpga2_right_mixer_controls)), 5778c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("DPGA3L Mixer", SND_SOC_NOPM, 0, 0, 5788c2ecf20Sopenharmony_ci isabelle_dpga3_left_mixer_controls, 5798c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_dpga3_left_mixer_controls)), 5808c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("DPGA3R Mixer", SND_SOC_NOPM, 0, 0, 5818c2ecf20Sopenharmony_ci isabelle_dpga3_right_mixer_controls, 5828c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_dpga3_right_mixer_controls)), 5838c2ecf20Sopenharmony_ci 5848c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("RX1 Mixer", SND_SOC_NOPM, 0, 0, 5858c2ecf20Sopenharmony_ci isabelle_rx1_mixer_controls, 5868c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx1_mixer_controls)), 5878c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("RX2 Mixer", SND_SOC_NOPM, 0, 0, 5888c2ecf20Sopenharmony_ci isabelle_rx2_mixer_controls, 5898c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx2_mixer_controls)), 5908c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("RX3 Mixer", SND_SOC_NOPM, 0, 0, 5918c2ecf20Sopenharmony_ci isabelle_rx3_mixer_controls, 5928c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx3_mixer_controls)), 5938c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("RX4 Mixer", SND_SOC_NOPM, 0, 0, 5948c2ecf20Sopenharmony_ci isabelle_rx4_mixer_controls, 5958c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx4_mixer_controls)), 5968c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("RX5 Mixer", SND_SOC_NOPM, 0, 0, 5978c2ecf20Sopenharmony_ci isabelle_rx5_mixer_controls, 5988c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx5_mixer_controls)), 5998c2ecf20Sopenharmony_ci SND_SOC_DAPM_MIXER("RX6 Mixer", SND_SOC_NOPM, 0, 0, 6008c2ecf20Sopenharmony_ci isabelle_rx6_mixer_controls, 6018c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_rx6_mixer_controls)), 6028c2ecf20Sopenharmony_ci 6038c2ecf20Sopenharmony_ci /* DACs */ 6048c2ecf20Sopenharmony_ci SND_SOC_DAPM_DAC("DAC1L", "Headset Playback", ISABELLE_DAC_CFG_REG, 6058c2ecf20Sopenharmony_ci 5, 0), 6068c2ecf20Sopenharmony_ci SND_SOC_DAPM_DAC("DAC1R", "Headset Playback", ISABELLE_DAC_CFG_REG, 6078c2ecf20Sopenharmony_ci 4, 0), 6088c2ecf20Sopenharmony_ci SND_SOC_DAPM_DAC("DAC2L", "Handsfree Playback", ISABELLE_DAC_CFG_REG, 6098c2ecf20Sopenharmony_ci 3, 0), 6108c2ecf20Sopenharmony_ci SND_SOC_DAPM_DAC("DAC2R", "Handsfree Playback", ISABELLE_DAC_CFG_REG, 6118c2ecf20Sopenharmony_ci 2, 0), 6128c2ecf20Sopenharmony_ci SND_SOC_DAPM_DAC("DAC3L", "Lineout Playback", ISABELLE_DAC_CFG_REG, 6138c2ecf20Sopenharmony_ci 1, 0), 6148c2ecf20Sopenharmony_ci SND_SOC_DAPM_DAC("DAC3R", "Lineout Playback", ISABELLE_DAC_CFG_REG, 6158c2ecf20Sopenharmony_ci 0, 0), 6168c2ecf20Sopenharmony_ci 6178c2ecf20Sopenharmony_ci /* Analog Playback PGAs */ 6188c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("Sidetone Audio PGA", SND_SOC_NOPM, 0, 0, NULL, 0), 6198c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("Sidetone Voice PGA", SND_SOC_NOPM, 0, 0, NULL, 0), 6208c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("HF Left PGA", SND_SOC_NOPM, 0, 0, NULL, 0), 6218c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("HF Right PGA", SND_SOC_NOPM, 0, 0, NULL, 0), 6228c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DPGA1L", SND_SOC_NOPM, 0, 0, NULL, 0), 6238c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DPGA1R", SND_SOC_NOPM, 0, 0, NULL, 0), 6248c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DPGA2L", SND_SOC_NOPM, 0, 0, NULL, 0), 6258c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DPGA2R", SND_SOC_NOPM, 0, 0, NULL, 0), 6268c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DPGA3L", SND_SOC_NOPM, 0, 0, NULL, 0), 6278c2ecf20Sopenharmony_ci SND_SOC_DAPM_PGA("DPGA3R", SND_SOC_NOPM, 0, 0, NULL, 0), 6288c2ecf20Sopenharmony_ci 6298c2ecf20Sopenharmony_ci /* Analog Playback Mux */ 6308c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("RX1 Playback", ISABELLE_ALU_RX_EN_REG, 5, 0, 6318c2ecf20Sopenharmony_ci &rx1_mux_controls), 6328c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("RX2 Playback", ISABELLE_ALU_RX_EN_REG, 4, 0, 6338c2ecf20Sopenharmony_ci &rx2_mux_controls), 6348c2ecf20Sopenharmony_ci 6358c2ecf20Sopenharmony_ci /* TX Select */ 6368c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("ATX Select", ISABELLE_TX_INPUT_CFG_REG, 6378c2ecf20Sopenharmony_ci 7, 0, &atx_mux_controls), 6388c2ecf20Sopenharmony_ci SND_SOC_DAPM_MUX("VTX Select", ISABELLE_TX_INPUT_CFG_REG, 6398c2ecf20Sopenharmony_ci 6, 0, &vtx_mux_controls), 6408c2ecf20Sopenharmony_ci 6418c2ecf20Sopenharmony_ci SND_SOC_DAPM_SWITCH("Earphone Playback", SND_SOC_NOPM, 0, 0, 6428c2ecf20Sopenharmony_ci &ep_path_enable_control), 6438c2ecf20Sopenharmony_ci 6448c2ecf20Sopenharmony_ci /* Output Drivers */ 6458c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("HS Left Driver", ISABELLE_HSDRV_CFG2_REG, 6468c2ecf20Sopenharmony_ci 1, 0, NULL, 0), 6478c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("HS Right Driver", ISABELLE_HSDRV_CFG2_REG, 6488c2ecf20Sopenharmony_ci 0, 0, NULL, 0), 6498c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("LINEOUT1 Left Driver", ISABELLE_LINEAMP_CFG_REG, 6508c2ecf20Sopenharmony_ci 1, 0, NULL, 0), 6518c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("LINEOUT2 Right Driver", ISABELLE_LINEAMP_CFG_REG, 6528c2ecf20Sopenharmony_ci 0, 0, NULL, 0), 6538c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("Earphone Driver", ISABELLE_EARDRV_CFG2_REG, 6548c2ecf20Sopenharmony_ci 1, 0, NULL, 0), 6558c2ecf20Sopenharmony_ci 6568c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("HF Left Driver", ISABELLE_HFDRV_CFG_REG, 6578c2ecf20Sopenharmony_ci 1, 0, NULL, 0), 6588c2ecf20Sopenharmony_ci SND_SOC_DAPM_OUT_DRV("HF Right Driver", ISABELLE_HFDRV_CFG_REG, 6598c2ecf20Sopenharmony_ci 0, 0, NULL, 0), 6608c2ecf20Sopenharmony_ci}; 6618c2ecf20Sopenharmony_ci 6628c2ecf20Sopenharmony_cistatic const struct snd_soc_dapm_route isabelle_intercon[] = { 6638c2ecf20Sopenharmony_ci /* Interface mapping */ 6648c2ecf20Sopenharmony_ci { "DL1", "DL12 Playback Switch", "INTF1_SDI" }, 6658c2ecf20Sopenharmony_ci { "DL2", "DL12 Playback Switch", "INTF1_SDI" }, 6668c2ecf20Sopenharmony_ci { "DL3", "DL34 Playback Switch", "INTF1_SDI" }, 6678c2ecf20Sopenharmony_ci { "DL4", "DL34 Playback Switch", "INTF1_SDI" }, 6688c2ecf20Sopenharmony_ci { "DL5", "DL56 Playback Switch", "INTF1_SDI" }, 6698c2ecf20Sopenharmony_ci { "DL6", "DL56 Playback Switch", "INTF1_SDI" }, 6708c2ecf20Sopenharmony_ci 6718c2ecf20Sopenharmony_ci { "DL1", "DL12 Playback Switch", "INTF2_SDI" }, 6728c2ecf20Sopenharmony_ci { "DL2", "DL12 Playback Switch", "INTF2_SDI" }, 6738c2ecf20Sopenharmony_ci { "DL3", "DL34 Playback Switch", "INTF2_SDI" }, 6748c2ecf20Sopenharmony_ci { "DL4", "DL34 Playback Switch", "INTF2_SDI" }, 6758c2ecf20Sopenharmony_ci { "DL5", "DL56 Playback Switch", "INTF2_SDI" }, 6768c2ecf20Sopenharmony_ci { "DL6", "DL56 Playback Switch", "INTF2_SDI" }, 6778c2ecf20Sopenharmony_ci 6788c2ecf20Sopenharmony_ci /* Input side mapping */ 6798c2ecf20Sopenharmony_ci { "Sidetone Audio PGA", NULL, "Sidetone Audio Playback" }, 6808c2ecf20Sopenharmony_ci { "Sidetone Voice PGA", NULL, "Sidetone Voice Playback" }, 6818c2ecf20Sopenharmony_ci 6828c2ecf20Sopenharmony_ci { "RX1 Mixer", "ST1 Playback Switch", "Sidetone Audio PGA" }, 6838c2ecf20Sopenharmony_ci 6848c2ecf20Sopenharmony_ci { "RX1 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" }, 6858c2ecf20Sopenharmony_ci { "RX1 Mixer", "DL1 Playback Switch", "DL1" }, 6868c2ecf20Sopenharmony_ci 6878c2ecf20Sopenharmony_ci { "RX2 Mixer", "ST2 Playback Switch", "Sidetone Audio PGA" }, 6888c2ecf20Sopenharmony_ci 6898c2ecf20Sopenharmony_ci { "RX2 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" }, 6908c2ecf20Sopenharmony_ci { "RX2 Mixer", "DL2 Playback Switch", "DL2" }, 6918c2ecf20Sopenharmony_ci 6928c2ecf20Sopenharmony_ci { "RX3 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" }, 6938c2ecf20Sopenharmony_ci { "RX3 Mixer", "DL3 Playback Switch", "DL3" }, 6948c2ecf20Sopenharmony_ci 6958c2ecf20Sopenharmony_ci { "RX4 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" }, 6968c2ecf20Sopenharmony_ci { "RX4 Mixer", "DL4 Playback Switch", "DL4" }, 6978c2ecf20Sopenharmony_ci 6988c2ecf20Sopenharmony_ci { "RX5 Mixer", "ST1 Playback Switch", "Sidetone Voice PGA" }, 6998c2ecf20Sopenharmony_ci { "RX5 Mixer", "DL5 Playback Switch", "DL5" }, 7008c2ecf20Sopenharmony_ci 7018c2ecf20Sopenharmony_ci { "RX6 Mixer", "ST2 Playback Switch", "Sidetone Voice PGA" }, 7028c2ecf20Sopenharmony_ci { "RX6 Mixer", "DL6 Playback Switch", "DL6" }, 7038c2ecf20Sopenharmony_ci 7048c2ecf20Sopenharmony_ci /* Capture path */ 7058c2ecf20Sopenharmony_ci { "Analog Left Capture Route", "Headset Mic", "HSMIC" }, 7068c2ecf20Sopenharmony_ci { "Analog Left Capture Route", "Main Mic", "MAINMIC" }, 7078c2ecf20Sopenharmony_ci { "Analog Left Capture Route", "Aux/FM Left", "LINEIN1" }, 7088c2ecf20Sopenharmony_ci 7098c2ecf20Sopenharmony_ci { "Analog Right Capture Route", "Sub Mic", "SUBMIC" }, 7108c2ecf20Sopenharmony_ci { "Analog Right Capture Route", "Aux/FM Right", "LINEIN2" }, 7118c2ecf20Sopenharmony_ci 7128c2ecf20Sopenharmony_ci { "MicAmp1", NULL, "Analog Left Capture Route" }, 7138c2ecf20Sopenharmony_ci { "MicAmp2", NULL, "Analog Right Capture Route" }, 7148c2ecf20Sopenharmony_ci 7158c2ecf20Sopenharmony_ci { "ADC1", NULL, "MicAmp1" }, 7168c2ecf20Sopenharmony_ci { "ADC2", NULL, "MicAmp2" }, 7178c2ecf20Sopenharmony_ci 7188c2ecf20Sopenharmony_ci { "ATX Select", "AMIC1", "ADC1" }, 7198c2ecf20Sopenharmony_ci { "ATX Select", "DMIC", "DMICDAT" }, 7208c2ecf20Sopenharmony_ci { "ATX Select", "AMIC2", "ADC2" }, 7218c2ecf20Sopenharmony_ci 7228c2ecf20Sopenharmony_ci { "VTX Select", "AMIC1", "ADC1" }, 7238c2ecf20Sopenharmony_ci { "VTX Select", "DMIC", "DMICDAT" }, 7248c2ecf20Sopenharmony_ci { "VTX Select", "AMIC2", "ADC2" }, 7258c2ecf20Sopenharmony_ci 7268c2ecf20Sopenharmony_ci { "ULATX1", "ATX1 Filter Enable Switch", "ATX Select" }, 7278c2ecf20Sopenharmony_ci { "ULATX1", "ATX1 Filter Bypass Switch", "ATX Select" }, 7288c2ecf20Sopenharmony_ci { "ULATX2", "ATX2 Filter Enable Switch", "ATX Select" }, 7298c2ecf20Sopenharmony_ci { "ULATX2", "ATX2 Filter Bypass Switch", "ATX Select" }, 7308c2ecf20Sopenharmony_ci 7318c2ecf20Sopenharmony_ci { "ULVTX1", "VTX1 Filter Enable Switch", "VTX Select" }, 7328c2ecf20Sopenharmony_ci { "ULVTX1", "VTX1 Filter Bypass Switch", "VTX Select" }, 7338c2ecf20Sopenharmony_ci { "ULVTX2", "VTX2 Filter Enable Switch", "VTX Select" }, 7348c2ecf20Sopenharmony_ci { "ULVTX2", "VTX2 Filter Bypass Switch", "VTX Select" }, 7358c2ecf20Sopenharmony_ci 7368c2ecf20Sopenharmony_ci { "INTF1_SDO", "ULATX12 Capture Switch", "ULATX1" }, 7378c2ecf20Sopenharmony_ci { "INTF1_SDO", "ULATX12 Capture Switch", "ULATX2" }, 7388c2ecf20Sopenharmony_ci { "INTF2_SDO", "ULATX12 Capture Switch", "ULATX1" }, 7398c2ecf20Sopenharmony_ci { "INTF2_SDO", "ULATX12 Capture Switch", "ULATX2" }, 7408c2ecf20Sopenharmony_ci 7418c2ecf20Sopenharmony_ci { "INTF1_SDO", NULL, "ULVTX1" }, 7428c2ecf20Sopenharmony_ci { "INTF1_SDO", NULL, "ULVTX2" }, 7438c2ecf20Sopenharmony_ci { "INTF2_SDO", NULL, "ULVTX1" }, 7448c2ecf20Sopenharmony_ci { "INTF2_SDO", NULL, "ULVTX2" }, 7458c2ecf20Sopenharmony_ci 7468c2ecf20Sopenharmony_ci /* AFM Path */ 7478c2ecf20Sopenharmony_ci { "APGA1", NULL, "LINEIN1" }, 7488c2ecf20Sopenharmony_ci { "APGA2", NULL, "LINEIN2" }, 7498c2ecf20Sopenharmony_ci 7508c2ecf20Sopenharmony_ci { "RX1 Playback", "VRX1 Filter Bypass Switch", "RX1 Mixer" }, 7518c2ecf20Sopenharmony_ci { "RX1 Playback", "ARX1 Filter Bypass Switch", "RX1 Mixer" }, 7528c2ecf20Sopenharmony_ci { "RX1 Playback", "RX1 Filter Enable Switch", "RX1 Mixer" }, 7538c2ecf20Sopenharmony_ci 7548c2ecf20Sopenharmony_ci { "RX2 Playback", "VRX2 Filter Bypass Switch", "RX2 Mixer" }, 7558c2ecf20Sopenharmony_ci { "RX2 Playback", "ARX2 Filter Bypass Switch", "RX2 Mixer" }, 7568c2ecf20Sopenharmony_ci { "RX2 Playback", "RX2 Filter Enable Switch", "RX2 Mixer" }, 7578c2ecf20Sopenharmony_ci 7588c2ecf20Sopenharmony_ci { "RX3 Playback", "ARX3 Filter Bypass Switch", "RX3 Mixer" }, 7598c2ecf20Sopenharmony_ci { "RX3 Playback", "RX3 Filter Enable Switch", "RX3 Mixer" }, 7608c2ecf20Sopenharmony_ci 7618c2ecf20Sopenharmony_ci { "RX4 Playback", "ARX4 Filter Bypass Switch", "RX4 Mixer" }, 7628c2ecf20Sopenharmony_ci { "RX4 Playback", "RX4 Filter Enable Switch", "RX4 Mixer" }, 7638c2ecf20Sopenharmony_ci 7648c2ecf20Sopenharmony_ci { "RX5 Playback", "ARX5 Filter Bypass Switch", "RX5 Mixer" }, 7658c2ecf20Sopenharmony_ci { "RX5 Playback", "RX5 Filter Enable Switch", "RX5 Mixer" }, 7668c2ecf20Sopenharmony_ci 7678c2ecf20Sopenharmony_ci { "RX6 Playback", "ARX6 Filter Bypass Switch", "RX6 Mixer" }, 7688c2ecf20Sopenharmony_ci { "RX6 Playback", "RX6 Filter Enable Switch", "RX6 Mixer" }, 7698c2ecf20Sopenharmony_ci 7708c2ecf20Sopenharmony_ci { "DPGA1L Mixer", "RX1 Playback Switch", "RX1 Playback" }, 7718c2ecf20Sopenharmony_ci { "DPGA1L Mixer", "RX3 Playback Switch", "RX3 Playback" }, 7728c2ecf20Sopenharmony_ci { "DPGA1L Mixer", "RX5 Playback Switch", "RX5 Playback" }, 7738c2ecf20Sopenharmony_ci 7748c2ecf20Sopenharmony_ci { "DPGA1R Mixer", "RX2 Playback Switch", "RX2 Playback" }, 7758c2ecf20Sopenharmony_ci { "DPGA1R Mixer", "RX4 Playback Switch", "RX4 Playback" }, 7768c2ecf20Sopenharmony_ci { "DPGA1R Mixer", "RX6 Playback Switch", "RX6 Playback" }, 7778c2ecf20Sopenharmony_ci 7788c2ecf20Sopenharmony_ci { "DPGA1L", NULL, "DPGA1L Mixer" }, 7798c2ecf20Sopenharmony_ci { "DPGA1R", NULL, "DPGA1R Mixer" }, 7808c2ecf20Sopenharmony_ci 7818c2ecf20Sopenharmony_ci { "DAC1L", NULL, "DPGA1L" }, 7828c2ecf20Sopenharmony_ci { "DAC1R", NULL, "DPGA1R" }, 7838c2ecf20Sopenharmony_ci 7848c2ecf20Sopenharmony_ci { "DPGA2L Mixer", "RX1 Playback Switch", "RX1 Playback" }, 7858c2ecf20Sopenharmony_ci { "DPGA2L Mixer", "RX2 Playback Switch", "RX2 Playback" }, 7868c2ecf20Sopenharmony_ci { "DPGA2L Mixer", "RX3 Playback Switch", "RX3 Playback" }, 7878c2ecf20Sopenharmony_ci { "DPGA2L Mixer", "RX4 Playback Switch", "RX4 Playback" }, 7888c2ecf20Sopenharmony_ci { "DPGA2L Mixer", "RX5 Playback Switch", "RX5 Playback" }, 7898c2ecf20Sopenharmony_ci { "DPGA2L Mixer", "RX6 Playback Switch", "RX6 Playback" }, 7908c2ecf20Sopenharmony_ci 7918c2ecf20Sopenharmony_ci { "DPGA2R Mixer", "RX2 Playback Switch", "RX2 Playback" }, 7928c2ecf20Sopenharmony_ci { "DPGA2R Mixer", "RX4 Playback Switch", "RX4 Playback" }, 7938c2ecf20Sopenharmony_ci { "DPGA2R Mixer", "RX6 Playback Switch", "RX6 Playback" }, 7948c2ecf20Sopenharmony_ci 7958c2ecf20Sopenharmony_ci { "DPGA2L", NULL, "DPGA2L Mixer" }, 7968c2ecf20Sopenharmony_ci { "DPGA2R", NULL, "DPGA2R Mixer" }, 7978c2ecf20Sopenharmony_ci 7988c2ecf20Sopenharmony_ci { "DAC2L", NULL, "DPGA2L" }, 7998c2ecf20Sopenharmony_ci { "DAC2R", NULL, "DPGA2R" }, 8008c2ecf20Sopenharmony_ci 8018c2ecf20Sopenharmony_ci { "DPGA3L Mixer", "RX1 Playback Switch", "RX1 Playback" }, 8028c2ecf20Sopenharmony_ci { "DPGA3L Mixer", "RX3 Playback Switch", "RX3 Playback" }, 8038c2ecf20Sopenharmony_ci { "DPGA3L Mixer", "RX5 Playback Switch", "RX5 Playback" }, 8048c2ecf20Sopenharmony_ci 8058c2ecf20Sopenharmony_ci { "DPGA3R Mixer", "RX2 Playback Switch", "RX2 Playback" }, 8068c2ecf20Sopenharmony_ci { "DPGA3R Mixer", "RX4 Playback Switch", "RX4 Playback" }, 8078c2ecf20Sopenharmony_ci { "DPGA3R Mixer", "RX6 Playback Switch", "RX6 Playback" }, 8088c2ecf20Sopenharmony_ci 8098c2ecf20Sopenharmony_ci { "DPGA3L", NULL, "DPGA3L Mixer" }, 8108c2ecf20Sopenharmony_ci { "DPGA3R", NULL, "DPGA3R Mixer" }, 8118c2ecf20Sopenharmony_ci 8128c2ecf20Sopenharmony_ci { "DAC3L", NULL, "DPGA3L" }, 8138c2ecf20Sopenharmony_ci { "DAC3R", NULL, "DPGA3R" }, 8148c2ecf20Sopenharmony_ci 8158c2ecf20Sopenharmony_ci { "Headset Left Mixer", "DAC1L Playback Switch", "DAC1L" }, 8168c2ecf20Sopenharmony_ci { "Headset Left Mixer", "APGA1 Playback Switch", "APGA1" }, 8178c2ecf20Sopenharmony_ci 8188c2ecf20Sopenharmony_ci { "Headset Right Mixer", "DAC1R Playback Switch", "DAC1R" }, 8198c2ecf20Sopenharmony_ci { "Headset Right Mixer", "APGA2 Playback Switch", "APGA2" }, 8208c2ecf20Sopenharmony_ci 8218c2ecf20Sopenharmony_ci { "HS Left Driver", NULL, "Headset Left Mixer" }, 8228c2ecf20Sopenharmony_ci { "HS Right Driver", NULL, "Headset Right Mixer" }, 8238c2ecf20Sopenharmony_ci 8248c2ecf20Sopenharmony_ci { "HSOL", NULL, "HS Left Driver" }, 8258c2ecf20Sopenharmony_ci { "HSOR", NULL, "HS Right Driver" }, 8268c2ecf20Sopenharmony_ci 8278c2ecf20Sopenharmony_ci /* Earphone playback path */ 8288c2ecf20Sopenharmony_ci { "Earphone Mixer", "DAC2L Playback Switch", "DAC2L" }, 8298c2ecf20Sopenharmony_ci { "Earphone Mixer", "APGA1 Playback Switch", "APGA1" }, 8308c2ecf20Sopenharmony_ci 8318c2ecf20Sopenharmony_ci { "Earphone Playback", "Switch", "Earphone Mixer" }, 8328c2ecf20Sopenharmony_ci { "Earphone Driver", NULL, "Earphone Playback" }, 8338c2ecf20Sopenharmony_ci { "EP", NULL, "Earphone Driver" }, 8348c2ecf20Sopenharmony_ci 8358c2ecf20Sopenharmony_ci { "Handsfree Left Mixer", "DAC2L Playback Switch", "DAC2L" }, 8368c2ecf20Sopenharmony_ci { "Handsfree Left Mixer", "APGA1 Playback Switch", "APGA1" }, 8378c2ecf20Sopenharmony_ci 8388c2ecf20Sopenharmony_ci { "Handsfree Right Mixer", "DAC2R Playback Switch", "DAC2R" }, 8398c2ecf20Sopenharmony_ci { "Handsfree Right Mixer", "APGA2 Playback Switch", "APGA2" }, 8408c2ecf20Sopenharmony_ci 8418c2ecf20Sopenharmony_ci { "HF Left PGA", NULL, "Handsfree Left Mixer" }, 8428c2ecf20Sopenharmony_ci { "HF Right PGA", NULL, "Handsfree Right Mixer" }, 8438c2ecf20Sopenharmony_ci 8448c2ecf20Sopenharmony_ci { "HF Left Driver", NULL, "HF Left PGA" }, 8458c2ecf20Sopenharmony_ci { "HF Right Driver", NULL, "HF Right PGA" }, 8468c2ecf20Sopenharmony_ci 8478c2ecf20Sopenharmony_ci { "HFL", NULL, "HF Left Driver" }, 8488c2ecf20Sopenharmony_ci { "HFR", NULL, "HF Right Driver" }, 8498c2ecf20Sopenharmony_ci 8508c2ecf20Sopenharmony_ci { "LINEOUT1 Mixer", "DAC3L Playback Switch", "DAC3L" }, 8518c2ecf20Sopenharmony_ci { "LINEOUT1 Mixer", "APGA1 Playback Switch", "APGA1" }, 8528c2ecf20Sopenharmony_ci 8538c2ecf20Sopenharmony_ci { "LINEOUT2 Mixer", "DAC3R Playback Switch", "DAC3R" }, 8548c2ecf20Sopenharmony_ci { "LINEOUT2 Mixer", "APGA2 Playback Switch", "APGA2" }, 8558c2ecf20Sopenharmony_ci 8568c2ecf20Sopenharmony_ci { "LINEOUT1 Driver", NULL, "LINEOUT1 Mixer" }, 8578c2ecf20Sopenharmony_ci { "LINEOUT2 Driver", NULL, "LINEOUT2 Mixer" }, 8588c2ecf20Sopenharmony_ci 8598c2ecf20Sopenharmony_ci { "LINEOUT1", NULL, "LINEOUT1 Driver" }, 8608c2ecf20Sopenharmony_ci { "LINEOUT2", NULL, "LINEOUT2 Driver" }, 8618c2ecf20Sopenharmony_ci}; 8628c2ecf20Sopenharmony_ci 8638c2ecf20Sopenharmony_cistatic int isabelle_hs_mute(struct snd_soc_dai *dai, int mute, int direction) 8648c2ecf20Sopenharmony_ci{ 8658c2ecf20Sopenharmony_ci snd_soc_component_update_bits(dai->component, ISABELLE_DAC1_SOFTRAMP_REG, 8668c2ecf20Sopenharmony_ci BIT(4), (mute ? BIT(4) : 0)); 8678c2ecf20Sopenharmony_ci 8688c2ecf20Sopenharmony_ci return 0; 8698c2ecf20Sopenharmony_ci} 8708c2ecf20Sopenharmony_ci 8718c2ecf20Sopenharmony_cistatic int isabelle_hf_mute(struct snd_soc_dai *dai, int mute, int direction) 8728c2ecf20Sopenharmony_ci{ 8738c2ecf20Sopenharmony_ci snd_soc_component_update_bits(dai->component, ISABELLE_DAC2_SOFTRAMP_REG, 8748c2ecf20Sopenharmony_ci BIT(4), (mute ? BIT(4) : 0)); 8758c2ecf20Sopenharmony_ci 8768c2ecf20Sopenharmony_ci return 0; 8778c2ecf20Sopenharmony_ci} 8788c2ecf20Sopenharmony_ci 8798c2ecf20Sopenharmony_cistatic int isabelle_line_mute(struct snd_soc_dai *dai, int mute, int direction) 8808c2ecf20Sopenharmony_ci{ 8818c2ecf20Sopenharmony_ci snd_soc_component_update_bits(dai->component, ISABELLE_DAC3_SOFTRAMP_REG, 8828c2ecf20Sopenharmony_ci BIT(4), (mute ? BIT(4) : 0)); 8838c2ecf20Sopenharmony_ci 8848c2ecf20Sopenharmony_ci return 0; 8858c2ecf20Sopenharmony_ci} 8868c2ecf20Sopenharmony_ci 8878c2ecf20Sopenharmony_cistatic int isabelle_set_bias_level(struct snd_soc_component *component, 8888c2ecf20Sopenharmony_ci enum snd_soc_bias_level level) 8898c2ecf20Sopenharmony_ci{ 8908c2ecf20Sopenharmony_ci switch (level) { 8918c2ecf20Sopenharmony_ci case SND_SOC_BIAS_ON: 8928c2ecf20Sopenharmony_ci break; 8938c2ecf20Sopenharmony_ci case SND_SOC_BIAS_PREPARE: 8948c2ecf20Sopenharmony_ci break; 8958c2ecf20Sopenharmony_ci 8968c2ecf20Sopenharmony_ci case SND_SOC_BIAS_STANDBY: 8978c2ecf20Sopenharmony_ci snd_soc_component_update_bits(component, ISABELLE_PWR_EN_REG, 8988c2ecf20Sopenharmony_ci ISABELLE_CHIP_EN, BIT(0)); 8998c2ecf20Sopenharmony_ci break; 9008c2ecf20Sopenharmony_ci 9018c2ecf20Sopenharmony_ci case SND_SOC_BIAS_OFF: 9028c2ecf20Sopenharmony_ci snd_soc_component_update_bits(component, ISABELLE_PWR_EN_REG, 9038c2ecf20Sopenharmony_ci ISABELLE_CHIP_EN, 0); 9048c2ecf20Sopenharmony_ci break; 9058c2ecf20Sopenharmony_ci } 9068c2ecf20Sopenharmony_ci 9078c2ecf20Sopenharmony_ci return 0; 9088c2ecf20Sopenharmony_ci} 9098c2ecf20Sopenharmony_ci 9108c2ecf20Sopenharmony_cistatic int isabelle_hw_params(struct snd_pcm_substream *substream, 9118c2ecf20Sopenharmony_ci struct snd_pcm_hw_params *params, 9128c2ecf20Sopenharmony_ci struct snd_soc_dai *dai) 9138c2ecf20Sopenharmony_ci{ 9148c2ecf20Sopenharmony_ci struct snd_soc_component *component = dai->component; 9158c2ecf20Sopenharmony_ci u16 aif = 0; 9168c2ecf20Sopenharmony_ci unsigned int fs_val = 0; 9178c2ecf20Sopenharmony_ci 9188c2ecf20Sopenharmony_ci switch (params_rate(params)) { 9198c2ecf20Sopenharmony_ci case 8000: 9208c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_8; 9218c2ecf20Sopenharmony_ci break; 9228c2ecf20Sopenharmony_ci case 11025: 9238c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_11; 9248c2ecf20Sopenharmony_ci break; 9258c2ecf20Sopenharmony_ci case 12000: 9268c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_12; 9278c2ecf20Sopenharmony_ci break; 9288c2ecf20Sopenharmony_ci case 16000: 9298c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_16; 9308c2ecf20Sopenharmony_ci break; 9318c2ecf20Sopenharmony_ci case 22050: 9328c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_22; 9338c2ecf20Sopenharmony_ci break; 9348c2ecf20Sopenharmony_ci case 24000: 9358c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_24; 9368c2ecf20Sopenharmony_ci break; 9378c2ecf20Sopenharmony_ci case 32000: 9388c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_32; 9398c2ecf20Sopenharmony_ci break; 9408c2ecf20Sopenharmony_ci case 44100: 9418c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_44; 9428c2ecf20Sopenharmony_ci break; 9438c2ecf20Sopenharmony_ci case 48000: 9448c2ecf20Sopenharmony_ci fs_val = ISABELLE_FS_RATE_48; 9458c2ecf20Sopenharmony_ci break; 9468c2ecf20Sopenharmony_ci default: 9478c2ecf20Sopenharmony_ci return -EINVAL; 9488c2ecf20Sopenharmony_ci } 9498c2ecf20Sopenharmony_ci 9508c2ecf20Sopenharmony_ci snd_soc_component_update_bits(component, ISABELLE_FS_RATE_CFG_REG, 9518c2ecf20Sopenharmony_ci ISABELLE_FS_RATE_MASK, fs_val); 9528c2ecf20Sopenharmony_ci 9538c2ecf20Sopenharmony_ci /* bit size */ 9548c2ecf20Sopenharmony_ci switch (params_width(params)) { 9558c2ecf20Sopenharmony_ci case 20: 9568c2ecf20Sopenharmony_ci aif |= ISABELLE_AIF_LENGTH_20; 9578c2ecf20Sopenharmony_ci break; 9588c2ecf20Sopenharmony_ci case 32: 9598c2ecf20Sopenharmony_ci aif |= ISABELLE_AIF_LENGTH_32; 9608c2ecf20Sopenharmony_ci break; 9618c2ecf20Sopenharmony_ci default: 9628c2ecf20Sopenharmony_ci return -EINVAL; 9638c2ecf20Sopenharmony_ci } 9648c2ecf20Sopenharmony_ci 9658c2ecf20Sopenharmony_ci snd_soc_component_update_bits(component, ISABELLE_INTF_CFG_REG, 9668c2ecf20Sopenharmony_ci ISABELLE_AIF_LENGTH_MASK, aif); 9678c2ecf20Sopenharmony_ci 9688c2ecf20Sopenharmony_ci return 0; 9698c2ecf20Sopenharmony_ci} 9708c2ecf20Sopenharmony_ci 9718c2ecf20Sopenharmony_cistatic int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) 9728c2ecf20Sopenharmony_ci{ 9738c2ecf20Sopenharmony_ci struct snd_soc_component *component = codec_dai->component; 9748c2ecf20Sopenharmony_ci unsigned int aif_val = 0; 9758c2ecf20Sopenharmony_ci 9768c2ecf20Sopenharmony_ci switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 9778c2ecf20Sopenharmony_ci case SND_SOC_DAIFMT_CBS_CFS: 9788c2ecf20Sopenharmony_ci aif_val &= ~ISABELLE_AIF_MS; 9798c2ecf20Sopenharmony_ci break; 9808c2ecf20Sopenharmony_ci case SND_SOC_DAIFMT_CBM_CFM: 9818c2ecf20Sopenharmony_ci aif_val |= ISABELLE_AIF_MS; 9828c2ecf20Sopenharmony_ci break; 9838c2ecf20Sopenharmony_ci default: 9848c2ecf20Sopenharmony_ci return -EINVAL; 9858c2ecf20Sopenharmony_ci } 9868c2ecf20Sopenharmony_ci 9878c2ecf20Sopenharmony_ci switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { 9888c2ecf20Sopenharmony_ci case SND_SOC_DAIFMT_I2S: 9898c2ecf20Sopenharmony_ci aif_val |= ISABELLE_I2S_MODE; 9908c2ecf20Sopenharmony_ci break; 9918c2ecf20Sopenharmony_ci case SND_SOC_DAIFMT_LEFT_J: 9928c2ecf20Sopenharmony_ci aif_val |= ISABELLE_LEFT_J_MODE; 9938c2ecf20Sopenharmony_ci break; 9948c2ecf20Sopenharmony_ci case SND_SOC_DAIFMT_PDM: 9958c2ecf20Sopenharmony_ci aif_val |= ISABELLE_PDM_MODE; 9968c2ecf20Sopenharmony_ci break; 9978c2ecf20Sopenharmony_ci default: 9988c2ecf20Sopenharmony_ci return -EINVAL; 9998c2ecf20Sopenharmony_ci } 10008c2ecf20Sopenharmony_ci 10018c2ecf20Sopenharmony_ci snd_soc_component_update_bits(component, ISABELLE_INTF_CFG_REG, 10028c2ecf20Sopenharmony_ci (ISABELLE_AIF_MS | ISABELLE_AIF_FMT_MASK), aif_val); 10038c2ecf20Sopenharmony_ci 10048c2ecf20Sopenharmony_ci return 0; 10058c2ecf20Sopenharmony_ci} 10068c2ecf20Sopenharmony_ci 10078c2ecf20Sopenharmony_ci/* Rates supported by Isabelle driver */ 10088c2ecf20Sopenharmony_ci#define ISABELLE_RATES SNDRV_PCM_RATE_8000_48000 10098c2ecf20Sopenharmony_ci 10108c2ecf20Sopenharmony_ci/* Formates supported by Isabelle driver. */ 10118c2ecf20Sopenharmony_ci#define ISABELLE_FORMATS (SNDRV_PCM_FMTBIT_S20_3LE |\ 10128c2ecf20Sopenharmony_ci SNDRV_PCM_FMTBIT_S32_LE) 10138c2ecf20Sopenharmony_ci 10148c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops isabelle_hs_dai_ops = { 10158c2ecf20Sopenharmony_ci .hw_params = isabelle_hw_params, 10168c2ecf20Sopenharmony_ci .set_fmt = isabelle_set_dai_fmt, 10178c2ecf20Sopenharmony_ci .mute_stream = isabelle_hs_mute, 10188c2ecf20Sopenharmony_ci .no_capture_mute = 1, 10198c2ecf20Sopenharmony_ci}; 10208c2ecf20Sopenharmony_ci 10218c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops isabelle_hf_dai_ops = { 10228c2ecf20Sopenharmony_ci .hw_params = isabelle_hw_params, 10238c2ecf20Sopenharmony_ci .set_fmt = isabelle_set_dai_fmt, 10248c2ecf20Sopenharmony_ci .mute_stream = isabelle_hf_mute, 10258c2ecf20Sopenharmony_ci .no_capture_mute = 1, 10268c2ecf20Sopenharmony_ci}; 10278c2ecf20Sopenharmony_ci 10288c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops isabelle_line_dai_ops = { 10298c2ecf20Sopenharmony_ci .hw_params = isabelle_hw_params, 10308c2ecf20Sopenharmony_ci .set_fmt = isabelle_set_dai_fmt, 10318c2ecf20Sopenharmony_ci .mute_stream = isabelle_line_mute, 10328c2ecf20Sopenharmony_ci .no_capture_mute = 1, 10338c2ecf20Sopenharmony_ci}; 10348c2ecf20Sopenharmony_ci 10358c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops isabelle_ul_dai_ops = { 10368c2ecf20Sopenharmony_ci .hw_params = isabelle_hw_params, 10378c2ecf20Sopenharmony_ci .set_fmt = isabelle_set_dai_fmt, 10388c2ecf20Sopenharmony_ci}; 10398c2ecf20Sopenharmony_ci 10408c2ecf20Sopenharmony_ci/* ISABELLE dai structure */ 10418c2ecf20Sopenharmony_cistatic struct snd_soc_dai_driver isabelle_dai[] = { 10428c2ecf20Sopenharmony_ci { 10438c2ecf20Sopenharmony_ci .name = "isabelle-dl1", 10448c2ecf20Sopenharmony_ci .playback = { 10458c2ecf20Sopenharmony_ci .stream_name = "Headset Playback", 10468c2ecf20Sopenharmony_ci .channels_min = 1, 10478c2ecf20Sopenharmony_ci .channels_max = 2, 10488c2ecf20Sopenharmony_ci .rates = ISABELLE_RATES, 10498c2ecf20Sopenharmony_ci .formats = ISABELLE_FORMATS, 10508c2ecf20Sopenharmony_ci }, 10518c2ecf20Sopenharmony_ci .ops = &isabelle_hs_dai_ops, 10528c2ecf20Sopenharmony_ci }, 10538c2ecf20Sopenharmony_ci { 10548c2ecf20Sopenharmony_ci .name = "isabelle-dl2", 10558c2ecf20Sopenharmony_ci .playback = { 10568c2ecf20Sopenharmony_ci .stream_name = "Handsfree Playback", 10578c2ecf20Sopenharmony_ci .channels_min = 1, 10588c2ecf20Sopenharmony_ci .channels_max = 2, 10598c2ecf20Sopenharmony_ci .rates = ISABELLE_RATES, 10608c2ecf20Sopenharmony_ci .formats = ISABELLE_FORMATS, 10618c2ecf20Sopenharmony_ci }, 10628c2ecf20Sopenharmony_ci .ops = &isabelle_hf_dai_ops, 10638c2ecf20Sopenharmony_ci }, 10648c2ecf20Sopenharmony_ci { 10658c2ecf20Sopenharmony_ci .name = "isabelle-lineout", 10668c2ecf20Sopenharmony_ci .playback = { 10678c2ecf20Sopenharmony_ci .stream_name = "Lineout Playback", 10688c2ecf20Sopenharmony_ci .channels_min = 1, 10698c2ecf20Sopenharmony_ci .channels_max = 2, 10708c2ecf20Sopenharmony_ci .rates = ISABELLE_RATES, 10718c2ecf20Sopenharmony_ci .formats = ISABELLE_FORMATS, 10728c2ecf20Sopenharmony_ci }, 10738c2ecf20Sopenharmony_ci .ops = &isabelle_line_dai_ops, 10748c2ecf20Sopenharmony_ci }, 10758c2ecf20Sopenharmony_ci { 10768c2ecf20Sopenharmony_ci .name = "isabelle-ul", 10778c2ecf20Sopenharmony_ci .capture = { 10788c2ecf20Sopenharmony_ci .stream_name = "Capture", 10798c2ecf20Sopenharmony_ci .channels_min = 1, 10808c2ecf20Sopenharmony_ci .channels_max = 2, 10818c2ecf20Sopenharmony_ci .rates = ISABELLE_RATES, 10828c2ecf20Sopenharmony_ci .formats = ISABELLE_FORMATS, 10838c2ecf20Sopenharmony_ci }, 10848c2ecf20Sopenharmony_ci .ops = &isabelle_ul_dai_ops, 10858c2ecf20Sopenharmony_ci }, 10868c2ecf20Sopenharmony_ci}; 10878c2ecf20Sopenharmony_ci 10888c2ecf20Sopenharmony_cistatic const struct snd_soc_component_driver soc_component_dev_isabelle = { 10898c2ecf20Sopenharmony_ci .set_bias_level = isabelle_set_bias_level, 10908c2ecf20Sopenharmony_ci .controls = isabelle_snd_controls, 10918c2ecf20Sopenharmony_ci .num_controls = ARRAY_SIZE(isabelle_snd_controls), 10928c2ecf20Sopenharmony_ci .dapm_widgets = isabelle_dapm_widgets, 10938c2ecf20Sopenharmony_ci .num_dapm_widgets = ARRAY_SIZE(isabelle_dapm_widgets), 10948c2ecf20Sopenharmony_ci .dapm_routes = isabelle_intercon, 10958c2ecf20Sopenharmony_ci .num_dapm_routes = ARRAY_SIZE(isabelle_intercon), 10968c2ecf20Sopenharmony_ci .use_pmdown_time = 1, 10978c2ecf20Sopenharmony_ci .endianness = 1, 10988c2ecf20Sopenharmony_ci .non_legacy_dai_naming = 1, 10998c2ecf20Sopenharmony_ci}; 11008c2ecf20Sopenharmony_ci 11018c2ecf20Sopenharmony_cistatic const struct regmap_config isabelle_regmap_config = { 11028c2ecf20Sopenharmony_ci .reg_bits = 8, 11038c2ecf20Sopenharmony_ci .val_bits = 8, 11048c2ecf20Sopenharmony_ci 11058c2ecf20Sopenharmony_ci .max_register = ISABELLE_MAX_REGISTER, 11068c2ecf20Sopenharmony_ci .reg_defaults = isabelle_reg_defs, 11078c2ecf20Sopenharmony_ci .num_reg_defaults = ARRAY_SIZE(isabelle_reg_defs), 11088c2ecf20Sopenharmony_ci .cache_type = REGCACHE_RBTREE, 11098c2ecf20Sopenharmony_ci}; 11108c2ecf20Sopenharmony_ci 11118c2ecf20Sopenharmony_cistatic int isabelle_i2c_probe(struct i2c_client *i2c, 11128c2ecf20Sopenharmony_ci const struct i2c_device_id *id) 11138c2ecf20Sopenharmony_ci{ 11148c2ecf20Sopenharmony_ci struct regmap *isabelle_regmap; 11158c2ecf20Sopenharmony_ci int ret = 0; 11168c2ecf20Sopenharmony_ci 11178c2ecf20Sopenharmony_ci isabelle_regmap = devm_regmap_init_i2c(i2c, &isabelle_regmap_config); 11188c2ecf20Sopenharmony_ci if (IS_ERR(isabelle_regmap)) { 11198c2ecf20Sopenharmony_ci ret = PTR_ERR(isabelle_regmap); 11208c2ecf20Sopenharmony_ci dev_err(&i2c->dev, "Failed to allocate register map: %d\n", 11218c2ecf20Sopenharmony_ci ret); 11228c2ecf20Sopenharmony_ci return ret; 11238c2ecf20Sopenharmony_ci } 11248c2ecf20Sopenharmony_ci i2c_set_clientdata(i2c, isabelle_regmap); 11258c2ecf20Sopenharmony_ci 11268c2ecf20Sopenharmony_ci ret = devm_snd_soc_register_component(&i2c->dev, 11278c2ecf20Sopenharmony_ci &soc_component_dev_isabelle, isabelle_dai, 11288c2ecf20Sopenharmony_ci ARRAY_SIZE(isabelle_dai)); 11298c2ecf20Sopenharmony_ci if (ret < 0) { 11308c2ecf20Sopenharmony_ci dev_err(&i2c->dev, "Failed to register component: %d\n", ret); 11318c2ecf20Sopenharmony_ci return ret; 11328c2ecf20Sopenharmony_ci } 11338c2ecf20Sopenharmony_ci 11348c2ecf20Sopenharmony_ci return ret; 11358c2ecf20Sopenharmony_ci} 11368c2ecf20Sopenharmony_ci 11378c2ecf20Sopenharmony_cistatic const struct i2c_device_id isabelle_i2c_id[] = { 11388c2ecf20Sopenharmony_ci { "isabelle", 0 }, 11398c2ecf20Sopenharmony_ci { } 11408c2ecf20Sopenharmony_ci}; 11418c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(i2c, isabelle_i2c_id); 11428c2ecf20Sopenharmony_ci 11438c2ecf20Sopenharmony_cistatic struct i2c_driver isabelle_i2c_driver = { 11448c2ecf20Sopenharmony_ci .driver = { 11458c2ecf20Sopenharmony_ci .name = "isabelle", 11468c2ecf20Sopenharmony_ci }, 11478c2ecf20Sopenharmony_ci .probe = isabelle_i2c_probe, 11488c2ecf20Sopenharmony_ci .id_table = isabelle_i2c_id, 11498c2ecf20Sopenharmony_ci}; 11508c2ecf20Sopenharmony_ci 11518c2ecf20Sopenharmony_cimodule_i2c_driver(isabelle_i2c_driver); 11528c2ecf20Sopenharmony_ci 11538c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("ASoC ISABELLE driver"); 11548c2ecf20Sopenharmony_ciMODULE_AUTHOR("Vishwas A Deshpande <vishwas.a.deshpande@ti.com>"); 11558c2ecf20Sopenharmony_ciMODULE_AUTHOR("M R Swami Reddy <MR.Swami.Reddy@ti.com>"); 11568c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2"); 1157