Skip to content

Commit c8df096

Browse files
morimotobroonie
authored andcommitted
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>
1 parent 6b8ba0d commit c8df096

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

include/sound/soc-dapm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@ int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream,
661661
struct snd_pcm_hw_params *params, struct snd_soc_dai *dai);
662662
int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s);
663663
struct device *snd_soc_dapm_to_dev(struct snd_soc_dapm_context *dapm);
664+
struct snd_soc_card *snd_soc_dapm_to_card(struct snd_soc_dapm_context *dapm);
664665

665666
/* dapm path setup */
666667
int snd_soc_dapm_new_widgets(struct snd_soc_card *card);

sound/soc/soc-dapm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ struct device *snd_soc_dapm_to_dev(struct snd_soc_dapm_context *dapm)
174174
}
175175
EXPORT_SYMBOL_GPL(snd_soc_dapm_to_dev);
176176

177+
struct snd_soc_card *snd_soc_dapm_to_card(struct snd_soc_dapm_context *dapm)
178+
{
179+
return dapm->card;
180+
}
181+
EXPORT_SYMBOL_GPL(snd_soc_dapm_to_card);
182+
177183
static bool dapm_dirty_widget(struct snd_soc_dapm_widget *w)
178184
{
179185
return !list_empty(&w->dirty);

0 commit comments

Comments
 (0)