diff options
Diffstat (limited to 'sound/soc/intel/boards/sof_realtek_common.c')
-rw-r--r-- | sound/soc/intel/boards/sof_realtek_common.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/sof_realtek_common.c b/sound/soc/intel/boards/sof_realtek_common.c index a2bcbeee0216..2ab568c1d40b 100644 --- a/sound/soc/intel/boards/sof_realtek_common.c +++ b/sound/soc/intel/boards/sof_realtek_common.c @@ -459,5 +459,44 @@ void sof_rt1308_dai_link(struct snd_soc_dai_link *link) } EXPORT_SYMBOL_NS(sof_rt1308_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON); +/* + * 2-amp Configuration for RT1019 + */ + +static const struct snd_soc_dapm_route rt1019_dapm_routes[] = { + /* speaker */ + { "Left Spk", NULL, "Speaker" }, + { "Right Spk", NULL, "Speaker" }, +}; + +static struct snd_soc_dai_link_component rt1019_components[] = { + { + .name = RT1019_DEV0_NAME, + .dai_name = RT1019_CODEC_DAI, + }, +}; + +static int rt1019_init(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_card *card = rtd->card; + int ret; + + ret = snd_soc_dapm_add_routes(&card->dapm, rt1019_dapm_routes, + ARRAY_SIZE(rt1019_dapm_routes)); + if (ret) { + dev_err(rtd->dev, "Speaker map addition failed: %d\n", ret); + return ret; + } + return ret; +} + +void sof_rt1019_dai_link(struct snd_soc_dai_link *link) +{ + link->codecs = rt1019_components; + link->num_codecs = ARRAY_SIZE(rt1019_components); + link->init = rt1019_init; +} +EXPORT_SYMBOL_NS(sof_rt1019_dai_link, SND_SOC_INTEL_SOF_REALTEK_COMMON); + MODULE_DESCRIPTION("ASoC Intel SOF Realtek helpers"); MODULE_LICENSE("GPL"); |