diff options
author | Benoit Cousson <bcousson@baylibre.com> | 2014-04-24 08:01:45 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-24 08:25:16 -0400 |
commit | 370186106075143f6e9336a4c3d9650cbf162617 (patch) | |
tree | 2904af60f27d62e3cfd8efecf2d3b518cf37429a | |
parent | 503ae5e036824935d9e214b9819a618499733bdf (diff) |
ASoC: core: Add one dai_get_widget helper instead of two rtd based ones
Replace rtd_get_codec_widget() and rtd_get_cpu_widget() by a simple
dai_get_widget() in preparation for DAI-multicodec support, per Lars
suggestion.
No functional change.
Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/soc-pcm.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 2cedf09f6d96..88230ea330d8 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -1012,21 +1012,12 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, | |||
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | static inline struct snd_soc_dapm_widget * | 1014 | static inline struct snd_soc_dapm_widget * |
1015 | rtd_get_cpu_widget(struct snd_soc_pcm_runtime *rtd, int stream) | 1015 | dai_get_widget(struct snd_soc_dai *dai, int stream) |
1016 | { | 1016 | { |
1017 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 1017 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) |
1018 | return rtd->cpu_dai->playback_widget; | 1018 | return dai->playback_widget; |
1019 | else | 1019 | else |
1020 | return rtd->cpu_dai->capture_widget; | 1020 | return dai->capture_widget; |
1021 | } | ||
1022 | |||
1023 | static inline struct snd_soc_dapm_widget * | ||
1024 | rtd_get_codec_widget(struct snd_soc_pcm_runtime *rtd, int stream) | ||
1025 | { | ||
1026 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
1027 | return rtd->codec_dai->playback_widget; | ||
1028 | else | ||
1029 | return rtd->codec_dai->capture_widget; | ||
1030 | } | 1021 | } |
1031 | 1022 | ||
1032 | static int widget_in_list(struct snd_soc_dapm_widget_list *list, | 1023 | static int widget_in_list(struct snd_soc_dapm_widget_list *list, |
@@ -1076,14 +1067,14 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, | |||
1076 | list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) { | 1067 | list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) { |
1077 | 1068 | ||
1078 | /* is there a valid CPU DAI widget for this BE */ | 1069 | /* is there a valid CPU DAI widget for this BE */ |
1079 | widget = rtd_get_cpu_widget(dpcm->be, stream); | 1070 | widget = dai_get_widget(dpcm->be->cpu_dai, stream); |
1080 | 1071 | ||
1081 | /* prune the BE if it's no longer in our active list */ | 1072 | /* prune the BE if it's no longer in our active list */ |
1082 | if (widget && widget_in_list(list, widget)) | 1073 | if (widget && widget_in_list(list, widget)) |
1083 | continue; | 1074 | continue; |
1084 | 1075 | ||
1085 | /* is there a valid CODEC DAI widget for this BE */ | 1076 | /* is there a valid CODEC DAI widget for this BE */ |
1086 | widget = rtd_get_codec_widget(dpcm->be, stream); | 1077 | widget = dai_get_widget(dpcm->be->codec_dai, stream); |
1087 | 1078 | ||
1088 | /* prune the BE if it's no longer in our active list */ | 1079 | /* prune the BE if it's no longer in our active list */ |
1089 | if (widget && widget_in_list(list, widget)) | 1080 | if (widget && widget_in_list(list, widget)) |