ASoC: dapm: support user-defined stop condition in dai_get_connected_widgets
authorPiotr Stankiewicz <piotrs@opensource.wolfsonmicro.com>
Fri, 13 May 2016 16:03:55 +0000 (17:03 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 30 May 2016 15:15:10 +0000 (16:15 +0100)
commit6742064aef7f1fba8e68d30b2e726918a5d66790
tree3123c0ad039f1f74bade193c38485ff7afe7eb28
parent1a695a905c18548062509178b98bc91e67510864
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>
include/sound/soc-dapm.h
sound/soc/soc-dapm.c
sound/soc/soc-pcm.c