From fb376fbba24f08f35654dd952ee0d5eca2fa2257 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 20 Jul 2011 12:23:33 +0100 Subject: [PATCH] --- yaml --- r: 260814 b: refs/heads/master c: 4805608ac1d1a60ca926ff81b1ebd3145f7adf78 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/soc/soc-dapm.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c7874cebf020..feaaaf706725 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d7c3e9525ac8e898f1156a1f3a7c5038f6560186 +refs/heads/master: 4805608ac1d1a60ca926ff81b1ebd3145f7adf78 diff --git a/trunk/sound/soc/soc-dapm.c b/trunk/sound/soc/soc-dapm.c index fbfcda062839..7e15914b3633 100644 --- a/trunk/sound/soc/soc-dapm.c +++ b/trunk/sound/soc/soc-dapm.c @@ -124,6 +124,36 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget( return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); } +/* get snd_card from DAPM context */ +static inline struct snd_card *dapm_get_snd_card( + struct snd_soc_dapm_context *dapm) +{ + if (dapm->codec) + return dapm->codec->card->snd_card; + else if (dapm->platform) + return dapm->platform->card->snd_card; + else + BUG(); + + /* unreachable */ + return NULL; +} + +/* get soc_card from DAPM context */ +static inline struct snd_soc_card *dapm_get_soc_card( + struct snd_soc_dapm_context *dapm) +{ + if (dapm->codec) + return dapm->codec->card; + else if (dapm->platform) + return dapm->platform->card; + else + BUG(); + + /* unreachable */ + return NULL; +} + static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) { if (w->codec)