aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorPiotr Stankiewicz <piotrs@opensource.wolfsonmicro.com>2016-05-13 12:03:55 -0400
committerMark Brown <broonie@kernel.org>2016-05-30 11:15:10 -0400
commit6742064aef7f1fba8e68d30b2e726918a5d66790 (patch)
tree3123c0ad039f1f74bade193c38485ff7afe7eb28 /include/sound
parent1a695a905c18548062509178b98bc91e67510864 (diff)
ASoC: dapm: support user-defined stop condition in dai_get_connected_widgets
Certain situations may warrant examining DAPM paths only to a certain arbitrary point, as opposed to always following them to the end. For instance, when establishing a connection between a front-end DAI link and a back-end DAI link in a DPCM path, it does not make sense to walk the DAPM graph beyond the first widget associated with a back-end link. This patch introduces a mechanism which lets a user of dai_get_connected_widgets supply a function which will be called for every node during the graph walk. When invoked, this function can execute arbitrary logic to decide whether the walk, given a DAPM widget and walk direction, should be terminated at that point or continued as normal. Signed-off-by: Piotr Stankiewicz <piotrs@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/soc-dapm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 3101d53468aa..ca77db443499 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -358,6 +358,7 @@ struct snd_soc_dapm_context;
358struct regulator; 358struct regulator;
359struct snd_soc_dapm_widget_list; 359struct snd_soc_dapm_widget_list;
360struct snd_soc_dapm_update; 360struct snd_soc_dapm_update;
361enum snd_soc_dapm_direction;
361 362
362int dapm_regulator_event(struct snd_soc_dapm_widget *w, 363int dapm_regulator_event(struct snd_soc_dapm_widget *w,
363 struct snd_kcontrol *kcontrol, int event); 364 struct snd_kcontrol *kcontrol, int event);
@@ -451,7 +452,9 @@ void dapm_mark_endpoints_dirty(struct snd_soc_card *card);
451 452
452/* dapm path query */ 453/* dapm path query */
453int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 454int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
454 struct snd_soc_dapm_widget_list **list); 455 struct snd_soc_dapm_widget_list **list,
456 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
457 enum snd_soc_dapm_direction));
455 458
456struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm( 459struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(
457 struct snd_kcontrol *kcontrol); 460 struct snd_kcontrol *kcontrol);