Skip to content

Commit

Permalink
ASoC: Intel: sof_sdw: add rt1320 amp support
Browse files Browse the repository at this point in the history
Add Realtek rt1320 amp support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
  • Loading branch information
bardliao authored and plbossart committed Jul 19, 2024
1 parent a87d6a7 commit 0dff6ac
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions sound/soc/intel/boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,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
Expand Down
11 changes: 10 additions & 1 deletion sound/soc/sdw_utils/soc_sdw_rt_amp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down
19 changes: 19 additions & 0 deletions sound/soc/sdw_utils/soc_sdw_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0dff6ac

Please sign in to comment.