ASoC: Intel: maxim-common: add max_98373_dai_link function
authorBrent Lu <brent.lu@intel.com>
Thu, 9 May 2024 16:34:07 +0000 (11:34 -0500)
committerMark Brown <broonie@kernel.org>
Fri, 10 May 2024 06:11:41 +0000 (07:11 +0100)
Add a helper function, max_98373_dai_link(), for machine driver to
initialize dai link of maxim max98373 speaker amplifier.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Brent Lu <brent.lu@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20240509163418.67746-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_maxim_common.c
sound/soc/intel/boards/sof_maxim_common.h

index 7e1f485dce7ab1cf510ffde7fd110264465e929a..c38c5598d87fae90277d4a7be692d58f286313a6 100644 (file)
@@ -188,6 +188,15 @@ int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd)
 }
 EXPORT_SYMBOL_NS(max_98373_spk_codec_init, SND_SOC_INTEL_SOF_MAXIM_COMMON);
 
+void max_98373_dai_link(struct device *dev, struct snd_soc_dai_link *link)
+{
+       link->codecs = max_98373_components;
+       link->num_codecs = ARRAY_SIZE(max_98373_components);
+       link->init = max_98373_spk_codec_init;
+       link->ops = &max_98373_ops;
+}
+EXPORT_SYMBOL_NS(max_98373_dai_link, SND_SOC_INTEL_SOF_MAXIM_COMMON);
+
 void max_98373_set_codec_conf(struct snd_soc_card *card)
 {
        card->codec_conf = max_98373_codec_conf;
index 8886f985de68b5a71f17140ab042e15447b7583c..2d8257cc52294a219bcaac3c3ae18e61473ff3d6 100644 (file)
@@ -25,6 +25,7 @@ extern struct snd_soc_ops max_98373_ops;
 extern const struct snd_soc_dapm_route max_98373_dapm_routes[];
 
 int max_98373_spk_codec_init(struct snd_soc_pcm_runtime *rtd);
+void max_98373_dai_link(struct device *dev, struct snd_soc_dai_link *link);
 void max_98373_set_codec_conf(struct snd_soc_card *card);
 int max_98373_trigger(struct snd_pcm_substream *substream, int cmd);