ASoC: Intel: sof_sdw: add dai parameter to rtd_init callback
A generic .rtd_init() callback could be used by different dais. It is useful to pass dai parameter to the callback. The dai parameter will be used in the follow up commit. No functional change here. Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.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/20240509163418.67746-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2e3bc94796
commit
84e0a19adb
@ -1411,7 +1411,7 @@ static int sof_sdw_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
|
||||
skip_add_controls_widgets:
|
||||
if (codec_info->dais[dai_index].rtd_init) {
|
||||
ret = codec_info->dais[dai_index].rtd_init(rtd);
|
||||
ret = codec_info->dais[dai_index].rtd_init(rtd, dai);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ struct sof_sdw_dai_info {
|
||||
struct sof_sdw_codec_info *info,
|
||||
bool playback);
|
||||
int (*exit)(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
|
||||
int (*rtd_init)(struct snd_soc_pcm_runtime *rtd);
|
||||
int (*rtd_init)(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
bool rtd_init_done; /* Indicate that the rtd_init callback is done */
|
||||
unsigned long quirk;
|
||||
};
|
||||
@ -208,19 +208,19 @@ int sof_sdw_cs_amp_init(struct snd_soc_card *card,
|
||||
|
||||
/* dai_link init callbacks */
|
||||
|
||||
int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd);
|
||||
int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int cs42l43_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai);
|
||||
|
||||
#endif
|
||||
|
@ -40,7 +40,7 @@ static const char * const jack_codecs[] = {
|
||||
"cs42l42"
|
||||
};
|
||||
|
||||
int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int cs42l42_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
||||
|
@ -48,7 +48,7 @@ static struct snd_soc_jack_pin sof_jack_pins[] = {
|
||||
},
|
||||
};
|
||||
|
||||
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_dai *dai)
|
||||
{
|
||||
struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component;
|
||||
struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card);
|
||||
@ -99,7 +99,7 @@ int cs42l43_hs_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int ret;
|
||||
@ -135,7 +135,7 @@ int sof_sdw_cs42l43_spk_init(struct snd_soc_card *card,
|
||||
return bridge_cs35l56_spk_init(card, dai_links, info, playback);
|
||||
}
|
||||
|
||||
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_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int ret;
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#define CODEC_NAME_SIZE 8
|
||||
|
||||
int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
const char *dai_name = rtd->dai_link->codecs->dai_name;
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
|
@ -21,7 +21,7 @@ static const struct snd_soc_dapm_route max_98373_dapm_routes[] = {
|
||||
{ "Right Spk", NULL, "Right BE_OUT" },
|
||||
};
|
||||
|
||||
int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int maxim_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int ret;
|
||||
|
@ -39,7 +39,7 @@ static const char * const jack_codecs[] = {
|
||||
"rt5682"
|
||||
};
|
||||
|
||||
int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt5682_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
||||
|
@ -37,7 +37,7 @@ static const char * const jack_codecs[] = {
|
||||
"rt700"
|
||||
};
|
||||
|
||||
int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt700_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
||||
|
@ -63,7 +63,7 @@ static const char * const jack_codecs[] = {
|
||||
"rt711"
|
||||
};
|
||||
|
||||
int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt711_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
||||
|
@ -26,7 +26,7 @@ static const struct snd_soc_dapm_route rt712_spk_map[] = {
|
||||
{ "Speaker", NULL, "rt712 SPOR" },
|
||||
};
|
||||
|
||||
int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt712_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int ret;
|
||||
|
@ -19,7 +19,7 @@ static const struct snd_soc_dapm_route rt722_spk_map[] = {
|
||||
{ "Speaker", NULL, "rt722 SPK" },
|
||||
};
|
||||
|
||||
int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt722_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
int ret;
|
||||
|
@ -177,12 +177,12 @@ static const struct snd_soc_dapm_route *get_codec_name_and_route(struct snd_soc_
|
||||
return rt1318_map;
|
||||
}
|
||||
|
||||
int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
const struct snd_soc_dapm_route *rt_amp_map;
|
||||
char codec_name[CODEC_NAME_SIZE];
|
||||
struct snd_soc_dai *dai;
|
||||
struct snd_soc_dai *codec_dai;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
@ -194,10 +194,10 @@ int rt_amp_spk_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
if (!card->components)
|
||||
return -ENOMEM;
|
||||
|
||||
for_each_rtd_codec_dais(rtd, i, dai) {
|
||||
if (strstr(dai->component->name_prefix, "-1"))
|
||||
for_each_rtd_codec_dais(rtd, i, codec_dai) {
|
||||
if (strstr(codec_dai->component->name_prefix, "-1"))
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, rt_amp_map, 2);
|
||||
else if (strstr(dai->component->name_prefix, "-2"))
|
||||
else if (strstr(codec_dai->component->name_prefix, "-2"))
|
||||
ret = snd_soc_dapm_add_routes(&card->dapm, rt_amp_map + 2, 2);
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ static const char * const dmics[] = {
|
||||
"rt722-sdca",
|
||||
};
|
||||
|
||||
int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt_dmic_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct snd_soc_component *component;
|
||||
|
@ -87,7 +87,7 @@ static const char * const need_sdca_suffix[] = {
|
||||
"rt711", "rt713"
|
||||
};
|
||||
|
||||
int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd)
|
||||
int rt_sdca_jack_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
|
||||
{
|
||||
struct snd_soc_card *card = rtd->card;
|
||||
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
|
||||
|
Loading…
Reference in New Issue
Block a user