diff options
| -rw-r--r-- | sound/soc/soc-dapm.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index fbfcda062839..7e15914b3633 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
| @@ -124,6 +124,36 @@ static inline struct snd_soc_dapm_widget *dapm_cnew_widget( | |||
| 124 | return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); | 124 | return kmemdup(_widget, sizeof(*_widget), GFP_KERNEL); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | /* get snd_card from DAPM context */ | ||
| 128 | static inline struct snd_card *dapm_get_snd_card( | ||
| 129 | struct snd_soc_dapm_context *dapm) | ||
| 130 | { | ||
| 131 | if (dapm->codec) | ||
| 132 | return dapm->codec->card->snd_card; | ||
| 133 | else if (dapm->platform) | ||
| 134 | return dapm->platform->card->snd_card; | ||
| 135 | else | ||
| 136 | BUG(); | ||
| 137 | |||
| 138 | /* unreachable */ | ||
| 139 | return NULL; | ||
| 140 | } | ||
| 141 | |||
| 142 | /* get soc_card from DAPM context */ | ||
| 143 | static inline struct snd_soc_card *dapm_get_soc_card( | ||
| 144 | struct snd_soc_dapm_context *dapm) | ||
| 145 | { | ||
| 146 | if (dapm->codec) | ||
| 147 | return dapm->codec->card; | ||
| 148 | else if (dapm->platform) | ||
| 149 | return dapm->platform->card; | ||
| 150 | else | ||
| 151 | BUG(); | ||
| 152 | |||
| 153 | /* unreachable */ | ||
| 154 | return NULL; | ||
| 155 | } | ||
| 156 | |||
| 127 | static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) | 157 | static int soc_widget_read(struct snd_soc_dapm_widget *w, int reg) |
| 128 | { | 158 | { |
| 129 | if (w->codec) | 159 | if (w->codec) |
