18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * lm49453.c  -  LM49453 ALSA Soc Audio driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2012 Texas Instruments, Inc
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Initially based on sound/soc/codecs/wm8350.c
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#include <linux/module.h>
118c2ecf20Sopenharmony_ci#include <linux/moduleparam.h>
128c2ecf20Sopenharmony_ci#include <linux/kernel.h>
138c2ecf20Sopenharmony_ci#include <linux/init.h>
148c2ecf20Sopenharmony_ci#include <linux/delay.h>
158c2ecf20Sopenharmony_ci#include <linux/pm.h>
168c2ecf20Sopenharmony_ci#include <linux/i2c.h>
178c2ecf20Sopenharmony_ci#include <linux/regmap.h>
188c2ecf20Sopenharmony_ci#include <linux/slab.h>
198c2ecf20Sopenharmony_ci#include <sound/core.h>
208c2ecf20Sopenharmony_ci#include <sound/pcm.h>
218c2ecf20Sopenharmony_ci#include <sound/pcm_params.h>
228c2ecf20Sopenharmony_ci#include <sound/soc.h>
238c2ecf20Sopenharmony_ci#include <sound/soc-dapm.h>
248c2ecf20Sopenharmony_ci#include <sound/tlv.h>
258c2ecf20Sopenharmony_ci#include <sound/jack.h>
268c2ecf20Sopenharmony_ci#include <sound/initval.h>
278c2ecf20Sopenharmony_ci#include <asm/div64.h>
288c2ecf20Sopenharmony_ci#include "lm49453.h"
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_cistatic const struct reg_default lm49453_reg_defs[] = {
318c2ecf20Sopenharmony_ci	{ 0, 0x00 },
328c2ecf20Sopenharmony_ci	{ 1, 0x00 },
338c2ecf20Sopenharmony_ci	{ 2, 0x00 },
348c2ecf20Sopenharmony_ci	{ 3, 0x00 },
358c2ecf20Sopenharmony_ci	{ 4, 0x00 },
368c2ecf20Sopenharmony_ci	{ 5, 0x00 },
378c2ecf20Sopenharmony_ci	{ 6, 0x00 },
388c2ecf20Sopenharmony_ci	{ 7, 0x00 },
398c2ecf20Sopenharmony_ci	{ 8, 0x00 },
408c2ecf20Sopenharmony_ci	{ 9, 0x00 },
418c2ecf20Sopenharmony_ci	{ 10, 0x00 },
428c2ecf20Sopenharmony_ci	{ 11, 0x00 },
438c2ecf20Sopenharmony_ci	{ 12, 0x00 },
448c2ecf20Sopenharmony_ci	{ 13, 0x00 },
458c2ecf20Sopenharmony_ci	{ 14, 0x00 },
468c2ecf20Sopenharmony_ci	{ 15, 0x00 },
478c2ecf20Sopenharmony_ci	{ 16, 0x00 },
488c2ecf20Sopenharmony_ci	{ 17, 0x00 },
498c2ecf20Sopenharmony_ci	{ 18, 0x00 },
508c2ecf20Sopenharmony_ci	{ 19, 0x00 },
518c2ecf20Sopenharmony_ci	{ 20, 0x00 },
528c2ecf20Sopenharmony_ci	{ 21, 0x00 },
538c2ecf20Sopenharmony_ci	{ 22, 0x00 },
548c2ecf20Sopenharmony_ci	{ 23, 0x00 },
558c2ecf20Sopenharmony_ci	{ 32, 0x00 },
568c2ecf20Sopenharmony_ci	{ 33, 0x00 },
578c2ecf20Sopenharmony_ci	{ 35, 0x00 },
588c2ecf20Sopenharmony_ci	{ 36, 0x00 },
598c2ecf20Sopenharmony_ci	{ 37, 0x00 },
608c2ecf20Sopenharmony_ci	{ 46, 0x00 },
618c2ecf20Sopenharmony_ci	{ 48, 0x00 },
628c2ecf20Sopenharmony_ci	{ 49, 0x00 },
638c2ecf20Sopenharmony_ci	{ 51, 0x00 },
648c2ecf20Sopenharmony_ci	{ 56, 0x00 },
658c2ecf20Sopenharmony_ci	{ 58, 0x00 },
668c2ecf20Sopenharmony_ci	{ 59, 0x00 },
678c2ecf20Sopenharmony_ci	{ 60, 0x00 },
688c2ecf20Sopenharmony_ci	{ 61, 0x00 },
698c2ecf20Sopenharmony_ci	{ 62, 0x00 },
708c2ecf20Sopenharmony_ci	{ 63, 0x00 },
718c2ecf20Sopenharmony_ci	{ 64, 0x00 },
728c2ecf20Sopenharmony_ci	{ 65, 0x00 },
738c2ecf20Sopenharmony_ci	{ 66, 0x00 },
748c2ecf20Sopenharmony_ci	{ 67, 0x00 },
758c2ecf20Sopenharmony_ci	{ 68, 0x00 },
768c2ecf20Sopenharmony_ci	{ 69, 0x00 },
778c2ecf20Sopenharmony_ci	{ 70, 0x00 },
788c2ecf20Sopenharmony_ci	{ 71, 0x00 },
798c2ecf20Sopenharmony_ci	{ 72, 0x00 },
808c2ecf20Sopenharmony_ci	{ 73, 0x00 },
818c2ecf20Sopenharmony_ci	{ 74, 0x00 },
828c2ecf20Sopenharmony_ci	{ 75, 0x00 },
838c2ecf20Sopenharmony_ci	{ 76, 0x00 },
848c2ecf20Sopenharmony_ci	{ 77, 0x00 },
858c2ecf20Sopenharmony_ci	{ 78, 0x00 },
868c2ecf20Sopenharmony_ci	{ 79, 0x00 },
878c2ecf20Sopenharmony_ci	{ 80, 0x00 },
888c2ecf20Sopenharmony_ci	{ 81, 0x00 },
898c2ecf20Sopenharmony_ci	{ 82, 0x00 },
908c2ecf20Sopenharmony_ci	{ 83, 0x00 },
918c2ecf20Sopenharmony_ci	{ 85, 0x00 },
928c2ecf20Sopenharmony_ci	{ 85, 0x00 },
938c2ecf20Sopenharmony_ci	{ 86, 0x00 },
948c2ecf20Sopenharmony_ci	{ 87, 0x00 },
958c2ecf20Sopenharmony_ci	{ 88, 0x00 },
968c2ecf20Sopenharmony_ci	{ 89, 0x00 },
978c2ecf20Sopenharmony_ci	{ 90, 0x00 },
988c2ecf20Sopenharmony_ci	{ 91, 0x00 },
998c2ecf20Sopenharmony_ci	{ 92, 0x00 },
1008c2ecf20Sopenharmony_ci	{ 93, 0x00 },
1018c2ecf20Sopenharmony_ci	{ 94, 0x00 },
1028c2ecf20Sopenharmony_ci	{ 95, 0x00 },
1038c2ecf20Sopenharmony_ci	{ 96, 0x01 },
1048c2ecf20Sopenharmony_ci	{ 97, 0x00 },
1058c2ecf20Sopenharmony_ci	{ 98, 0x00 },
1068c2ecf20Sopenharmony_ci	{ 99, 0x00 },
1078c2ecf20Sopenharmony_ci	{ 100, 0x00 },
1088c2ecf20Sopenharmony_ci	{ 101, 0x00 },
1098c2ecf20Sopenharmony_ci	{ 102, 0x00 },
1108c2ecf20Sopenharmony_ci	{ 103, 0x01 },
1118c2ecf20Sopenharmony_ci	{ 104, 0x01 },
1128c2ecf20Sopenharmony_ci	{ 105, 0x00 },
1138c2ecf20Sopenharmony_ci	{ 106, 0x01 },
1148c2ecf20Sopenharmony_ci	{ 107, 0x00 },
1158c2ecf20Sopenharmony_ci	{ 108, 0x00 },
1168c2ecf20Sopenharmony_ci	{ 109, 0x00 },
1178c2ecf20Sopenharmony_ci	{ 110, 0x00 },
1188c2ecf20Sopenharmony_ci	{ 111, 0x02 },
1198c2ecf20Sopenharmony_ci	{ 112, 0x02 },
1208c2ecf20Sopenharmony_ci	{ 113, 0x00 },
1218c2ecf20Sopenharmony_ci	{ 121, 0x80 },
1228c2ecf20Sopenharmony_ci	{ 122, 0xBB },
1238c2ecf20Sopenharmony_ci	{ 123, 0x80 },
1248c2ecf20Sopenharmony_ci	{ 124, 0xBB },
1258c2ecf20Sopenharmony_ci	{ 128, 0x00 },
1268c2ecf20Sopenharmony_ci	{ 130, 0x00 },
1278c2ecf20Sopenharmony_ci	{ 131, 0x00 },
1288c2ecf20Sopenharmony_ci	{ 132, 0x00 },
1298c2ecf20Sopenharmony_ci	{ 133, 0x0A },
1308c2ecf20Sopenharmony_ci	{ 134, 0x0A },
1318c2ecf20Sopenharmony_ci	{ 135, 0x0A },
1328c2ecf20Sopenharmony_ci	{ 136, 0x0F },
1338c2ecf20Sopenharmony_ci	{ 137, 0x00 },
1348c2ecf20Sopenharmony_ci	{ 138, 0x73 },
1358c2ecf20Sopenharmony_ci	{ 139, 0x33 },
1368c2ecf20Sopenharmony_ci	{ 140, 0x73 },
1378c2ecf20Sopenharmony_ci	{ 141, 0x33 },
1388c2ecf20Sopenharmony_ci	{ 142, 0x73 },
1398c2ecf20Sopenharmony_ci	{ 143, 0x33 },
1408c2ecf20Sopenharmony_ci	{ 144, 0x73 },
1418c2ecf20Sopenharmony_ci	{ 145, 0x33 },
1428c2ecf20Sopenharmony_ci	{ 146, 0x73 },
1438c2ecf20Sopenharmony_ci	{ 147, 0x33 },
1448c2ecf20Sopenharmony_ci	{ 148, 0x73 },
1458c2ecf20Sopenharmony_ci	{ 149, 0x33 },
1468c2ecf20Sopenharmony_ci	{ 150, 0x73 },
1478c2ecf20Sopenharmony_ci	{ 151, 0x33 },
1488c2ecf20Sopenharmony_ci	{ 152, 0x00 },
1498c2ecf20Sopenharmony_ci	{ 153, 0x00 },
1508c2ecf20Sopenharmony_ci	{ 154, 0x00 },
1518c2ecf20Sopenharmony_ci	{ 155, 0x00 },
1528c2ecf20Sopenharmony_ci	{ 176, 0x00 },
1538c2ecf20Sopenharmony_ci	{ 177, 0x00 },
1548c2ecf20Sopenharmony_ci	{ 178, 0x00 },
1558c2ecf20Sopenharmony_ci	{ 179, 0x00 },
1568c2ecf20Sopenharmony_ci	{ 180, 0x00 },
1578c2ecf20Sopenharmony_ci	{ 181, 0x00 },
1588c2ecf20Sopenharmony_ci	{ 182, 0x00 },
1598c2ecf20Sopenharmony_ci	{ 183, 0x00 },
1608c2ecf20Sopenharmony_ci	{ 184, 0x00 },
1618c2ecf20Sopenharmony_ci	{ 185, 0x00 },
1628c2ecf20Sopenharmony_ci	{ 186, 0x00 },
1638c2ecf20Sopenharmony_ci	{ 187, 0x00 },
1648c2ecf20Sopenharmony_ci	{ 188, 0x00 },
1658c2ecf20Sopenharmony_ci	{ 189, 0x00 },
1668c2ecf20Sopenharmony_ci	{ 208, 0x06 },
1678c2ecf20Sopenharmony_ci	{ 209, 0x00 },
1688c2ecf20Sopenharmony_ci	{ 210, 0x08 },
1698c2ecf20Sopenharmony_ci	{ 211, 0x54 },
1708c2ecf20Sopenharmony_ci	{ 212, 0x14 },
1718c2ecf20Sopenharmony_ci	{ 213, 0x0d },
1728c2ecf20Sopenharmony_ci	{ 214, 0x0d },
1738c2ecf20Sopenharmony_ci	{ 215, 0x14 },
1748c2ecf20Sopenharmony_ci	{ 216, 0x60 },
1758c2ecf20Sopenharmony_ci	{ 221, 0x00 },
1768c2ecf20Sopenharmony_ci	{ 222, 0x00 },
1778c2ecf20Sopenharmony_ci	{ 223, 0x00 },
1788c2ecf20Sopenharmony_ci	{ 224, 0x00 },
1798c2ecf20Sopenharmony_ci	{ 248, 0x00 },
1808c2ecf20Sopenharmony_ci	{ 249, 0x00 },
1818c2ecf20Sopenharmony_ci	{ 250, 0x00 },
1828c2ecf20Sopenharmony_ci	{ 255, 0x00 },
1838c2ecf20Sopenharmony_ci};
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci/* codec private data */
1868c2ecf20Sopenharmony_cistruct lm49453_priv {
1878c2ecf20Sopenharmony_ci	struct regmap *regmap;
1888c2ecf20Sopenharmony_ci};
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci/* capture path controls */
1918c2ecf20Sopenharmony_ci
1928c2ecf20Sopenharmony_cistatic const char *lm49453_mic2mode_text[] = {"Single Ended", "Differential"};
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_cistatic SOC_ENUM_SINGLE_DECL(lm49453_mic2mode_enum, LM49453_P0_MICR_REG, 5,
1958c2ecf20Sopenharmony_ci			    lm49453_mic2mode_text);
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_cistatic const char *lm49453_dmic_cfg_text[] = {"DMICDAT1", "DMICDAT2"};
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_cistatic SOC_ENUM_SINGLE_DECL(lm49453_dmic12_cfg_enum,
2008c2ecf20Sopenharmony_ci			    LM49453_P0_DIGITAL_MIC1_CONFIG_REG, 7,
2018c2ecf20Sopenharmony_ci			    lm49453_dmic_cfg_text);
2028c2ecf20Sopenharmony_ci
2038c2ecf20Sopenharmony_cistatic SOC_ENUM_SINGLE_DECL(lm49453_dmic34_cfg_enum,
2048c2ecf20Sopenharmony_ci			    LM49453_P0_DIGITAL_MIC2_CONFIG_REG, 7,
2058c2ecf20Sopenharmony_ci			    lm49453_dmic_cfg_text);
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci/* MUX Controls */
2088c2ecf20Sopenharmony_cistatic const char *lm49453_adcl_mux_text[] = { "MIC1", "Aux_L" };
2098c2ecf20Sopenharmony_ci
2108c2ecf20Sopenharmony_cistatic const char *lm49453_adcr_mux_text[] = { "MIC2", "Aux_R" };
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_cistatic SOC_ENUM_SINGLE_DECL(lm49453_adcl_enum,
2138c2ecf20Sopenharmony_ci			    LM49453_P0_ANALOG_MIXER_ADC_REG, 0,
2148c2ecf20Sopenharmony_ci			    lm49453_adcl_mux_text);
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_cistatic SOC_ENUM_SINGLE_DECL(lm49453_adcr_enum,
2178c2ecf20Sopenharmony_ci			    LM49453_P0_ANALOG_MIXER_ADC_REG, 1,
2188c2ecf20Sopenharmony_ci			    lm49453_adcr_mux_text);
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_adcl_mux_control =
2218c2ecf20Sopenharmony_ci	SOC_DAPM_ENUM("ADC Left Mux", lm49453_adcl_enum);
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_adcr_mux_control =
2248c2ecf20Sopenharmony_ci	SOC_DAPM_ENUM("ADC Right Mux", lm49453_adcr_enum);
2258c2ecf20Sopenharmony_ci
2268c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_headset_left_mixer[] = {
2278c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHPL1_REG, 0, 1, 0),
2288c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHPL1_REG, 1, 1, 0),
2298c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHPL1_REG, 2, 1, 0),
2308c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHPL1_REG, 3, 1, 0),
2318c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHPL1_REG, 4, 1, 0),
2328c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHPL1_REG, 5, 1, 0),
2338c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHPL1_REG, 6, 1, 0),
2348c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHPL1_REG, 7, 1, 0),
2358c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHPL2_REG, 0, 1, 0),
2368c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHPL2_REG, 1, 1, 0),
2378c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHPL2_REG, 2, 1, 0),
2388c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHPL2_REG, 3, 1, 0),
2398c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHPL2_REG, 4, 1, 0),
2408c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHPL2_REG, 5, 1, 0),
2418c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHPL2_REG, 6, 1, 0),
2428c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHPL2_REG, 7, 1, 0),
2438c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 0, 0, 0),
2448c2ecf20Sopenharmony_ci};
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_headset_right_mixer[] = {
2478c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHPR1_REG, 0, 1, 0),
2488c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHPR1_REG, 1, 1, 0),
2498c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHPR1_REG, 2, 1, 0),
2508c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHPR1_REG, 3, 1, 0),
2518c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHPR1_REG, 4, 1, 0),
2528c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHPR1_REG, 5, 1, 0),
2538c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHPR1_REG, 6, 1, 0),
2548c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHPR1_REG, 7, 1, 0),
2558c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHPR2_REG, 0, 1, 0),
2568c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHPR2_REG, 1, 1, 0),
2578c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHPR2_REG, 2, 1, 0),
2588c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHPR2_REG, 3, 1, 0),
2598c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHPR2_REG, 4, 1, 0),
2608c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHPR2_REG, 5, 1, 0),
2618c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHPR2_REG, 6, 1, 0),
2628c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHPR2_REG, 7, 1, 0),
2638c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 1, 0, 0),
2648c2ecf20Sopenharmony_ci};
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_speaker_left_mixer[] = {
2678c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLSL1_REG, 0, 1, 0),
2688c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLSL1_REG, 1, 1, 0),
2698c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLSL1_REG, 2, 1, 0),
2708c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLSL1_REG, 3, 1, 0),
2718c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLSL1_REG, 4, 1, 0),
2728c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLSL1_REG, 5, 1, 0),
2738c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLSL1_REG, 6, 1, 0),
2748c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLSL1_REG, 7, 1, 0),
2758c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLSL2_REG, 0, 1, 0),
2768c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLSL2_REG, 1, 1, 0),
2778c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLSL2_REG, 2, 1, 0),
2788c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLSL2_REG, 3, 1, 0),
2798c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLSL2_REG, 4, 1, 0),
2808c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLSL2_REG, 5, 1, 0),
2818c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLSL2_REG, 6, 1, 0),
2828c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLSL2_REG, 7, 1, 0),
2838c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 2, 0, 0),
2848c2ecf20Sopenharmony_ci};
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_speaker_right_mixer[] = {
2878c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLSR1_REG, 0, 1, 0),
2888c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLSR1_REG, 1, 1, 0),
2898c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLSR1_REG, 2, 1, 0),
2908c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLSR1_REG, 3, 1, 0),
2918c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLSR1_REG, 4, 1, 0),
2928c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLSR1_REG, 5, 1, 0),
2938c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLSR1_REG, 6, 1, 0),
2948c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLSR1_REG, 7, 1, 0),
2958c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLSR2_REG, 0, 1, 0),
2968c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLSR2_REG, 1, 1, 0),
2978c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLSR2_REG, 2, 1, 0),
2988c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLSR2_REG, 3, 1, 0),
2998c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLSR2_REG, 4, 1, 0),
3008c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLSR2_REG, 5, 1, 0),
3018c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLSR2_REG, 6, 1, 0),
3028c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLSR2_REG, 7, 1, 0),
3038c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 3, 0, 0),
3048c2ecf20Sopenharmony_ci};
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_haptic_left_mixer[] = {
3078c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHAL1_REG, 0, 1, 0),
3088c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHAL1_REG, 1, 1, 0),
3098c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHAL1_REG, 2, 1, 0),
3108c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHAL1_REG, 3, 1, 0),
3118c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHAL1_REG, 4, 1, 0),
3128c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHAL1_REG, 5, 1, 0),
3138c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHAL1_REG, 6, 1, 0),
3148c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHAL1_REG, 7, 1, 0),
3158c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHAL2_REG, 0, 1, 0),
3168c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHAL2_REG, 1, 1, 0),
3178c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHAL2_REG, 2, 1, 0),
3188c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHAL2_REG, 3, 1, 0),
3198c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHAL2_REG, 4, 1, 0),
3208c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHAL2_REG, 5, 1, 0),
3218c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHAL2_REG, 6, 1, 0),
3228c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHAL2_REG, 7, 1, 0),
3238c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 4, 0, 0),
3248c2ecf20Sopenharmony_ci};
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_haptic_right_mixer[] = {
3278c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACHAR1_REG, 0, 1, 0),
3288c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACHAR1_REG, 1, 1, 0),
3298c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACHAR1_REG, 2, 1, 0),
3308c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACHAR1_REG, 3, 1, 0),
3318c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACHAR1_REG, 4, 1, 0),
3328c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACHAR1_REG, 5, 1, 0),
3338c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACHAR1_REG, 6, 1, 0),
3348c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACHAR1_REG, 7, 1, 0),
3358c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACHAR2_REG, 0, 1, 0),
3368c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACHAR2_REG, 1, 1, 0),
3378c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACHAR2_REG, 2, 1, 0),
3388c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACHAR2_REG, 3, 1, 0),
3398c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACHAR2_REG, 4, 1, 0),
3408c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACHAR2_REG, 5, 1, 0),
3418c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACHAR2_REG, 6, 1, 0),
3428c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACHAR2_REG, 7, 1, 0),
3438c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 5, 0, 0),
3448c2ecf20Sopenharmony_ci};
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_lineout_left_mixer[] = {
3478c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLOL1_REG, 0, 1, 0),
3488c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLOL1_REG, 1, 1, 0),
3498c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLOL1_REG, 2, 1, 0),
3508c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLOL1_REG, 3, 1, 0),
3518c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLOL1_REG, 4, 1, 0),
3528c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLOL1_REG, 5, 1, 0),
3538c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLOL1_REG, 6, 1, 0),
3548c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLOL1_REG, 7, 1, 0),
3558c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLOL2_REG, 0, 1, 0),
3568c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLOL2_REG, 1, 1, 0),
3578c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLOL2_REG, 2, 1, 0),
3588c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLOL2_REG, 3, 1, 0),
3598c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLOL2_REG, 4, 1, 0),
3608c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLOL2_REG, 5, 1, 0),
3618c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLOL2_REG, 6, 1, 0),
3628c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLOL2_REG, 7, 1, 0),
3638c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 6, 0, 0),
3648c2ecf20Sopenharmony_ci};
3658c2ecf20Sopenharmony_ci
3668c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_lineout_right_mixer[] = {
3678c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_DACLOR1_REG, 0, 1, 0),
3688c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_DACLOR1_REG, 1, 1, 0),
3698c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_DACLOR1_REG, 2, 1, 0),
3708c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_DACLOR1_REG, 3, 1, 0),
3718c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_DACLOR1_REG, 4, 1, 0),
3728c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_DACLOR1_REG, 5, 1, 0),
3738c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_DACLOR1_REG, 6, 1, 0),
3748c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_DACLOR1_REG, 7, 1, 0),
3758c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_DACLOR2_REG, 0, 1, 0),
3768c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_DACLOR2_REG, 1, 1, 0),
3778c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_DACLOR2_REG, 2, 1, 0),
3788c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_DACLOR2_REG, 3, 1, 0),
3798c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_DACLOR2_REG, 4, 1, 0),
3808c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_DACLOR2_REG, 5, 1, 0),
3818c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_DACLOR2_REG, 6, 1, 0),
3828c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_DACLOR2_REG, 7, 1, 0),
3838c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Sidetone Switch", LM49453_P0_STN_SEL_REG, 7, 0, 0),
3848c2ecf20Sopenharmony_ci};
3858c2ecf20Sopenharmony_ci
3868c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx1_mixer[] = {
3878c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX1_REG, 0, 1, 0),
3888c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX1_REG, 1, 1, 0),
3898c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX1_REG, 2, 1, 0),
3908c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX1_REG, 3, 1, 0),
3918c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX1_REG, 4, 1, 0),
3928c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX1_REG, 5, 1, 0),
3938c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_PORT1_TX1_REG, 6, 1, 0),
3948c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_PORT1_TX1_REG, 7, 1, 0),
3958c2ecf20Sopenharmony_ci};
3968c2ecf20Sopenharmony_ci
3978c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx2_mixer[] = {
3988c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX2_REG, 0, 1, 0),
3998c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX2_REG, 1, 1, 0),
4008c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX2_REG, 2, 1, 0),
4018c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX2_REG, 3, 1, 0),
4028c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX2_REG, 4, 1, 0),
4038c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX2_REG, 5, 1, 0),
4048c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_PORT1_TX2_REG, 6, 1, 0),
4058c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT1_TX2_REG, 7, 1, 0),
4068c2ecf20Sopenharmony_ci};
4078c2ecf20Sopenharmony_ci
4088c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx3_mixer[] = {
4098c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX3_REG, 0, 1, 0),
4108c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX3_REG, 1, 1, 0),
4118c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX3_REG, 2, 1, 0),
4128c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX3_REG, 3, 1, 0),
4138c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX3_REG, 4, 1, 0),
4148c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX3_REG, 5, 1, 0),
4158c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_3 Switch", LM49453_P0_PORT1_TX3_REG, 6, 1, 0),
4168c2ecf20Sopenharmony_ci};
4178c2ecf20Sopenharmony_ci
4188c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx4_mixer[] = {
4198c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX4_REG, 0, 1, 0),
4208c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX4_REG, 1, 1, 0),
4218c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX4_REG, 2, 1, 0),
4228c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX4_REG, 3, 1, 0),
4238c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX4_REG, 4, 1, 0),
4248c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX4_REG, 5, 1, 0),
4258c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_4 Switch", LM49453_P0_PORT1_TX4_REG, 6, 1, 0),
4268c2ecf20Sopenharmony_ci};
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx5_mixer[] = {
4298c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX5_REG, 0, 1, 0),
4308c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX5_REG, 1, 1, 0),
4318c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX5_REG, 2, 1, 0),
4328c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX5_REG, 3, 1, 0),
4338c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX5_REG, 4, 1, 0),
4348c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX5_REG, 5, 1, 0),
4358c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_5 Switch", LM49453_P0_PORT1_TX5_REG, 6, 1, 0),
4368c2ecf20Sopenharmony_ci};
4378c2ecf20Sopenharmony_ci
4388c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx6_mixer[] = {
4398c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX6_REG, 0, 1, 0),
4408c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX6_REG, 1, 1, 0),
4418c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX6_REG, 2, 1, 0),
4428c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX6_REG, 3, 1, 0),
4438c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX6_REG, 4, 1, 0),
4448c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX6_REG, 5, 1, 0),
4458c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_6 Switch", LM49453_P0_PORT1_TX6_REG, 6, 1, 0),
4468c2ecf20Sopenharmony_ci};
4478c2ecf20Sopenharmony_ci
4488c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx7_mixer[] = {
4498c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX7_REG, 0, 1, 0),
4508c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX7_REG, 1, 1, 0),
4518c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX7_REG, 2, 1, 0),
4528c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX7_REG, 3, 1, 0),
4538c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX7_REG, 4, 1, 0),
4548c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX7_REG, 5, 1, 0),
4558c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_7 Switch", LM49453_P0_PORT1_TX7_REG, 6, 1, 0),
4568c2ecf20Sopenharmony_ci};
4578c2ecf20Sopenharmony_ci
4588c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port1_tx8_mixer[] = {
4598c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT1_TX8_REG, 0, 1, 0),
4608c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT1_TX8_REG, 1, 1, 0),
4618c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT1_TX8_REG, 2, 1, 0),
4628c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT1_TX8_REG, 3, 1, 0),
4638c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT1_TX8_REG, 4, 1, 0),
4648c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT1_TX8_REG, 5, 1, 0),
4658c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_8 Switch", LM49453_P0_PORT1_TX8_REG, 6, 1, 0),
4668c2ecf20Sopenharmony_ci};
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port2_tx1_mixer[] = {
4698c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT2_TX1_REG, 0, 1, 0),
4708c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT2_TX1_REG, 1, 1, 0),
4718c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT2_TX1_REG, 2, 1, 0),
4728c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT2_TX1_REG, 3, 1, 0),
4738c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT2_TX1_REG, 4, 1, 0),
4748c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT2_TX1_REG, 5, 1, 0),
4758c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_1 Switch", LM49453_P0_PORT2_TX1_REG, 6, 1, 0),
4768c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_1 Switch", LM49453_P0_PORT2_TX1_REG, 7, 1, 0),
4778c2ecf20Sopenharmony_ci};
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_port2_tx2_mixer[] = {
4808c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1L Switch", LM49453_P0_PORT2_TX2_REG, 0, 1, 0),
4818c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC1R Switch", LM49453_P0_PORT2_TX2_REG, 1, 1, 0),
4828c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2L Switch", LM49453_P0_PORT2_TX2_REG, 2, 1, 0),
4838c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("DMIC2R Switch", LM49453_P0_PORT2_TX2_REG, 3, 1, 0),
4848c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCL Switch", LM49453_P0_PORT2_TX2_REG, 4, 1, 0),
4858c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("ADCR Switch", LM49453_P0_PORT2_TX2_REG, 5, 1, 0),
4868c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port1_2 Switch", LM49453_P0_PORT2_TX2_REG, 6, 1, 0),
4878c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0),
4888c2ecf20Sopenharmony_ci};
4898c2ecf20Sopenharmony_ci
4908c2ecf20Sopenharmony_ci/* TLV Declarations */
4918c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(adc_dac_tlv, -7650, 150, 1);
4928c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 200, 1);
4938c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);
4948c2ecf20Sopenharmony_cistatic const DECLARE_TLV_DB_SCALE(stn_tlv, -7200, 150, 0);
4958c2ecf20Sopenharmony_ci
4968c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = {
4978c2ecf20Sopenharmony_ci/* Sidetone supports mono only */
4988c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG,
4998c2ecf20Sopenharmony_ci		     0, 0x3F, 0, stn_tlv),
5008c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG,
5018c2ecf20Sopenharmony_ci		     0, 0x3F, 0, stn_tlv),
5028c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG,
5038c2ecf20Sopenharmony_ci		     0, 0x3F, 0, stn_tlv),
5048c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG,
5058c2ecf20Sopenharmony_ci		     0, 0x3F, 0, stn_tlv),
5068c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG,
5078c2ecf20Sopenharmony_ci		     0, 0x3F, 0, stn_tlv),
5088c2ecf20Sopenharmony_ciSOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG,
5098c2ecf20Sopenharmony_ci		     0, 0x3F, 0, stn_tlv),
5108c2ecf20Sopenharmony_ci};
5118c2ecf20Sopenharmony_ci
5128c2ecf20Sopenharmony_cistatic const struct snd_kcontrol_new lm49453_snd_controls[] = {
5138c2ecf20Sopenharmony_ci	/* mic1 and mic2 supports mono only */
5148c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_MICL_REG, 0, 15, 0, mic_tlv),
5158c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_MICR_REG, 0, 15, 0, mic_tlv),
5168c2ecf20Sopenharmony_ci
5178c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("ADCL Volume", LM49453_P0_ADC_LEVELL_REG, 0, 63,
5188c2ecf20Sopenharmony_ci			0, adc_dac_tlv),
5198c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("ADCR Volume", LM49453_P0_ADC_LEVELR_REG, 0, 63,
5208c2ecf20Sopenharmony_ci			0, adc_dac_tlv),
5218c2ecf20Sopenharmony_ci
5228c2ecf20Sopenharmony_ci	SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
5238c2ecf20Sopenharmony_ci			  LM49453_P0_DMIC1_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
5248c2ecf20Sopenharmony_ci	SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG,
5258c2ecf20Sopenharmony_ci			  LM49453_P0_DMIC2_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci	SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum),
5288c2ecf20Sopenharmony_ci	SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum),
5298c2ecf20Sopenharmony_ci	SOC_DAPM_ENUM("DMIC34 SRC", lm49453_dmic34_cfg_enum),
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci	/* Capture path filter enable */
5328c2ecf20Sopenharmony_ci	SOC_SINGLE("DMIC1 HPFilter Switch", LM49453_P0_ADC_FX_ENABLES_REG,
5338c2ecf20Sopenharmony_ci					    0, 1, 0),
5348c2ecf20Sopenharmony_ci	SOC_SINGLE("DMIC2 HPFilter Switch", LM49453_P0_ADC_FX_ENABLES_REG,
5358c2ecf20Sopenharmony_ci					    1, 1, 0),
5368c2ecf20Sopenharmony_ci	SOC_SINGLE("ADC HPFilter Switch", LM49453_P0_ADC_FX_ENABLES_REG,
5378c2ecf20Sopenharmony_ci					  2, 1, 0),
5388c2ecf20Sopenharmony_ci
5398c2ecf20Sopenharmony_ci	SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG,
5408c2ecf20Sopenharmony_ci			  LM49453_P0_DAC_HP_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
5418c2ecf20Sopenharmony_ci	SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG,
5428c2ecf20Sopenharmony_ci			  LM49453_P0_DAC_LO_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
5438c2ecf20Sopenharmony_ci	SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG,
5448c2ecf20Sopenharmony_ci			  LM49453_P0_DAC_LS_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
5458c2ecf20Sopenharmony_ci	SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG,
5468c2ecf20Sopenharmony_ci			  LM49453_P0_DAC_HA_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
5478c2ecf20Sopenharmony_ci
5488c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG,
5498c2ecf20Sopenharmony_ci			0, 63, 0, adc_dac_tlv),
5508c2ecf20Sopenharmony_ci
5518c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG,
5528c2ecf20Sopenharmony_ci			0, 3, 0, port_tlv),
5538c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_2_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG,
5548c2ecf20Sopenharmony_ci			2, 3, 0, port_tlv),
5558c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_3_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG,
5568c2ecf20Sopenharmony_ci			4, 3, 0, port_tlv),
5578c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_4_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG,
5588c2ecf20Sopenharmony_ci			6, 3, 0, port_tlv),
5598c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_5_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG,
5608c2ecf20Sopenharmony_ci			0, 3, 0, port_tlv),
5618c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_6_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG,
5628c2ecf20Sopenharmony_ci			2, 3, 0, port_tlv),
5638c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_7_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG,
5648c2ecf20Sopenharmony_ci			4, 3, 0, port_tlv),
5658c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT1_8_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL2_REG,
5668c2ecf20Sopenharmony_ci			6, 3, 0, port_tlv),
5678c2ecf20Sopenharmony_ci
5688c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT2_1_RX_LVL Volume", LM49453_P0_PORT2_RX_LVL_REG,
5698c2ecf20Sopenharmony_ci			0, 3, 0, port_tlv),
5708c2ecf20Sopenharmony_ci	SOC_SINGLE_TLV("PORT2_2_RX_LVL Volume", LM49453_P0_PORT2_RX_LVL_REG,
5718c2ecf20Sopenharmony_ci			2, 3, 0, port_tlv),
5728c2ecf20Sopenharmony_ci
5738c2ecf20Sopenharmony_ci	SOC_SINGLE("Port1 Playback Switch", LM49453_P0_AUDIO_PORT1_BASIC_REG,
5748c2ecf20Sopenharmony_ci		    1, 1, 0),
5758c2ecf20Sopenharmony_ci	SOC_SINGLE("Port2 Playback Switch", LM49453_P0_AUDIO_PORT2_BASIC_REG,
5768c2ecf20Sopenharmony_ci		    1, 1, 0),
5778c2ecf20Sopenharmony_ci	SOC_SINGLE("Port1 Capture Switch", LM49453_P0_AUDIO_PORT1_BASIC_REG,
5788c2ecf20Sopenharmony_ci		    2, 1, 0),
5798c2ecf20Sopenharmony_ci	SOC_SINGLE("Port2 Capture Switch", LM49453_P0_AUDIO_PORT2_BASIC_REG,
5808c2ecf20Sopenharmony_ci		    2, 1, 0)
5818c2ecf20Sopenharmony_ci
5828c2ecf20Sopenharmony_ci};
5838c2ecf20Sopenharmony_ci
5848c2ecf20Sopenharmony_ci/* DAPM widgets */
5858c2ecf20Sopenharmony_cistatic const struct snd_soc_dapm_widget lm49453_dapm_widgets[] = {
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_ci	/* All end points HP,EP, LS, Lineout and Haptic */
5888c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("HPOUTL"),
5898c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("HPOUTR"),
5908c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("EPOUT"),
5918c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("LSOUTL"),
5928c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("LSOUTR"),
5938c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("LOOUTR"),
5948c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("LOOUTL"),
5958c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("HAOUTL"),
5968c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUTPUT("HAOUTR"),
5978c2ecf20Sopenharmony_ci
5988c2ecf20Sopenharmony_ci	SND_SOC_DAPM_INPUT("AMIC1"),
5998c2ecf20Sopenharmony_ci	SND_SOC_DAPM_INPUT("AMIC2"),
6008c2ecf20Sopenharmony_ci	SND_SOC_DAPM_INPUT("DMIC1DAT"),
6018c2ecf20Sopenharmony_ci	SND_SOC_DAPM_INPUT("DMIC2DAT"),
6028c2ecf20Sopenharmony_ci	SND_SOC_DAPM_INPUT("AUXL"),
6038c2ecf20Sopenharmony_ci	SND_SOC_DAPM_INPUT("AUXR"),
6048c2ecf20Sopenharmony_ci
6058c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_1_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6068c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_2_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6078c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_3_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6088c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_4_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6098c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_5_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6108c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_6_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6118c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_7_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6128c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT1_8_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6138c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT2_1_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6148c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("PORT2_2_RX", SND_SOC_NOPM, 0, 0, NULL, 0),
6158c2ecf20Sopenharmony_ci
6168c2ecf20Sopenharmony_ci	SND_SOC_DAPM_SUPPLY("AMIC1Bias", LM49453_P0_MICL_REG, 6, 0, NULL, 0),
6178c2ecf20Sopenharmony_ci	SND_SOC_DAPM_SUPPLY("AMIC2Bias", LM49453_P0_MICR_REG, 6, 0, NULL, 0),
6188c2ecf20Sopenharmony_ci
6198c2ecf20Sopenharmony_ci	/* playback path driver enables */
6208c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("Headset Switch",
6218c2ecf20Sopenharmony_ci			LM49453_P0_PMC_SETUP_REG, 0, 0, NULL, 0),
6228c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("Earpiece Switch",
6238c2ecf20Sopenharmony_ci			LM49453_P0_EP_REG, 0, 0, NULL, 0),
6248c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("Speaker Left Switch",
6258c2ecf20Sopenharmony_ci			LM49453_P0_DIS_PKVL_FB_REG, 0, 1, NULL, 0),
6268c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("Speaker Right Switch",
6278c2ecf20Sopenharmony_ci			LM49453_P0_DIS_PKVL_FB_REG, 1, 1, NULL, 0),
6288c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("Haptic Left Switch",
6298c2ecf20Sopenharmony_ci			LM49453_P0_DIS_PKVL_FB_REG, 2, 1, NULL, 0),
6308c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("Haptic Right Switch",
6318c2ecf20Sopenharmony_ci			LM49453_P0_DIS_PKVL_FB_REG, 3, 1, NULL, 0),
6328c2ecf20Sopenharmony_ci
6338c2ecf20Sopenharmony_ci	/* DAC */
6348c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("HPL DAC", "Headset", SND_SOC_NOPM, 0, 0),
6358c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("HPR DAC", "Headset", SND_SOC_NOPM, 0, 0),
6368c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("LSL DAC", "Speaker", SND_SOC_NOPM, 0, 0),
6378c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("LSR DAC", "Speaker", SND_SOC_NOPM, 0, 0),
6388c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("HAL DAC", "Haptic", SND_SOC_NOPM, 0, 0),
6398c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("HAR DAC", "Haptic", SND_SOC_NOPM, 0, 0),
6408c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("LOL DAC", "Lineout", SND_SOC_NOPM, 0, 0),
6418c2ecf20Sopenharmony_ci	SND_SOC_DAPM_DAC("LOR DAC", "Lineout", SND_SOC_NOPM, 0, 0),
6428c2ecf20Sopenharmony_ci
6438c2ecf20Sopenharmony_ci
6448c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("AUXL Input",
6458c2ecf20Sopenharmony_ci			LM49453_P0_ANALOG_MIXER_ADC_REG, 2, 0, NULL, 0),
6468c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("AUXR Input",
6478c2ecf20Sopenharmony_ci			LM49453_P0_ANALOG_MIXER_ADC_REG, 3, 0, NULL, 0),
6488c2ecf20Sopenharmony_ci
6498c2ecf20Sopenharmony_ci	SND_SOC_DAPM_PGA("Sidetone", SND_SOC_NOPM, 0, 0, NULL, 0),
6508c2ecf20Sopenharmony_ci
6518c2ecf20Sopenharmony_ci	/* ADC */
6528c2ecf20Sopenharmony_ci	SND_SOC_DAPM_ADC("DMIC1 Left", "Capture", SND_SOC_NOPM, 1, 0),
6538c2ecf20Sopenharmony_ci	SND_SOC_DAPM_ADC("DMIC1 Right", "Capture", SND_SOC_NOPM, 1, 0),
6548c2ecf20Sopenharmony_ci	SND_SOC_DAPM_ADC("DMIC2 Left", "Capture", SND_SOC_NOPM, 1, 0),
6558c2ecf20Sopenharmony_ci	SND_SOC_DAPM_ADC("DMIC2 Right", "Capture", SND_SOC_NOPM, 1, 0),
6568c2ecf20Sopenharmony_ci
6578c2ecf20Sopenharmony_ci	SND_SOC_DAPM_ADC("ADC Left", "Capture", SND_SOC_NOPM, 1, 0),
6588c2ecf20Sopenharmony_ci	SND_SOC_DAPM_ADC("ADC Right", "Capture", SND_SOC_NOPM, 0, 0),
6598c2ecf20Sopenharmony_ci
6608c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MUX("ADCL Mux", SND_SOC_NOPM, 0, 0,
6618c2ecf20Sopenharmony_ci			  &lm49453_adcl_mux_control),
6628c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MUX("ADCR Mux", SND_SOC_NOPM, 0, 0,
6638c2ecf20Sopenharmony_ci			  &lm49453_adcr_mux_control),
6648c2ecf20Sopenharmony_ci
6658c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MUX("Mic1 Input",
6668c2ecf20Sopenharmony_ci			SND_SOC_NOPM, 0, 0, &lm49453_adcl_mux_control),
6678c2ecf20Sopenharmony_ci
6688c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MUX("Mic2 Input",
6698c2ecf20Sopenharmony_ci			SND_SOC_NOPM, 0, 0, &lm49453_adcr_mux_control),
6708c2ecf20Sopenharmony_ci
6718c2ecf20Sopenharmony_ci	/* AIF */
6728c2ecf20Sopenharmony_ci	SND_SOC_DAPM_AIF_IN("PORT1_SDI", NULL, 0,
6738c2ecf20Sopenharmony_ci			    LM49453_P0_PULL_CONFIG1_REG, 2, 0),
6748c2ecf20Sopenharmony_ci	SND_SOC_DAPM_AIF_IN("PORT2_SDI", NULL, 0,
6758c2ecf20Sopenharmony_ci			    LM49453_P0_PULL_CONFIG1_REG, 6, 0),
6768c2ecf20Sopenharmony_ci
6778c2ecf20Sopenharmony_ci	SND_SOC_DAPM_AIF_OUT("PORT1_SDO", NULL, 0,
6788c2ecf20Sopenharmony_ci			     LM49453_P0_PULL_CONFIG1_REG, 3, 0),
6798c2ecf20Sopenharmony_ci	SND_SOC_DAPM_AIF_OUT("PORT2_SDO", NULL, 0,
6808c2ecf20Sopenharmony_ci			      LM49453_P0_PULL_CONFIG1_REG, 7, 0),
6818c2ecf20Sopenharmony_ci
6828c2ecf20Sopenharmony_ci	/* Port1 TX controls */
6838c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_1_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6848c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_2_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6858c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_3_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6868c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_4_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6878c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_5_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6888c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_6_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6898c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_7_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6908c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P1_8_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6918c2ecf20Sopenharmony_ci
6928c2ecf20Sopenharmony_ci	/* Port2 TX controls */
6938c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P2_1_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6948c2ecf20Sopenharmony_ci	SND_SOC_DAPM_OUT_DRV("P2_2_TX", SND_SOC_NOPM, 0, 0, NULL, 0),
6958c2ecf20Sopenharmony_ci
6968c2ecf20Sopenharmony_ci	/* Sidetone Mixer */
6978c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Sidetone Mixer", SND_SOC_NOPM, 0, 0,
6988c2ecf20Sopenharmony_ci			    lm49453_sidetone_mixer_controls,
6998c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_sidetone_mixer_controls)),
7008c2ecf20Sopenharmony_ci
7018c2ecf20Sopenharmony_ci	/* DAC MIXERS */
7028c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("HPL Mixer", SND_SOC_NOPM, 0, 0,
7038c2ecf20Sopenharmony_ci			    lm49453_headset_left_mixer,
7048c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_headset_left_mixer)),
7058c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("HPR Mixer", SND_SOC_NOPM, 0, 0,
7068c2ecf20Sopenharmony_ci			    lm49453_headset_right_mixer,
7078c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_headset_right_mixer)),
7088c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("LOL Mixer", SND_SOC_NOPM, 0, 0,
7098c2ecf20Sopenharmony_ci			    lm49453_lineout_left_mixer,
7108c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_lineout_left_mixer)),
7118c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("LOR Mixer", SND_SOC_NOPM, 0, 0,
7128c2ecf20Sopenharmony_ci			    lm49453_lineout_right_mixer,
7138c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_lineout_right_mixer)),
7148c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("LSL Mixer", SND_SOC_NOPM, 0, 0,
7158c2ecf20Sopenharmony_ci			    lm49453_speaker_left_mixer,
7168c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_speaker_left_mixer)),
7178c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("LSR Mixer", SND_SOC_NOPM, 0, 0,
7188c2ecf20Sopenharmony_ci			    lm49453_speaker_right_mixer,
7198c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_speaker_right_mixer)),
7208c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("HAL Mixer", SND_SOC_NOPM, 0, 0,
7218c2ecf20Sopenharmony_ci			    lm49453_haptic_left_mixer,
7228c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_haptic_left_mixer)),
7238c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("HAR Mixer", SND_SOC_NOPM, 0, 0,
7248c2ecf20Sopenharmony_ci			    lm49453_haptic_right_mixer,
7258c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_haptic_right_mixer)),
7268c2ecf20Sopenharmony_ci
7278c2ecf20Sopenharmony_ci	/* Capture Mixer */
7288c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_1 Mixer", SND_SOC_NOPM, 0, 0,
7298c2ecf20Sopenharmony_ci			    lm49453_port1_tx1_mixer,
7308c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx1_mixer)),
7318c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_2 Mixer", SND_SOC_NOPM, 0, 0,
7328c2ecf20Sopenharmony_ci			    lm49453_port1_tx2_mixer,
7338c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx2_mixer)),
7348c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_3 Mixer", SND_SOC_NOPM, 0, 0,
7358c2ecf20Sopenharmony_ci			    lm49453_port1_tx3_mixer,
7368c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx3_mixer)),
7378c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_4 Mixer", SND_SOC_NOPM, 0, 0,
7388c2ecf20Sopenharmony_ci			    lm49453_port1_tx4_mixer,
7398c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx4_mixer)),
7408c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_5 Mixer", SND_SOC_NOPM, 0, 0,
7418c2ecf20Sopenharmony_ci			    lm49453_port1_tx5_mixer,
7428c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx5_mixer)),
7438c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_6 Mixer", SND_SOC_NOPM, 0, 0,
7448c2ecf20Sopenharmony_ci			    lm49453_port1_tx6_mixer,
7458c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx6_mixer)),
7468c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_7 Mixer", SND_SOC_NOPM, 0, 0,
7478c2ecf20Sopenharmony_ci			    lm49453_port1_tx7_mixer,
7488c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx7_mixer)),
7498c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port1_8 Mixer", SND_SOC_NOPM, 0, 0,
7508c2ecf20Sopenharmony_ci			    lm49453_port1_tx8_mixer,
7518c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port1_tx8_mixer)),
7528c2ecf20Sopenharmony_ci
7538c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port2_1 Mixer", SND_SOC_NOPM, 0, 0,
7548c2ecf20Sopenharmony_ci			    lm49453_port2_tx1_mixer,
7558c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port2_tx1_mixer)),
7568c2ecf20Sopenharmony_ci	SND_SOC_DAPM_MIXER("Port2_2 Mixer", SND_SOC_NOPM, 0, 0,
7578c2ecf20Sopenharmony_ci			    lm49453_port2_tx2_mixer,
7588c2ecf20Sopenharmony_ci			    ARRAY_SIZE(lm49453_port2_tx2_mixer)),
7598c2ecf20Sopenharmony_ci};
7608c2ecf20Sopenharmony_ci
7618c2ecf20Sopenharmony_cistatic const struct snd_soc_dapm_route lm49453_audio_map[] = {
7628c2ecf20Sopenharmony_ci	/* Port SDI mapping */
7638c2ecf20Sopenharmony_ci	{ "PORT1_1_RX", "Port1 Playback Switch", "PORT1_SDI" },
7648c2ecf20Sopenharmony_ci	{ "PORT1_2_RX", "Port1 Playback Switch", "PORT1_SDI" },
7658c2ecf20Sopenharmony_ci	{ "PORT1_3_RX", "Port1 Playback Switch", "PORT1_SDI" },
7668c2ecf20Sopenharmony_ci	{ "PORT1_4_RX", "Port1 Playback Switch", "PORT1_SDI" },
7678c2ecf20Sopenharmony_ci	{ "PORT1_5_RX", "Port1 Playback Switch", "PORT1_SDI" },
7688c2ecf20Sopenharmony_ci	{ "PORT1_6_RX", "Port1 Playback Switch", "PORT1_SDI" },
7698c2ecf20Sopenharmony_ci	{ "PORT1_7_RX", "Port1 Playback Switch", "PORT1_SDI" },
7708c2ecf20Sopenharmony_ci	{ "PORT1_8_RX", "Port1 Playback Switch", "PORT1_SDI" },
7718c2ecf20Sopenharmony_ci
7728c2ecf20Sopenharmony_ci	{ "PORT2_1_RX", "Port2 Playback Switch", "PORT2_SDI" },
7738c2ecf20Sopenharmony_ci	{ "PORT2_2_RX", "Port2 Playback Switch", "PORT2_SDI" },
7748c2ecf20Sopenharmony_ci
7758c2ecf20Sopenharmony_ci	/* HP mapping */
7768c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_1 Switch", "PORT1_1_RX" },
7778c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_2 Switch", "PORT1_2_RX" },
7788c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_3 Switch", "PORT1_3_RX" },
7798c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_4 Switch", "PORT1_4_RX" },
7808c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_5 Switch", "PORT1_5_RX" },
7818c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_6 Switch", "PORT1_6_RX" },
7828c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_7 Switch", "PORT1_7_RX" },
7838c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port1_8 Switch", "PORT1_8_RX" },
7848c2ecf20Sopenharmony_ci
7858c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port2_1 Switch", "PORT2_1_RX" },
7868c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Port2_2 Switch", "PORT2_2_RX" },
7878c2ecf20Sopenharmony_ci
7888c2ecf20Sopenharmony_ci	{ "HPL Mixer", "ADCL Switch", "ADC Left" },
7898c2ecf20Sopenharmony_ci	{ "HPL Mixer", "ADCR Switch", "ADC Right" },
7908c2ecf20Sopenharmony_ci	{ "HPL Mixer", "DMIC1L Switch", "DMIC1 Left" },
7918c2ecf20Sopenharmony_ci	{ "HPL Mixer", "DMIC1R Switch", "DMIC1 Right" },
7928c2ecf20Sopenharmony_ci	{ "HPL Mixer", "DMIC2L Switch", "DMIC2 Left" },
7938c2ecf20Sopenharmony_ci	{ "HPL Mixer", "DMIC2R Switch", "DMIC2 Right" },
7948c2ecf20Sopenharmony_ci	{ "HPL Mixer", "Sidetone Switch", "Sidetone" },
7958c2ecf20Sopenharmony_ci
7968c2ecf20Sopenharmony_ci	{ "HPL DAC", NULL, "HPL Mixer" },
7978c2ecf20Sopenharmony_ci
7988c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_1 Switch", "PORT1_1_RX" },
7998c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_2 Switch", "PORT1_2_RX" },
8008c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_3 Switch", "PORT1_3_RX" },
8018c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_4 Switch", "PORT1_4_RX" },
8028c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_5 Switch", "PORT1_5_RX" },
8038c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_6 Switch", "PORT1_6_RX" },
8048c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_7 Switch", "PORT1_7_RX" },
8058c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port1_8 Switch", "PORT1_8_RX" },
8068c2ecf20Sopenharmony_ci
8078c2ecf20Sopenharmony_ci	/* Port 2 */
8088c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port2_1 Switch", "PORT2_1_RX" },
8098c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Port2_2 Switch", "PORT2_2_RX" },
8108c2ecf20Sopenharmony_ci
8118c2ecf20Sopenharmony_ci	{ "HPR Mixer", "ADCL Switch", "ADC Left" },
8128c2ecf20Sopenharmony_ci	{ "HPR Mixer", "ADCR Switch", "ADC Right" },
8138c2ecf20Sopenharmony_ci	{ "HPR Mixer", "DMIC1L Switch", "DMIC1 Left" },
8148c2ecf20Sopenharmony_ci	{ "HPR Mixer", "DMIC1R Switch", "DMIC1 Right" },
8158c2ecf20Sopenharmony_ci	{ "HPR Mixer", "DMIC2L Switch", "DMIC2 Left" },
8168c2ecf20Sopenharmony_ci	{ "HPR Mixer", "DMIC2L Switch", "DMIC2 Right" },
8178c2ecf20Sopenharmony_ci	{ "HPR Mixer", "Sidetone Switch", "Sidetone" },
8188c2ecf20Sopenharmony_ci
8198c2ecf20Sopenharmony_ci	{ "HPR DAC", NULL, "HPR Mixer" },
8208c2ecf20Sopenharmony_ci
8218c2ecf20Sopenharmony_ci	{ "HPOUTL", "Headset Switch", "HPL DAC"},
8228c2ecf20Sopenharmony_ci	{ "HPOUTR", "Headset Switch", "HPR DAC"},
8238c2ecf20Sopenharmony_ci
8248c2ecf20Sopenharmony_ci	/* EP map */
8258c2ecf20Sopenharmony_ci	{ "EPOUT", "Earpiece Switch", "HPL DAC" },
8268c2ecf20Sopenharmony_ci
8278c2ecf20Sopenharmony_ci	/* Speaker map */
8288c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_1 Switch", "PORT1_1_RX" },
8298c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_2 Switch", "PORT1_2_RX" },
8308c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_3 Switch", "PORT1_3_RX" },
8318c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_4 Switch", "PORT1_4_RX" },
8328c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_5 Switch", "PORT1_5_RX" },
8338c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_6 Switch", "PORT1_6_RX" },
8348c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_7 Switch", "PORT1_7_RX" },
8358c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port1_8 Switch", "PORT1_8_RX" },
8368c2ecf20Sopenharmony_ci
8378c2ecf20Sopenharmony_ci	/* Port 2 */
8388c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port2_1 Switch", "PORT2_1_RX" },
8398c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Port2_2 Switch", "PORT2_2_RX" },
8408c2ecf20Sopenharmony_ci
8418c2ecf20Sopenharmony_ci	{ "LSL Mixer", "ADCL Switch", "ADC Left" },
8428c2ecf20Sopenharmony_ci	{ "LSL Mixer", "ADCR Switch", "ADC Right" },
8438c2ecf20Sopenharmony_ci	{ "LSL Mixer", "DMIC1L Switch", "DMIC1 Left" },
8448c2ecf20Sopenharmony_ci	{ "LSL Mixer", "DMIC1R Switch", "DMIC1 Right" },
8458c2ecf20Sopenharmony_ci	{ "LSL Mixer", "DMIC2L Switch", "DMIC2 Left" },
8468c2ecf20Sopenharmony_ci	{ "LSL Mixer", "DMIC2R Switch", "DMIC2 Right" },
8478c2ecf20Sopenharmony_ci	{ "LSL Mixer", "Sidetone Switch", "Sidetone" },
8488c2ecf20Sopenharmony_ci
8498c2ecf20Sopenharmony_ci	{ "LSL DAC", NULL, "LSL Mixer" },
8508c2ecf20Sopenharmony_ci
8518c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_1 Switch", "PORT1_1_RX" },
8528c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_2 Switch", "PORT1_2_RX" },
8538c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_3 Switch", "PORT1_3_RX" },
8548c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_4 Switch", "PORT1_4_RX" },
8558c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_5 Switch", "PORT1_5_RX" },
8568c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_6 Switch", "PORT1_6_RX" },
8578c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_7 Switch", "PORT1_7_RX" },
8588c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port1_8 Switch", "PORT1_8_RX" },
8598c2ecf20Sopenharmony_ci
8608c2ecf20Sopenharmony_ci	/* Port 2 */
8618c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port2_1 Switch", "PORT2_1_RX" },
8628c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Port2_2 Switch", "PORT2_2_RX" },
8638c2ecf20Sopenharmony_ci
8648c2ecf20Sopenharmony_ci	{ "LSR Mixer", "ADCL Switch", "ADC Left" },
8658c2ecf20Sopenharmony_ci	{ "LSR Mixer", "ADCR Switch", "ADC Right" },
8668c2ecf20Sopenharmony_ci	{ "LSR Mixer", "DMIC1L Switch", "DMIC1 Left" },
8678c2ecf20Sopenharmony_ci	{ "LSR Mixer", "DMIC1R Switch", "DMIC1 Right" },
8688c2ecf20Sopenharmony_ci	{ "LSR Mixer", "DMIC2L Switch", "DMIC2 Left" },
8698c2ecf20Sopenharmony_ci	{ "LSR Mixer", "DMIC2R Switch", "DMIC2 Right" },
8708c2ecf20Sopenharmony_ci	{ "LSR Mixer", "Sidetone Switch", "Sidetone" },
8718c2ecf20Sopenharmony_ci
8728c2ecf20Sopenharmony_ci	{ "LSR DAC", NULL, "LSR Mixer" },
8738c2ecf20Sopenharmony_ci
8748c2ecf20Sopenharmony_ci	{ "LSOUTL", "Speaker Left Switch", "LSL DAC"},
8758c2ecf20Sopenharmony_ci	{ "LSOUTR", "Speaker Left Switch", "LSR DAC"},
8768c2ecf20Sopenharmony_ci
8778c2ecf20Sopenharmony_ci	/* Haptic map */
8788c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_1 Switch", "PORT1_1_RX" },
8798c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_2 Switch", "PORT1_2_RX" },
8808c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_3 Switch", "PORT1_3_RX" },
8818c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_4 Switch", "PORT1_4_RX" },
8828c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_5 Switch", "PORT1_5_RX" },
8838c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_6 Switch", "PORT1_6_RX" },
8848c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_7 Switch", "PORT1_7_RX" },
8858c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port1_8 Switch", "PORT1_8_RX" },
8868c2ecf20Sopenharmony_ci
8878c2ecf20Sopenharmony_ci	/* Port 2 */
8888c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port2_1 Switch", "PORT2_1_RX" },
8898c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Port2_2 Switch", "PORT2_2_RX" },
8908c2ecf20Sopenharmony_ci
8918c2ecf20Sopenharmony_ci	{ "HAL Mixer", "ADCL Switch", "ADC Left" },
8928c2ecf20Sopenharmony_ci	{ "HAL Mixer", "ADCR Switch", "ADC Right" },
8938c2ecf20Sopenharmony_ci	{ "HAL Mixer", "DMIC1L Switch", "DMIC1 Left" },
8948c2ecf20Sopenharmony_ci	{ "HAL Mixer", "DMIC1R Switch", "DMIC1 Right" },
8958c2ecf20Sopenharmony_ci	{ "HAL Mixer", "DMIC2L Switch", "DMIC2 Left" },
8968c2ecf20Sopenharmony_ci	{ "HAL Mixer", "DMIC2R Switch", "DMIC2 Right" },
8978c2ecf20Sopenharmony_ci	{ "HAL Mixer", "Sidetone Switch", "Sidetone" },
8988c2ecf20Sopenharmony_ci
8998c2ecf20Sopenharmony_ci	{ "HAL DAC", NULL, "HAL Mixer" },
9008c2ecf20Sopenharmony_ci
9018c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_1 Switch", "PORT1_1_RX" },
9028c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_2 Switch", "PORT1_2_RX" },
9038c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_3 Switch", "PORT1_3_RX" },
9048c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_4 Switch", "PORT1_4_RX" },
9058c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_5 Switch", "PORT1_5_RX" },
9068c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_6 Switch", "PORT1_6_RX" },
9078c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_7 Switch", "PORT1_7_RX" },
9088c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port1_8 Switch", "PORT1_8_RX" },
9098c2ecf20Sopenharmony_ci
9108c2ecf20Sopenharmony_ci	/* Port 2 */
9118c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port2_1 Switch", "PORT2_1_RX" },
9128c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Port2_2 Switch", "PORT2_2_RX" },
9138c2ecf20Sopenharmony_ci
9148c2ecf20Sopenharmony_ci	{ "HAR Mixer", "ADCL Switch", "ADC Left" },
9158c2ecf20Sopenharmony_ci	{ "HAR Mixer", "ADCR Switch", "ADC Right" },
9168c2ecf20Sopenharmony_ci	{ "HAR Mixer", "DMIC1L Switch", "DMIC1 Left" },
9178c2ecf20Sopenharmony_ci	{ "HAR Mixer", "DMIC1R Switch", "DMIC1 Right" },
9188c2ecf20Sopenharmony_ci	{ "HAR Mixer", "DMIC2L Switch", "DMIC2 Left" },
9198c2ecf20Sopenharmony_ci	{ "HAR Mixer", "DMIC2R Switch", "DMIC2 Right" },
9208c2ecf20Sopenharmony_ci	{ "HAR Mixer", "Sideton Switch", "Sidetone" },
9218c2ecf20Sopenharmony_ci
9228c2ecf20Sopenharmony_ci	{ "HAR DAC", NULL, "HAR Mixer" },
9238c2ecf20Sopenharmony_ci
9248c2ecf20Sopenharmony_ci	{ "HAOUTL", "Haptic Left Switch", "HAL DAC" },
9258c2ecf20Sopenharmony_ci	{ "HAOUTR", "Haptic Right Switch", "HAR DAC" },
9268c2ecf20Sopenharmony_ci
9278c2ecf20Sopenharmony_ci	/* Lineout map */
9288c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_1 Switch", "PORT1_1_RX" },
9298c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_2 Switch", "PORT1_2_RX" },
9308c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_3 Switch", "PORT1_3_RX" },
9318c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_4 Switch", "PORT1_4_RX" },
9328c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_5 Switch", "PORT1_5_RX" },
9338c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_6 Switch", "PORT1_6_RX" },
9348c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_7 Switch", "PORT1_7_RX" },
9358c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port1_8 Switch", "PORT1_8_RX" },
9368c2ecf20Sopenharmony_ci
9378c2ecf20Sopenharmony_ci	/* Port 2 */
9388c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port2_1 Switch", "PORT2_1_RX" },
9398c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Port2_2 Switch", "PORT2_2_RX" },
9408c2ecf20Sopenharmony_ci
9418c2ecf20Sopenharmony_ci	{ "LOL Mixer", "ADCL Switch", "ADC Left" },
9428c2ecf20Sopenharmony_ci	{ "LOL Mixer", "ADCR Switch", "ADC Right" },
9438c2ecf20Sopenharmony_ci	{ "LOL Mixer", "DMIC1L Switch", "DMIC1 Left" },
9448c2ecf20Sopenharmony_ci	{ "LOL Mixer", "DMIC1R Switch", "DMIC1 Right" },
9458c2ecf20Sopenharmony_ci	{ "LOL Mixer", "DMIC2L Switch", "DMIC2 Left" },
9468c2ecf20Sopenharmony_ci	{ "LOL Mixer", "DMIC2R Switch", "DMIC2 Right" },
9478c2ecf20Sopenharmony_ci	{ "LOL Mixer", "Sidetone Switch", "Sidetone" },
9488c2ecf20Sopenharmony_ci
9498c2ecf20Sopenharmony_ci	{ "LOL DAC", NULL, "LOL Mixer" },
9508c2ecf20Sopenharmony_ci
9518c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_1 Switch", "PORT1_1_RX" },
9528c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_2 Switch", "PORT1_2_RX" },
9538c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_3 Switch", "PORT1_3_RX" },
9548c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_4 Switch", "PORT1_4_RX" },
9558c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_5 Switch", "PORT1_5_RX" },
9568c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_6 Switch", "PORT1_6_RX" },
9578c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_7 Switch", "PORT1_7_RX" },
9588c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port1_8 Switch", "PORT1_8_RX" },
9598c2ecf20Sopenharmony_ci
9608c2ecf20Sopenharmony_ci	/* Port 2 */
9618c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port2_1 Switch", "PORT2_1_RX" },
9628c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Port2_2 Switch", "PORT2_2_RX" },
9638c2ecf20Sopenharmony_ci
9648c2ecf20Sopenharmony_ci	{ "LOR Mixer", "ADCL Switch", "ADC Left" },
9658c2ecf20Sopenharmony_ci	{ "LOR Mixer", "ADCR Switch", "ADC Right" },
9668c2ecf20Sopenharmony_ci	{ "LOR Mixer", "DMIC1L Switch", "DMIC1 Left" },
9678c2ecf20Sopenharmony_ci	{ "LOR Mixer", "DMIC1R Switch", "DMIC1 Right" },
9688c2ecf20Sopenharmony_ci	{ "LOR Mixer", "DMIC2L Switch", "DMIC2 Left" },
9698c2ecf20Sopenharmony_ci	{ "LOR Mixer", "DMIC2R Switch", "DMIC2 Right" },
9708c2ecf20Sopenharmony_ci	{ "LOR Mixer", "Sidetone Switch", "Sidetone" },
9718c2ecf20Sopenharmony_ci
9728c2ecf20Sopenharmony_ci	{ "LOR DAC", NULL, "LOR Mixer" },
9738c2ecf20Sopenharmony_ci
9748c2ecf20Sopenharmony_ci	{ "LOOUTL", NULL, "LOL DAC" },
9758c2ecf20Sopenharmony_ci	{ "LOOUTR", NULL, "LOR DAC" },
9768c2ecf20Sopenharmony_ci
9778c2ecf20Sopenharmony_ci	/* TX map */
9788c2ecf20Sopenharmony_ci	/* Port1 mappings */
9798c2ecf20Sopenharmony_ci	{ "Port1_1 Mixer", "ADCL Switch", "ADC Left" },
9808c2ecf20Sopenharmony_ci	{ "Port1_1 Mixer", "ADCR Switch", "ADC Right" },
9818c2ecf20Sopenharmony_ci	{ "Port1_1 Mixer", "DMIC1L Switch", "DMIC1 Left" },
9828c2ecf20Sopenharmony_ci	{ "Port1_1 Mixer", "DMIC1R Switch", "DMIC1 Right" },
9838c2ecf20Sopenharmony_ci	{ "Port1_1 Mixer", "DMIC2L Switch", "DMIC2 Left" },
9848c2ecf20Sopenharmony_ci	{ "Port1_1 Mixer", "DMIC2R Switch", "DMIC2 Right" },
9858c2ecf20Sopenharmony_ci
9868c2ecf20Sopenharmony_ci	{ "Port1_2 Mixer", "ADCL Switch", "ADC Left" },
9878c2ecf20Sopenharmony_ci	{ "Port1_2 Mixer", "ADCR Switch", "ADC Right" },
9888c2ecf20Sopenharmony_ci	{ "Port1_2 Mixer", "DMIC1L Switch", "DMIC1 Left" },
9898c2ecf20Sopenharmony_ci	{ "Port1_2 Mixer", "DMIC1R Switch", "DMIC1 Right" },
9908c2ecf20Sopenharmony_ci	{ "Port1_2 Mixer", "DMIC2L Switch", "DMIC2 Left" },
9918c2ecf20Sopenharmony_ci	{ "Port1_2 Mixer", "DMIC2R Switch", "DMIC2 Right" },
9928c2ecf20Sopenharmony_ci
9938c2ecf20Sopenharmony_ci	{ "Port1_3 Mixer", "ADCL Switch", "ADC Left" },
9948c2ecf20Sopenharmony_ci	{ "Port1_3 Mixer", "ADCR Switch", "ADC Right" },
9958c2ecf20Sopenharmony_ci	{ "Port1_3 Mixer", "DMIC1L Switch", "DMIC1 Left" },
9968c2ecf20Sopenharmony_ci	{ "Port1_3 Mixer", "DMIC1R Switch", "DMIC1 Right" },
9978c2ecf20Sopenharmony_ci	{ "Port1_3 Mixer", "DMIC2L Switch", "DMIC2 Left" },
9988c2ecf20Sopenharmony_ci	{ "Port1_3 Mixer", "DMIC2R Switch", "DMIC2 Right" },
9998c2ecf20Sopenharmony_ci
10008c2ecf20Sopenharmony_ci	{ "Port1_4 Mixer", "ADCL Switch", "ADC Left" },
10018c2ecf20Sopenharmony_ci	{ "Port1_4 Mixer", "ADCR Switch", "ADC Right" },
10028c2ecf20Sopenharmony_ci	{ "Port1_4 Mixer", "DMIC1L Switch", "DMIC1 Left" },
10038c2ecf20Sopenharmony_ci	{ "Port1_4 Mixer", "DMIC1R Switch", "DMIC1 Right" },
10048c2ecf20Sopenharmony_ci	{ "Port1_4 Mixer", "DMIC2L Switch", "DMIC2 Left" },
10058c2ecf20Sopenharmony_ci	{ "Port1_4 Mixer", "DMIC2R Switch", "DMIC2 Right" },
10068c2ecf20Sopenharmony_ci
10078c2ecf20Sopenharmony_ci	{ "Port1_5 Mixer", "ADCL Switch", "ADC Left" },
10088c2ecf20Sopenharmony_ci	{ "Port1_5 Mixer", "ADCR Switch", "ADC Right" },
10098c2ecf20Sopenharmony_ci	{ "Port1_5 Mixer", "DMIC1L Switch", "DMIC1 Left" },
10108c2ecf20Sopenharmony_ci	{ "Port1_5 Mixer", "DMIC1R Switch", "DMIC1 Right" },
10118c2ecf20Sopenharmony_ci	{ "Port1_5 Mixer", "DMIC2L Switch", "DMIC2 Left" },
10128c2ecf20Sopenharmony_ci	{ "Port1_5 Mixer", "DMIC2R Switch", "DMIC2 Right" },
10138c2ecf20Sopenharmony_ci
10148c2ecf20Sopenharmony_ci	{ "Port1_6 Mixer", "ADCL Switch", "ADC Left" },
10158c2ecf20Sopenharmony_ci	{ "Port1_6 Mixer", "ADCR Switch", "ADC Right" },
10168c2ecf20Sopenharmony_ci	{ "Port1_6 Mixer", "DMIC1L Switch", "DMIC1 Left" },
10178c2ecf20Sopenharmony_ci	{ "Port1_6 Mixer", "DMIC1R Switch", "DMIC1 Right" },
10188c2ecf20Sopenharmony_ci	{ "Port1_6 Mixer", "DMIC2L Switch", "DMIC2 Left" },
10198c2ecf20Sopenharmony_ci	{ "Port1_6 Mixer", "DMIC2R Switch", "DMIC2 Right" },
10208c2ecf20Sopenharmony_ci
10218c2ecf20Sopenharmony_ci	{ "Port1_7 Mixer", "ADCL Switch", "ADC Left" },
10228c2ecf20Sopenharmony_ci	{ "Port1_7 Mixer", "ADCR Switch", "ADC Right" },
10238c2ecf20Sopenharmony_ci	{ "Port1_7 Mixer", "DMIC1L Switch", "DMIC1 Left" },
10248c2ecf20Sopenharmony_ci	{ "Port1_7 Mixer", "DMIC1R Switch", "DMIC1 Right" },
10258c2ecf20Sopenharmony_ci	{ "Port1_7 Mixer", "DMIC2L Switch", "DMIC2 Left" },
10268c2ecf20Sopenharmony_ci	{ "Port1_7 Mixer", "DMIC2R Switch", "DMIC2 Right" },
10278c2ecf20Sopenharmony_ci
10288c2ecf20Sopenharmony_ci	{ "Port1_8 Mixer", "ADCL Switch", "ADC Left" },
10298c2ecf20Sopenharmony_ci	{ "Port1_8 Mixer", "ADCR Switch", "ADC Right" },
10308c2ecf20Sopenharmony_ci	{ "Port1_8 Mixer", "DMIC1L Switch", "DMIC1 Left" },
10318c2ecf20Sopenharmony_ci	{ "Port1_8 Mixer", "DMIC1R Switch", "DMIC1 Right" },
10328c2ecf20Sopenharmony_ci	{ "Port1_8 Mixer", "DMIC2L Switch", "DMIC2 Left" },
10338c2ecf20Sopenharmony_ci	{ "Port1_8 Mixer", "DMIC2R Switch", "DMIC2 Right" },
10348c2ecf20Sopenharmony_ci
10358c2ecf20Sopenharmony_ci	{ "Port2_1 Mixer", "ADCL Switch", "ADC Left" },
10368c2ecf20Sopenharmony_ci	{ "Port2_1 Mixer", "ADCR Switch", "ADC Right" },
10378c2ecf20Sopenharmony_ci	{ "Port2_1 Mixer", "DMIC1L Switch", "DMIC1 Left" },
10388c2ecf20Sopenharmony_ci	{ "Port2_1 Mixer", "DMIC1R Switch", "DMIC1 Right" },
10398c2ecf20Sopenharmony_ci	{ "Port2_1 Mixer", "DMIC2L Switch", "DMIC2 Left" },
10408c2ecf20Sopenharmony_ci	{ "Port2_1 Mixer", "DMIC2R Switch", "DMIC2 Right" },
10418c2ecf20Sopenharmony_ci
10428c2ecf20Sopenharmony_ci	{ "Port2_2 Mixer", "ADCL Switch", "ADC Left" },
10438c2ecf20Sopenharmony_ci	{ "Port2_2 Mixer", "ADCR Switch", "ADC Right" },
10448c2ecf20Sopenharmony_ci	{ "Port2_2 Mixer", "DMIC1L Switch", "DMIC1 Left" },
10458c2ecf20Sopenharmony_ci	{ "Port2_2 Mixer", "DMIC1R Switch", "DMIC1 Right" },
10468c2ecf20Sopenharmony_ci	{ "Port2_2 Mixer", "DMIC2L Switch", "DMIC2 Left" },
10478c2ecf20Sopenharmony_ci	{ "Port2_2 Mixer", "DMIC2R Switch", "DMIC2 Right" },
10488c2ecf20Sopenharmony_ci
10498c2ecf20Sopenharmony_ci	{ "P1_1_TX", NULL, "Port1_1 Mixer" },
10508c2ecf20Sopenharmony_ci	{ "P1_2_TX", NULL, "Port1_2 Mixer" },
10518c2ecf20Sopenharmony_ci	{ "P1_3_TX", NULL, "Port1_3 Mixer" },
10528c2ecf20Sopenharmony_ci	{ "P1_4_TX", NULL, "Port1_4 Mixer" },
10538c2ecf20Sopenharmony_ci	{ "P1_5_TX", NULL, "Port1_5 Mixer" },
10548c2ecf20Sopenharmony_ci	{ "P1_6_TX", NULL, "Port1_6 Mixer" },
10558c2ecf20Sopenharmony_ci	{ "P1_7_TX", NULL, "Port1_7 Mixer" },
10568c2ecf20Sopenharmony_ci	{ "P1_8_TX", NULL, "Port1_8 Mixer" },
10578c2ecf20Sopenharmony_ci
10588c2ecf20Sopenharmony_ci	{ "P2_1_TX", NULL, "Port2_1 Mixer" },
10598c2ecf20Sopenharmony_ci	{ "P2_2_TX", NULL, "Port2_2 Mixer" },
10608c2ecf20Sopenharmony_ci
10618c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_1_TX"},
10628c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_2_TX"},
10638c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_3_TX"},
10648c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_4_TX"},
10658c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_5_TX"},
10668c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_6_TX"},
10678c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_7_TX"},
10688c2ecf20Sopenharmony_ci	{ "PORT1_SDO", "Port1 Capture Switch", "P1_8_TX"},
10698c2ecf20Sopenharmony_ci
10708c2ecf20Sopenharmony_ci	{ "PORT2_SDO", "Port2 Capture Switch", "P2_1_TX"},
10718c2ecf20Sopenharmony_ci	{ "PORT2_SDO", "Port2 Capture Switch", "P2_2_TX"},
10728c2ecf20Sopenharmony_ci
10738c2ecf20Sopenharmony_ci	{ "Mic1 Input", NULL, "AMIC1" },
10748c2ecf20Sopenharmony_ci	{ "Mic2 Input", NULL, "AMIC2" },
10758c2ecf20Sopenharmony_ci
10768c2ecf20Sopenharmony_ci	{ "AUXL Input", NULL, "AUXL" },
10778c2ecf20Sopenharmony_ci	{ "AUXR Input", NULL, "AUXR" },
10788c2ecf20Sopenharmony_ci
10798c2ecf20Sopenharmony_ci	/* AUX connections */
10808c2ecf20Sopenharmony_ci	{ "ADCL Mux", "Aux_L", "AUXL Input" },
10818c2ecf20Sopenharmony_ci	{ "ADCL Mux", "MIC1", "Mic1 Input" },
10828c2ecf20Sopenharmony_ci
10838c2ecf20Sopenharmony_ci	{ "ADCR Mux", "Aux_R", "AUXR Input" },
10848c2ecf20Sopenharmony_ci	{ "ADCR Mux", "MIC2", "Mic2 Input" },
10858c2ecf20Sopenharmony_ci
10868c2ecf20Sopenharmony_ci	/* ADC connection */
10878c2ecf20Sopenharmony_ci	{ "ADC Left", NULL, "ADCL Mux"},
10888c2ecf20Sopenharmony_ci	{ "ADC Right", NULL, "ADCR Mux"},
10898c2ecf20Sopenharmony_ci
10908c2ecf20Sopenharmony_ci	{ "DMIC1 Left", NULL, "DMIC1DAT"},
10918c2ecf20Sopenharmony_ci	{ "DMIC1 Right", NULL, "DMIC1DAT"},
10928c2ecf20Sopenharmony_ci	{ "DMIC2 Left", NULL, "DMIC2DAT"},
10938c2ecf20Sopenharmony_ci	{ "DMIC2 Right", NULL, "DMIC2DAT"},
10948c2ecf20Sopenharmony_ci
10958c2ecf20Sopenharmony_ci	/* Sidetone map */
10968c2ecf20Sopenharmony_ci	{ "Sidetone Mixer", NULL, "ADC Left" },
10978c2ecf20Sopenharmony_ci	{ "Sidetone Mixer", NULL, "ADC Right" },
10988c2ecf20Sopenharmony_ci	{ "Sidetone Mixer", NULL, "DMIC1 Left" },
10998c2ecf20Sopenharmony_ci	{ "Sidetone Mixer", NULL, "DMIC1 Right" },
11008c2ecf20Sopenharmony_ci	{ "Sidetone Mixer", NULL, "DMIC2 Left" },
11018c2ecf20Sopenharmony_ci	{ "Sidetone Mixer", NULL, "DMIC2 Right" },
11028c2ecf20Sopenharmony_ci
11038c2ecf20Sopenharmony_ci	{ "Sidetone", "Sidetone Switch", "Sidetone Mixer" },
11048c2ecf20Sopenharmony_ci};
11058c2ecf20Sopenharmony_ci
11068c2ecf20Sopenharmony_cistatic int lm49453_hw_params(struct snd_pcm_substream *substream,
11078c2ecf20Sopenharmony_ci			     struct snd_pcm_hw_params *params,
11088c2ecf20Sopenharmony_ci			     struct snd_soc_dai *dai)
11098c2ecf20Sopenharmony_ci{
11108c2ecf20Sopenharmony_ci	struct snd_soc_component *component = dai->component;
11118c2ecf20Sopenharmony_ci	u16 clk_div = 0;
11128c2ecf20Sopenharmony_ci
11138c2ecf20Sopenharmony_ci	/* Setting DAC clock dividers based on substream sample rate. */
11148c2ecf20Sopenharmony_ci	switch (params_rate(params)) {
11158c2ecf20Sopenharmony_ci	case 8000:
11168c2ecf20Sopenharmony_ci	case 16000:
11178c2ecf20Sopenharmony_ci	case 32000:
11188c2ecf20Sopenharmony_ci	case 24000:
11198c2ecf20Sopenharmony_ci	case 48000:
11208c2ecf20Sopenharmony_ci		clk_div = 256;
11218c2ecf20Sopenharmony_ci		break;
11228c2ecf20Sopenharmony_ci	case 11025:
11238c2ecf20Sopenharmony_ci	case 22050:
11248c2ecf20Sopenharmony_ci	case 44100:
11258c2ecf20Sopenharmony_ci		clk_div = 216;
11268c2ecf20Sopenharmony_ci		break;
11278c2ecf20Sopenharmony_ci	case 96000:
11288c2ecf20Sopenharmony_ci		clk_div = 127;
11298c2ecf20Sopenharmony_ci		break;
11308c2ecf20Sopenharmony_ci	default:
11318c2ecf20Sopenharmony_ci		return -EINVAL;
11328c2ecf20Sopenharmony_ci	}
11338c2ecf20Sopenharmony_ci
11348c2ecf20Sopenharmony_ci	snd_soc_component_write(component, LM49453_P0_ADC_CLK_DIV_REG, clk_div);
11358c2ecf20Sopenharmony_ci	snd_soc_component_write(component, LM49453_P0_DAC_HP_CLK_DIV_REG, clk_div);
11368c2ecf20Sopenharmony_ci
11378c2ecf20Sopenharmony_ci	return 0;
11388c2ecf20Sopenharmony_ci}
11398c2ecf20Sopenharmony_ci
11408c2ecf20Sopenharmony_cistatic int lm49453_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
11418c2ecf20Sopenharmony_ci{
11428c2ecf20Sopenharmony_ci	struct snd_soc_component *component = codec_dai->component;
11438c2ecf20Sopenharmony_ci
11448c2ecf20Sopenharmony_ci	u16 aif_val;
11458c2ecf20Sopenharmony_ci	int mode = 0;
11468c2ecf20Sopenharmony_ci	int clk_phase = 0;
11478c2ecf20Sopenharmony_ci	int clk_shift = 0;
11488c2ecf20Sopenharmony_ci
11498c2ecf20Sopenharmony_ci	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
11508c2ecf20Sopenharmony_ci	case SND_SOC_DAIFMT_CBS_CFS:
11518c2ecf20Sopenharmony_ci		aif_val = 0;
11528c2ecf20Sopenharmony_ci		break;
11538c2ecf20Sopenharmony_ci	case SND_SOC_DAIFMT_CBS_CFM:
11548c2ecf20Sopenharmony_ci		aif_val = LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
11558c2ecf20Sopenharmony_ci		break;
11568c2ecf20Sopenharmony_ci	case SND_SOC_DAIFMT_CBM_CFS:
11578c2ecf20Sopenharmony_ci		aif_val = LM49453_AUDIO_PORT1_BASIC_CLK_MS;
11588c2ecf20Sopenharmony_ci		break;
11598c2ecf20Sopenharmony_ci	case SND_SOC_DAIFMT_CBM_CFM:
11608c2ecf20Sopenharmony_ci		aif_val = LM49453_AUDIO_PORT1_BASIC_CLK_MS |
11618c2ecf20Sopenharmony_ci			  LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
11628c2ecf20Sopenharmony_ci		break;
11638c2ecf20Sopenharmony_ci	default:
11648c2ecf20Sopenharmony_ci		return -EINVAL;
11658c2ecf20Sopenharmony_ci	}
11668c2ecf20Sopenharmony_ci
11678c2ecf20Sopenharmony_ci
11688c2ecf20Sopenharmony_ci	switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
11698c2ecf20Sopenharmony_ci	case SND_SOC_DAIFMT_I2S:
11708c2ecf20Sopenharmony_ci		break;
11718c2ecf20Sopenharmony_ci	case SND_SOC_DAIFMT_DSP_A:
11728c2ecf20Sopenharmony_ci		mode = 1;
11738c2ecf20Sopenharmony_ci		clk_phase = (1 << 5);
11748c2ecf20Sopenharmony_ci		clk_shift = 1;
11758c2ecf20Sopenharmony_ci		break;
11768c2ecf20Sopenharmony_ci	case SND_SOC_DAIFMT_DSP_B:
11778c2ecf20Sopenharmony_ci		mode = 1;
11788c2ecf20Sopenharmony_ci		clk_phase = (1 << 5);
11798c2ecf20Sopenharmony_ci		clk_shift = 0;
11808c2ecf20Sopenharmony_ci		break;
11818c2ecf20Sopenharmony_ci	default:
11828c2ecf20Sopenharmony_ci		return -EINVAL;
11838c2ecf20Sopenharmony_ci	}
11848c2ecf20Sopenharmony_ci
11858c2ecf20Sopenharmony_ci	snd_soc_component_update_bits(component, LM49453_P0_AUDIO_PORT1_BASIC_REG,
11868c2ecf20Sopenharmony_ci			    LM49453_AUDIO_PORT1_BASIC_FMT_MASK|BIT(0)|BIT(5),
11878c2ecf20Sopenharmony_ci			    (aif_val | mode | clk_phase));
11888c2ecf20Sopenharmony_ci
11898c2ecf20Sopenharmony_ci	snd_soc_component_write(component, LM49453_P0_AUDIO_PORT1_RX_MSB_REG, clk_shift);
11908c2ecf20Sopenharmony_ci
11918c2ecf20Sopenharmony_ci	return 0;
11928c2ecf20Sopenharmony_ci}
11938c2ecf20Sopenharmony_ci
11948c2ecf20Sopenharmony_cistatic int lm49453_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id,
11958c2ecf20Sopenharmony_ci				  unsigned int freq, int dir)
11968c2ecf20Sopenharmony_ci{
11978c2ecf20Sopenharmony_ci	struct snd_soc_component *component = dai->component;
11988c2ecf20Sopenharmony_ci	u16 pll_clk = 0;
11998c2ecf20Sopenharmony_ci
12008c2ecf20Sopenharmony_ci	switch (freq) {
12018c2ecf20Sopenharmony_ci	case 12288000:
12028c2ecf20Sopenharmony_ci	case 26000000:
12038c2ecf20Sopenharmony_ci	case 19200000:
12048c2ecf20Sopenharmony_ci		/* pll clk slection */
12058c2ecf20Sopenharmony_ci		pll_clk = 0;
12068c2ecf20Sopenharmony_ci		break;
12078c2ecf20Sopenharmony_ci	case 48000:
12088c2ecf20Sopenharmony_ci	case 32576:
12098c2ecf20Sopenharmony_ci		/* fll clk slection */
12108c2ecf20Sopenharmony_ci		pll_clk = BIT(4);
12118c2ecf20Sopenharmony_ci		return 0;
12128c2ecf20Sopenharmony_ci	default:
12138c2ecf20Sopenharmony_ci		return -EINVAL;
12148c2ecf20Sopenharmony_ci	}
12158c2ecf20Sopenharmony_ci
12168c2ecf20Sopenharmony_ci	snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG, BIT(4), pll_clk);
12178c2ecf20Sopenharmony_ci
12188c2ecf20Sopenharmony_ci	return 0;
12198c2ecf20Sopenharmony_ci}
12208c2ecf20Sopenharmony_ci
12218c2ecf20Sopenharmony_cistatic int lm49453_hp_mute(struct snd_soc_dai *dai, int mute, int direction)
12228c2ecf20Sopenharmony_ci{
12238c2ecf20Sopenharmony_ci	snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(1)|BIT(0),
12248c2ecf20Sopenharmony_ci			    (mute ? (BIT(1)|BIT(0)) : 0));
12258c2ecf20Sopenharmony_ci	return 0;
12268c2ecf20Sopenharmony_ci}
12278c2ecf20Sopenharmony_ci
12288c2ecf20Sopenharmony_cistatic int lm49453_lo_mute(struct snd_soc_dai *dai, int mute, int direction)
12298c2ecf20Sopenharmony_ci{
12308c2ecf20Sopenharmony_ci	snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(3)|BIT(2),
12318c2ecf20Sopenharmony_ci			    (mute ? (BIT(3)|BIT(2)) : 0));
12328c2ecf20Sopenharmony_ci	return 0;
12338c2ecf20Sopenharmony_ci}
12348c2ecf20Sopenharmony_ci
12358c2ecf20Sopenharmony_cistatic int lm49453_ls_mute(struct snd_soc_dai *dai, int mute, int direction)
12368c2ecf20Sopenharmony_ci{
12378c2ecf20Sopenharmony_ci	snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(5)|BIT(4),
12388c2ecf20Sopenharmony_ci			    (mute ? (BIT(5)|BIT(4)) : 0));
12398c2ecf20Sopenharmony_ci	return 0;
12408c2ecf20Sopenharmony_ci}
12418c2ecf20Sopenharmony_ci
12428c2ecf20Sopenharmony_cistatic int lm49453_ep_mute(struct snd_soc_dai *dai, int mute, int direction)
12438c2ecf20Sopenharmony_ci{
12448c2ecf20Sopenharmony_ci	snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(4),
12458c2ecf20Sopenharmony_ci			    (mute ? BIT(4) : 0));
12468c2ecf20Sopenharmony_ci	return 0;
12478c2ecf20Sopenharmony_ci}
12488c2ecf20Sopenharmony_ci
12498c2ecf20Sopenharmony_cistatic int lm49453_ha_mute(struct snd_soc_dai *dai, int mute, int direction)
12508c2ecf20Sopenharmony_ci{
12518c2ecf20Sopenharmony_ci	snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(7)|BIT(6),
12528c2ecf20Sopenharmony_ci			    (mute ? (BIT(7)|BIT(6)) : 0));
12538c2ecf20Sopenharmony_ci	return 0;
12548c2ecf20Sopenharmony_ci}
12558c2ecf20Sopenharmony_ci
12568c2ecf20Sopenharmony_cistatic int lm49453_set_bias_level(struct snd_soc_component *component,
12578c2ecf20Sopenharmony_ci				  enum snd_soc_bias_level level)
12588c2ecf20Sopenharmony_ci{
12598c2ecf20Sopenharmony_ci	struct lm49453_priv *lm49453 = snd_soc_component_get_drvdata(component);
12608c2ecf20Sopenharmony_ci
12618c2ecf20Sopenharmony_ci	switch (level) {
12628c2ecf20Sopenharmony_ci	case SND_SOC_BIAS_ON:
12638c2ecf20Sopenharmony_ci	case SND_SOC_BIAS_PREPARE:
12648c2ecf20Sopenharmony_ci		break;
12658c2ecf20Sopenharmony_ci
12668c2ecf20Sopenharmony_ci	case SND_SOC_BIAS_STANDBY:
12678c2ecf20Sopenharmony_ci		if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF)
12688c2ecf20Sopenharmony_ci			regcache_sync(lm49453->regmap);
12698c2ecf20Sopenharmony_ci
12708c2ecf20Sopenharmony_ci		snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG,
12718c2ecf20Sopenharmony_ci				    LM49453_PMC_SETUP_CHIP_EN, LM49453_CHIP_EN);
12728c2ecf20Sopenharmony_ci		break;
12738c2ecf20Sopenharmony_ci
12748c2ecf20Sopenharmony_ci	case SND_SOC_BIAS_OFF:
12758c2ecf20Sopenharmony_ci		snd_soc_component_update_bits(component, LM49453_P0_PMC_SETUP_REG,
12768c2ecf20Sopenharmony_ci				    LM49453_PMC_SETUP_CHIP_EN, 0);
12778c2ecf20Sopenharmony_ci		break;
12788c2ecf20Sopenharmony_ci	}
12798c2ecf20Sopenharmony_ci
12808c2ecf20Sopenharmony_ci	return 0;
12818c2ecf20Sopenharmony_ci}
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_ci/* Formates supported by LM49453 driver. */
12848c2ecf20Sopenharmony_ci#define LM49453_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
12858c2ecf20Sopenharmony_ci			 SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
12868c2ecf20Sopenharmony_ci
12878c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops lm49453_headset_dai_ops = {
12888c2ecf20Sopenharmony_ci	.hw_params	= lm49453_hw_params,
12898c2ecf20Sopenharmony_ci	.set_sysclk	= lm49453_set_dai_sysclk,
12908c2ecf20Sopenharmony_ci	.set_fmt	= lm49453_set_dai_fmt,
12918c2ecf20Sopenharmony_ci	.mute_stream	= lm49453_hp_mute,
12928c2ecf20Sopenharmony_ci	.no_capture_mute = 1,
12938c2ecf20Sopenharmony_ci};
12948c2ecf20Sopenharmony_ci
12958c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops lm49453_speaker_dai_ops = {
12968c2ecf20Sopenharmony_ci	.hw_params	= lm49453_hw_params,
12978c2ecf20Sopenharmony_ci	.set_sysclk	= lm49453_set_dai_sysclk,
12988c2ecf20Sopenharmony_ci	.set_fmt	= lm49453_set_dai_fmt,
12998c2ecf20Sopenharmony_ci	.mute_stream	= lm49453_ls_mute,
13008c2ecf20Sopenharmony_ci	.no_capture_mute = 1,
13018c2ecf20Sopenharmony_ci};
13028c2ecf20Sopenharmony_ci
13038c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops lm49453_haptic_dai_ops = {
13048c2ecf20Sopenharmony_ci	.hw_params	= lm49453_hw_params,
13058c2ecf20Sopenharmony_ci	.set_sysclk	= lm49453_set_dai_sysclk,
13068c2ecf20Sopenharmony_ci	.set_fmt	= lm49453_set_dai_fmt,
13078c2ecf20Sopenharmony_ci	.mute_stream	= lm49453_ha_mute,
13088c2ecf20Sopenharmony_ci	.no_capture_mute = 1,
13098c2ecf20Sopenharmony_ci};
13108c2ecf20Sopenharmony_ci
13118c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops lm49453_ep_dai_ops = {
13128c2ecf20Sopenharmony_ci	.hw_params	= lm49453_hw_params,
13138c2ecf20Sopenharmony_ci	.set_sysclk	= lm49453_set_dai_sysclk,
13148c2ecf20Sopenharmony_ci	.set_fmt	= lm49453_set_dai_fmt,
13158c2ecf20Sopenharmony_ci	.mute_stream	= lm49453_ep_mute,
13168c2ecf20Sopenharmony_ci	.no_capture_mute = 1,
13178c2ecf20Sopenharmony_ci};
13188c2ecf20Sopenharmony_ci
13198c2ecf20Sopenharmony_cistatic const struct snd_soc_dai_ops lm49453_lineout_dai_ops = {
13208c2ecf20Sopenharmony_ci	.hw_params	= lm49453_hw_params,
13218c2ecf20Sopenharmony_ci	.set_sysclk	= lm49453_set_dai_sysclk,
13228c2ecf20Sopenharmony_ci	.set_fmt	= lm49453_set_dai_fmt,
13238c2ecf20Sopenharmony_ci	.mute_stream	= lm49453_lo_mute,
13248c2ecf20Sopenharmony_ci	.no_capture_mute = 1,
13258c2ecf20Sopenharmony_ci};
13268c2ecf20Sopenharmony_ci
13278c2ecf20Sopenharmony_ci/* LM49453 dai structure. */
13288c2ecf20Sopenharmony_cistatic struct snd_soc_dai_driver lm49453_dai[] = {
13298c2ecf20Sopenharmony_ci	{
13308c2ecf20Sopenharmony_ci		.name = "LM49453 Headset",
13318c2ecf20Sopenharmony_ci		.playback = {
13328c2ecf20Sopenharmony_ci			.stream_name = "Headset",
13338c2ecf20Sopenharmony_ci			.channels_min = 2,
13348c2ecf20Sopenharmony_ci			.channels_max = 2,
13358c2ecf20Sopenharmony_ci			.rates = SNDRV_PCM_RATE_8000_192000,
13368c2ecf20Sopenharmony_ci			.formats = LM49453_FORMATS,
13378c2ecf20Sopenharmony_ci		},
13388c2ecf20Sopenharmony_ci		.capture = {
13398c2ecf20Sopenharmony_ci			.stream_name = "Capture",
13408c2ecf20Sopenharmony_ci			.channels_min = 1,
13418c2ecf20Sopenharmony_ci			.channels_max = 5,
13428c2ecf20Sopenharmony_ci			.rates = SNDRV_PCM_RATE_8000_192000,
13438c2ecf20Sopenharmony_ci			.formats = LM49453_FORMATS,
13448c2ecf20Sopenharmony_ci		},
13458c2ecf20Sopenharmony_ci		.ops = &lm49453_headset_dai_ops,
13468c2ecf20Sopenharmony_ci		.symmetric_rates = 1,
13478c2ecf20Sopenharmony_ci	},
13488c2ecf20Sopenharmony_ci	{
13498c2ecf20Sopenharmony_ci		.name = "LM49453 Speaker",
13508c2ecf20Sopenharmony_ci		.playback = {
13518c2ecf20Sopenharmony_ci			.stream_name = "Speaker",
13528c2ecf20Sopenharmony_ci			.channels_min = 2,
13538c2ecf20Sopenharmony_ci			.channels_max = 2,
13548c2ecf20Sopenharmony_ci			.rates = SNDRV_PCM_RATE_8000_192000,
13558c2ecf20Sopenharmony_ci			.formats = LM49453_FORMATS,
13568c2ecf20Sopenharmony_ci		},
13578c2ecf20Sopenharmony_ci		.ops = &lm49453_speaker_dai_ops,
13588c2ecf20Sopenharmony_ci	},
13598c2ecf20Sopenharmony_ci	{
13608c2ecf20Sopenharmony_ci		.name = "LM49453 Haptic",
13618c2ecf20Sopenharmony_ci		.playback = {
13628c2ecf20Sopenharmony_ci			.stream_name = "Haptic",
13638c2ecf20Sopenharmony_ci			.channels_min = 2,
13648c2ecf20Sopenharmony_ci			.channels_max = 2,
13658c2ecf20Sopenharmony_ci			.rates = SNDRV_PCM_RATE_8000_192000,
13668c2ecf20Sopenharmony_ci			.formats = LM49453_FORMATS,
13678c2ecf20Sopenharmony_ci		},
13688c2ecf20Sopenharmony_ci		.ops = &lm49453_haptic_dai_ops,
13698c2ecf20Sopenharmony_ci	},
13708c2ecf20Sopenharmony_ci	{
13718c2ecf20Sopenharmony_ci		.name = "LM49453 Earpiece",
13728c2ecf20Sopenharmony_ci		.playback = {
13738c2ecf20Sopenharmony_ci			.stream_name = "Earpiece",
13748c2ecf20Sopenharmony_ci			.channels_min = 1,
13758c2ecf20Sopenharmony_ci			.channels_max = 1,
13768c2ecf20Sopenharmony_ci			.rates = SNDRV_PCM_RATE_8000_192000,
13778c2ecf20Sopenharmony_ci			.formats = LM49453_FORMATS,
13788c2ecf20Sopenharmony_ci		},
13798c2ecf20Sopenharmony_ci		.ops = &lm49453_ep_dai_ops,
13808c2ecf20Sopenharmony_ci	},
13818c2ecf20Sopenharmony_ci	{
13828c2ecf20Sopenharmony_ci		.name = "LM49453 line out",
13838c2ecf20Sopenharmony_ci		.playback = {
13848c2ecf20Sopenharmony_ci			.stream_name = "Lineout",
13858c2ecf20Sopenharmony_ci			.channels_min = 2,
13868c2ecf20Sopenharmony_ci			.channels_max = 2,
13878c2ecf20Sopenharmony_ci			.rates = SNDRV_PCM_RATE_8000_192000,
13888c2ecf20Sopenharmony_ci			.formats = LM49453_FORMATS,
13898c2ecf20Sopenharmony_ci		},
13908c2ecf20Sopenharmony_ci		.ops = &lm49453_lineout_dai_ops,
13918c2ecf20Sopenharmony_ci	},
13928c2ecf20Sopenharmony_ci};
13938c2ecf20Sopenharmony_ci
13948c2ecf20Sopenharmony_cistatic const struct snd_soc_component_driver soc_component_dev_lm49453 = {
13958c2ecf20Sopenharmony_ci	.set_bias_level		= lm49453_set_bias_level,
13968c2ecf20Sopenharmony_ci	.controls		= lm49453_snd_controls,
13978c2ecf20Sopenharmony_ci	.num_controls		= ARRAY_SIZE(lm49453_snd_controls),
13988c2ecf20Sopenharmony_ci	.dapm_widgets		= lm49453_dapm_widgets,
13998c2ecf20Sopenharmony_ci	.num_dapm_widgets	= ARRAY_SIZE(lm49453_dapm_widgets),
14008c2ecf20Sopenharmony_ci	.dapm_routes		= lm49453_audio_map,
14018c2ecf20Sopenharmony_ci	.num_dapm_routes	= ARRAY_SIZE(lm49453_audio_map),
14028c2ecf20Sopenharmony_ci	.use_pmdown_time	= 1,
14038c2ecf20Sopenharmony_ci	.endianness		= 1,
14048c2ecf20Sopenharmony_ci	.non_legacy_dai_naming	= 1,
14058c2ecf20Sopenharmony_ci};
14068c2ecf20Sopenharmony_ci
14078c2ecf20Sopenharmony_cistatic const struct regmap_config lm49453_regmap_config = {
14088c2ecf20Sopenharmony_ci	.reg_bits = 8,
14098c2ecf20Sopenharmony_ci	.val_bits = 8,
14108c2ecf20Sopenharmony_ci
14118c2ecf20Sopenharmony_ci	.max_register = LM49453_MAX_REGISTER,
14128c2ecf20Sopenharmony_ci	.reg_defaults = lm49453_reg_defs,
14138c2ecf20Sopenharmony_ci	.num_reg_defaults = ARRAY_SIZE(lm49453_reg_defs),
14148c2ecf20Sopenharmony_ci	.cache_type = REGCACHE_RBTREE,
14158c2ecf20Sopenharmony_ci};
14168c2ecf20Sopenharmony_ci
14178c2ecf20Sopenharmony_cistatic int lm49453_i2c_probe(struct i2c_client *i2c,
14188c2ecf20Sopenharmony_ci			     const struct i2c_device_id *id)
14198c2ecf20Sopenharmony_ci{
14208c2ecf20Sopenharmony_ci	struct lm49453_priv *lm49453;
14218c2ecf20Sopenharmony_ci	int ret = 0;
14228c2ecf20Sopenharmony_ci
14238c2ecf20Sopenharmony_ci	lm49453 = devm_kzalloc(&i2c->dev, sizeof(struct lm49453_priv),
14248c2ecf20Sopenharmony_ci				GFP_KERNEL);
14258c2ecf20Sopenharmony_ci
14268c2ecf20Sopenharmony_ci	if (lm49453 == NULL)
14278c2ecf20Sopenharmony_ci		return -ENOMEM;
14288c2ecf20Sopenharmony_ci
14298c2ecf20Sopenharmony_ci	i2c_set_clientdata(i2c, lm49453);
14308c2ecf20Sopenharmony_ci
14318c2ecf20Sopenharmony_ci	lm49453->regmap = devm_regmap_init_i2c(i2c, &lm49453_regmap_config);
14328c2ecf20Sopenharmony_ci	if (IS_ERR(lm49453->regmap)) {
14338c2ecf20Sopenharmony_ci		ret = PTR_ERR(lm49453->regmap);
14348c2ecf20Sopenharmony_ci		dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
14358c2ecf20Sopenharmony_ci			ret);
14368c2ecf20Sopenharmony_ci		return ret;
14378c2ecf20Sopenharmony_ci	}
14388c2ecf20Sopenharmony_ci
14398c2ecf20Sopenharmony_ci	ret =  devm_snd_soc_register_component(&i2c->dev,
14408c2ecf20Sopenharmony_ci				      &soc_component_dev_lm49453,
14418c2ecf20Sopenharmony_ci				      lm49453_dai, ARRAY_SIZE(lm49453_dai));
14428c2ecf20Sopenharmony_ci	if (ret < 0)
14438c2ecf20Sopenharmony_ci		dev_err(&i2c->dev, "Failed to register component: %d\n", ret);
14448c2ecf20Sopenharmony_ci
14458c2ecf20Sopenharmony_ci	return ret;
14468c2ecf20Sopenharmony_ci}
14478c2ecf20Sopenharmony_ci
14488c2ecf20Sopenharmony_cistatic int lm49453_i2c_remove(struct i2c_client *client)
14498c2ecf20Sopenharmony_ci{
14508c2ecf20Sopenharmony_ci	return 0;
14518c2ecf20Sopenharmony_ci}
14528c2ecf20Sopenharmony_ci
14538c2ecf20Sopenharmony_cistatic const struct i2c_device_id lm49453_i2c_id[] = {
14548c2ecf20Sopenharmony_ci	{ "lm49453", 0 },
14558c2ecf20Sopenharmony_ci	{ }
14568c2ecf20Sopenharmony_ci};
14578c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(i2c, lm49453_i2c_id);
14588c2ecf20Sopenharmony_ci
14598c2ecf20Sopenharmony_cistatic struct i2c_driver lm49453_i2c_driver = {
14608c2ecf20Sopenharmony_ci	.driver = {
14618c2ecf20Sopenharmony_ci		.name = "lm49453",
14628c2ecf20Sopenharmony_ci	},
14638c2ecf20Sopenharmony_ci	.probe = lm49453_i2c_probe,
14648c2ecf20Sopenharmony_ci	.remove = lm49453_i2c_remove,
14658c2ecf20Sopenharmony_ci	.id_table = lm49453_i2c_id,
14668c2ecf20Sopenharmony_ci};
14678c2ecf20Sopenharmony_ci
14688c2ecf20Sopenharmony_cimodule_i2c_driver(lm49453_i2c_driver);
14698c2ecf20Sopenharmony_ci
14708c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("ASoC LM49453 driver");
14718c2ecf20Sopenharmony_ciMODULE_AUTHOR("M R Swami Reddy <MR.Swami.Reddy@ti.com>");
14728c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL v2");
1473