Skip to content

Commit 1ab959b

Browse files
bardliaobroonie
authored andcommitted
ASoC: Intel: sof_sdw: add rt1320 amp support
Add Realtek rt1320 amp support. Signed-off-by: Bard Liao <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 6785244 commit 1ab959b

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

sound/soc/intel/boards/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ config SND_SOC_INTEL_SOUNDWIRE_SOF_MACH
524524
select SND_SOC_RT1308
525525
select SND_SOC_RT1316_SDW
526526
select SND_SOC_RT1318_SDW
527+
select SND_SOC_RT1320_SDW
527528
select SND_SOC_RT5682_SDW
528529
select SND_SOC_CS42L42_SDW
529530
select SND_SOC_CS42L43

sound/soc/sdw_utils/soc_sdw_rt_amp.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ static const struct snd_soc_dapm_route rt1318_map[] = {
160160
{ "Speaker", NULL, "rt1318-2 SPOR" },
161161
};
162162

163+
static const struct snd_soc_dapm_route rt1320_map[] = {
164+
{ "Speaker", NULL, "rt1320-1 SPOL" },
165+
{ "Speaker", NULL, "rt1320-1 SPOR" },
166+
{ "Speaker", NULL, "rt1320-2 SPOL" },
167+
{ "Speaker", NULL, "rt1320-2 SPOR" },
168+
};
169+
163170
static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_dai *dai,
164171
char *codec_name)
165172
{
@@ -171,8 +178,10 @@ static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_
171178
return rt1308_map;
172179
else if (strcmp(codec_name, "rt1316") == 0)
173180
return rt1316_map;
174-
else
181+
else if (strcmp(codec_name, "rt1318") == 0)
175182
return rt1318_map;
183+
else
184+
return rt1320_map;
176185
}
177186

178187
int asoc_sdw_rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,25 @@ struct asoc_sdw_codec_info codec_info_list[] = {
254254
},
255255
.dai_num = 1,
256256
},
257+
{
258+
.part_id = 0x1320,
259+
.dais = {
260+
{
261+
.direction = {true, false},
262+
.dai_name = "rt1320-aif1",
263+
.dai_type = SOC_SDW_DAI_TYPE_AMP,
264+
.dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID},
265+
.init = asoc_sdw_rt_amp_init,
266+
.exit = asoc_sdw_rt_amp_exit,
267+
.rtd_init = asoc_sdw_rt_amp_spk_rtd_init,
268+
.controls = generic_spk_controls,
269+
.num_controls = ARRAY_SIZE(generic_spk_controls),
270+
.widgets = generic_spk_widgets,
271+
.num_widgets = ARRAY_SIZE(generic_spk_widgets),
272+
},
273+
},
274+
.dai_num = 1,
275+
},
257276
{
258277
.part_id = 0x714,
259278
.version_id = 3,

0 commit comments

Comments
 (0)