ASoC: soc-dapm: add snd_soc_dapm_to_card()

Because struct snd_soc_dapm_context is soc-dapm framework specific, user
driver don't need to access its member directly, we would like to hide
them. struct snd_soc_dapm_context will be removed from header in the
future.

Some drivers need to get card from dapm (which will be removed).
We need such function. Add it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87bjnqx06v.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Kuninori Morimoto 2025-09-04 05:21:13 +00:00 committed by Mark Brown
parent 6b8ba0db92
commit c8df096bca
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 7 additions and 0 deletions

View File

@ -661,6 +661,7 @@ int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai);
int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s);
struct device *snd_soc_dapm_to_dev(struct snd_soc_dapm_context *dapm);
struct snd_soc_card *snd_soc_dapm_to_card(struct snd_soc_dapm_context *dapm);
/* dapm path setup */
int snd_soc_dapm_new_widgets(struct snd_soc_card *card);

View File

@ -174,6 +174,12 @@ struct device *snd_soc_dapm_to_dev(struct snd_soc_dapm_context *dapm)
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_to_dev);
struct snd_soc_card *snd_soc_dapm_to_card(struct snd_soc_dapm_context *dapm)
{
return dapm->card;
}
EXPORT_SYMBOL_GPL(snd_soc_dapm_to_card);
static bool dapm_dirty_widget(struct snd_soc_dapm_widget *w)
{
return !list_empty(&w->dirty);