ASoC: core: Add support for machine specific trigger callback
authorJarkko Nikula <jarkko.nikula@bitmer.com>
Mon, 28 Apr 2014 12:17:52 +0000 (14:17 +0200)
committerMark Brown <broonie@linaro.org>
Tue, 29 Apr 2014 19:04:32 +0000 (12:04 -0700)
Machine specific trigger callback allows to do final stream start/stop
related operations in a machine driver after setting up the codec, DMA and
DAI.

One example could be clock management for linked streams case where machine
driver can start/stop synchronously the linked streams.

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/soc-pcm.c

index 2cedf09f6d9613c7b34bb22888806fde598052c6..a3a70214edee2ae2fffb576f2a245a0afc8763e0 100644 (file)
@@ -819,6 +819,13 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
                if (ret < 0)
                        return ret;
        }
+
+       if (rtd->dai_link->ops && rtd->dai_link->ops->trigger) {
+               ret = rtd->dai_link->ops->trigger(substream, cmd);
+               if (ret < 0)
+                       return ret;
+       }
+
        return 0;
 }