diff mbox series

[02/16] ASoC: Intel: sof_sdw: add rt1320 amp support

Message ID 20240827014329.6542-3-yung-chuan.liao@linux.intel.com (mailing list archive)
State Superseded
Headers show
Series ASoC: Intel: boards: updates for 6.12 | expand

Commit Message

Bard Liao Aug. 27, 2024, 1:43 a.m. UTC
Add Realtek rt1320 amp support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/boards/Kconfig       |  1 +
 sound/soc/sdw_utils/soc_sdw_rt_amp.c | 11 ++++++++++-
 sound/soc/sdw_utils/soc_sdw_utils.c  | 19 +++++++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/intel/boards/Kconfig b/sound/soc/intel/boards/Kconfig
index cb952183f5ed..1141fe1263ce 100644
--- a/sound/soc/intel/boards/Kconfig
+++ b/sound/soc/intel/boards/Kconfig
@@ -524,6 +524,7 @@  config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
 	select SND_SOC_RT1308
 	select SND_SOC_RT1316_SDW
 	select SND_SOC_RT1318_SDW
+	select SND_SOC_RT1320_SDW
 	select SND_SOC_RT5682_SDW
 	select SND_SOC_CS42L42_SDW
 	select SND_SOC_CS42L43
diff --git a/sound/soc/sdw_utils/soc_sdw_rt_amp.c b/sound/soc/sdw_utils/soc_sdw_rt_amp.c
index 42be01405ab4..6951dfb56526 100644
--- a/sound/soc/sdw_utils/soc_sdw_rt_amp.c
+++ b/sound/soc/sdw_utils/soc_sdw_rt_amp.c
@@ -160,6 +160,13 @@  static const struct snd_soc_dapm_route rt1318_map[] = {
 	{ "Speaker", NULL, "rt1318-2 SPOR" },
 };
 
+static const struct snd_soc_dapm_route rt1320_map[] = {
+	{ "Speaker", NULL, "rt1320-1 SPOL" },
+	{ "Speaker", NULL, "rt1320-1 SPOR" },
+	{ "Speaker", NULL, "rt1320-2 SPOL" },
+	{ "Speaker", NULL, "rt1320-2 SPOR" },
+};
+
 static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_dai *dai,
 								 char *codec_name)
 {
@@ -171,8 +178,10 @@  static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_
 		return rt1308_map;
 	else if (strcmp(codec_name, "rt1316") == 0)
 		return rt1316_map;
-	else
+	else if (strcmp(codec_name, "rt1318") == 0)
 		return rt1318_map;
+	else
+		return rt1320_map;
 }
 
 int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c
index e8d0f199155d..d59ccb56642c 100644
--- a/sound/soc/sdw_utils/soc_sdw_utils.c
+++ b/sound/soc/sdw_utils/soc_sdw_utils.c
@@ -254,6 +254,25 @@  struct asoc_sdw_codec_info codec_info_list[] = {
 		},
 		.dai_num = 1,
 	},
+	{
+		.part_id = 0x1320,
+		.dais = {
+			{
+				.direction = {true, false},
+				.dai_name = "rt1320-aif1",
+				.dai_type = SOC_SDW_DAI_TYPE_AMP,
+				.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
+				.init = asoc_sdw_rt_amp_init,
+				.exit = asoc_sdw_rt_amp_exit,
+				.rtd_init = asoc_sdw_rt_amp_spk_rtd_init,
+				.controls = generic_spk_controls,
+				.num_controls = ARRAY_SIZE(generic_spk_controls),
+				.widgets = generic_spk_widgets,
+				.num_widgets = ARRAY_SIZE(generic_spk_widgets),
+			},
+		},
+		.dai_num = 1,
+	},
 	{
 		.part_id = 0x714,
 		.version_id = 3,