[1/5] ASoC: Add support for machine specific trigger callback
diff mbox

Message ID 1398687476-10829-1-git-send-email-sr@denx.de
State Accepted
Commit 4792b0dbcf3d41a19e76adc9c98c5cc889daa065
Headers show

Commit Message

Stefan Roese April 28, 2014, 12:17 p.m. UTC
From: Jarkko Nikula <jarkko.nikula@bitmer.com>

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>
---
 sound/soc/soc-pcm.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Mark Brown April 29, 2014, 7:05 p.m. UTC | #1
On Mon, Apr 28, 2014 at 02:17:52PM +0200, Stefan Roese wrote:
> From: Jarkko Nikula <jarkko.nikula@bitmer.com>
> 
> 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.

Applied, thanks.

Patch
diff mbox

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 2cedf09..a3a7021 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -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;
 }