aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/intel/boards/sof_sdw_cs42l43.c
diff options
context:
space:
mode:
authorGravatar Bard Liao <yung-chuan.liao@linux.intel.com> 2024-02-08 10:55:38 -0600
committerGravatar Mark Brown <broonie@kernel.org> 2024-02-08 21:23:17 +0000
commit8266c73126b75eabbebefe7ce489a798e9ef2662 (patch)
tree2bc4ef923815e003224baa25b3420f5d0863cbaf /sound/soc/intel/boards/sof_sdw_cs42l43.c
parentASoC: Intel: sof_sdw_rt5682: use helper to get codec dai by name (diff)
downloadlinux-8266c73126b75eabbebefe7ce489a798e9ef2662.tar.gz
linux-8266c73126b75eabbebefe7ce489a798e9ef2662.tar.bz2
linux-8266c73126b75eabbebefe7ce489a798e9ef2662.zip
ASoC: Intel: sof_sdw: add common sdw dai link init
Currently, we set sdw dai link .init callback in the codec_info_list's dais.init function. This works fine if all codecs in the dai link are the same. However, we need to do all the .init stuff for all different codecs in the dai link if not all codecs in the dai link are the same. Use a common dai link .init callback to call the new rtd_init callback in sof_sdw_dai_info{} to do rtd_init for each dai. Some codec init callback will become empty after this change. They will be removed in the follow up patch. Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20240208165545.93811-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/sof_sdw_cs42l43.c')
-rw-r--r--sound/soc/intel/boards/sof_sdw_cs42l43.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/intel/boards/sof_sdw_cs42l43.c b/sound/soc/intel/boards/sof_sdw_cs42l43.c
index 360f11b72aa2..7909ea9c9c14 100644
--- a/sound/soc/intel/boards/sof_sdw_cs42l43.c
+++ b/sound/soc/intel/boards/sof_sdw_cs42l43.c
@@ -50,7 +50,7 @@ static struct snd_soc_jack_pin sof_jack_pins[] = {
},
};
-static int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd)
+int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card);
@@ -116,12 +116,11 @@ int sof_sdw_cs42l43_hs_init(struct snd_soc_card *card, const struct snd_soc_acpi
* No need to test if (!playback) like other codecs as cs42l43 uses separated dai for
* playback and capture, and sof_sdw_cs42l43_init is only linked to the playback dai.
*/
- dai_links->init = cs42l43_hs_rtd_init;
return 0;
}
-static int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
+int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
int ret;
@@ -150,7 +149,5 @@ int sof_sdw_cs42l43_dmic_init(struct snd_soc_card *card, const struct snd_soc_ac
struct snd_soc_dai_link *dai_links, struct sof_sdw_codec_info *info,
bool playback)
{
- dai_links->init = cs42l43_dmic_rtd_init;
-
return 0;
}