Skip to content

Commit f07a3a7

Browse files
Vamshigopalplbossart
authored andcommitted
ASoC: intel: sof_rt5682: Add support for adl_rt1019_rt5682s
This patch adds the driver data for two rt1019 speaker amplifiers on SSP1 and rt5682s on SSP0 for ADL platform Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
1 parent 23306d2 commit f07a3a7

4 files changed

Lines changed: 64 additions & 0 deletions

File tree

sound/soc/intel/boards/sof_realtek_common.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,5 +459,44 @@ void sof_rt1308_dai_link(struct snd_soc_dai_link *link)
459459
}
460460
EXPORT_SYMBOL_NS(sof_rt1308_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON);
461461

462+
/*
463+
* 2-amp Configuration for RT1019
464+
*/
465+
466+
static const struct snd_soc_dapm_route rt1019_dapm_routes[] = {
467+
/* speaker */
468+
{ "Left Spk", NULL, "Speaker" },
469+
{ "Right Spk", NULL, "Speaker" },
470+
};
471+
472+
static struct snd_soc_dai_link_component rt1019_components[] = {
473+
{
474+
.name = RT1019_DEV0_NAME,
475+
.dai_name = RT1019_CODEC_DAI,
476+
},
477+
};
478+
479+
static int rt1019_init(struct snd_soc_pcm_runtime *rtd)
480+
{
481+
struct snd_soc_card *card = rtd->card;
482+
int ret;
483+
484+
ret = snd_soc_dapm_add_routes(&card->dapm, rt1019_dapm_routes,
485+
ARRAY_SIZE(rt1019_dapm_routes));
486+
if (ret) {
487+
dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret);
488+
return ret;
489+
}
490+
return ret;
491+
}
492+
493+
void sof_rt1019_dai_link(struct snd_soc_dai_link *link)
494+
{
495+
link->codecs = rt1019_components;
496+
link->num_codecs = ARRAY_SIZE(rt1019_components);
497+
link->init = rt1019_init;
498+
}
499+
EXPORT_SYMBOL_NS(sof_rt1019_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON);
500+
462501
MODULE_DESCRIPTION("ASoC Intel SOF Realtek helpers");
463502
MODULE_LICENSE("GPL");

sound/soc/intel/boards/sof_realtek_common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ void sof_rt1015_codec_conf(struct snd_soc_card *card);
3939
#define RT1308_DEV0_NAME "i2c-10EC1308:00"
4040
void sof_rt1308_dai_link(struct snd_soc_dai_link *link);
4141

42+
#define RT1019_CODEC_DAI "HiFi"
43+
#define RT1019_DEV0_NAME "RTL1019:00"
44+
45+
void sof_rt1019_dai_link(struct snd_soc_dai_link *link);
46+
4247
#endif /* __SOF_REALTEK_COMMON_H */

sound/soc/intel/boards/sof_rt5682.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#define SOF_RT5682S_HEADPHONE_CODEC_PRESENT BIT(23)
6161
#define SOF_MAX98390_SPEAKER_AMP_PRESENT BIT(24)
6262
#define SOF_MAX98390_TWEETER_SPEAKER_PRESENT BIT(25)
63+
#define SOF_RT1019_SPEAKER_AMP_PRESENT BIT(26)
6364

6465

6566
/* Default: MCLK on, MCLK 19.2M, SSP0 */
@@ -733,6 +734,8 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
733734
SOF_RT1015_SPEAKER_AMP_100FS) ? 100 : 64);
734735
} else if (sof_rt5682_quirk & SOF_RT1015P_SPEAKER_AMP_PRESENT) {
735736
sof_rt1015p_dai_link(&links[id]);
737+
} else if (sof_rt5682_quirk & SOF_RT1019_SPEAKER_AMP_PRESENT) {
738+
sof_rt1019_dai_link(&links[id]);
736739
} else if (sof_rt5682_quirk &
737740
SOF_MAX98373_SPEAKER_AMP_PRESENT) {
738741
links[id].codecs = max_98373_components;
@@ -1070,6 +1073,16 @@ static const struct platform_device_id board_ids[] = {
10701073
SOF_BT_OFFLOAD_SSP(2) |
10711074
SOF_SSP_BT_OFFLOAD_PRESENT),
10721075
},
1076+
{
1077+
.name = "adl_rt1019_rt5682s",
1078+
.driver_data = (kernel_ulong_t)(SOF_RT5682_MCLK_EN |
1079+
SOF_RT5682_SSP_CODEC(0) |
1080+
SOF_RT5682S_HEADPHONE_CODEC_PRESENT |
1081+
SOF_SPEAKER_AMP_PRESENT |
1082+
SOF_RT1019_SPEAKER_AMP_PRESENT |
1083+
SOF_RT5682_SSP_AMP(1) |
1084+
SOF_RT5682_NUM_HDMIDEV(4)),
1085+
},
10731086
{ }
10741087
};
10751088
MODULE_DEVICE_TABLE(platform, board_ids);

sound/soc/intel/common/soc-acpi-intel-adl-match.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,13 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[] = {
455455
.quirk_data = &adl_max98360a_amp,
456456
.sof_tplg_filename = "sof-adl-mx98360a-nau8825.tplg",
457457
},
458+
{
459+
.id = "RTL5682",
460+
.drv_name = "adl_rt1019_rt5682s",
461+
.machine_quirk = snd_soc_acpi_codec_list,
462+
.quirk_data = &adl_rt1019p_amp,
463+
.sof_tplg_filename = "sof-adl-rt1019-rt5682.tplg",
464+
},
458465
{
459466
.id = "10508825",
460467
.drv_name = "sof_nau8825",

0 commit comments

Comments
 (0)