summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-topology.c
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2018-03-27 15:30:43 +0200
committerMark Brown <broonie@kernel.org>2018-04-17 19:07:32 +0200
commit28aa6f7779f77a863a08c1b9db4b654a94c86dd0 (patch)
tree7b5964715bd56059ccd55a3e1b986b7c000b5fc4 /sound/soc/soc-topology.c
parentASoC: topology: Give more data to clients via callbacks (diff)
downloadlinux-28aa6f7779f77a863a08c1b9db4b654a94c86dd0.tar.xz
linux-28aa6f7779f77a863a08c1b9db4b654a94c86dd0.zip
ASoC: topology: Add callback for DAPM route load/unload
Add a callback fro clients for notification about DAPM route loading and unloading. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r--sound/soc/soc-topology.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 028bcaa0eda5..b9370ae31907 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1161,6 +1161,17 @@ static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg,
return 0;
}
+/* optionally pass new dynamic kcontrol to component driver. */
+static int soc_tplg_add_route(struct soc_tplg *tplg,
+ struct snd_soc_dapm_route *route)
+{
+ if (tplg->comp && tplg->ops && tplg->ops->dapm_route_load)
+ return tplg->ops->dapm_route_load(tplg->comp, tplg->index,
+ route);
+
+ return 0;
+}
+
static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
struct snd_soc_tplg_hdr *hdr)
{
@@ -1209,6 +1220,8 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
else
route.control = elem->control;
+ soc_tplg_add_route(tplg, &route);
+
/* add route, but keep going if some fail */
snd_soc_dapm_add_routes(dapm, &route, 1);
}