public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] [PATCH] ASoC: OMAP: full duplex mode fix
@ 2009-08-03  1:32 Janusz Krzysztofik
  2009-08-03  8:29 ` Jarkko Nikula
  0 siblings, 1 reply; 16+ messages in thread
From: Janusz Krzysztofik @ 2009-08-03  1:32 UTC (permalink / raw)
  To: Jarkko Nikula, Peter Ujfalusi
  Cc: alsa-devel, Mark Brown, e3-hacking, linux-omap@vger.kernel.org

This patch tries to correct the problem of full duplex mode not working
over a single McBSP based CPU DAI.

Created against linux-2.6.31-rc5.
Tested on Amstrad Delta.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
---
--- linux-2.6.31-rc5/sound/soc/omap/omap-mcbsp.c.orig	2009-08-01 02:40:45.000000000 +0200
+++ linux-2.6.31-rc5/sound/soc/omap/omap-mcbsp.c	2009-08-03 03:28:07.000000000 +0200
@@ -183,6 +183,7 @@ static int omap_mcbsp_dai_trigger(struct
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
 	struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
+	u16 buf;
 	int err = 0;
 
 	switch (cmd) {
@@ -191,6 +192,14 @@ static int omap_mcbsp_dai_trigger(struct
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		if (!mcbsp_data->active++)
 			omap_mcbsp_start(mcbsp_data->bus_id);
+		else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+			/* looks like capture already in progress,
+			 * start playback by taking it out of error condition */
+			omap_mcbsp_pollwrite(mcbsp_data->bus_id, 0x0);
+		else
+			/* looks like playback already in progress,
+			 * start capture by taking it out of error condition */
+			omap_mcbsp_pollread(mcbsp_data->bus_id, &buf);
 		break;
 
 	case SNDRV_PCM_TRIGGER_STOP:

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-08-06  9:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-03  1:32 [RFC] [PATCH] ASoC: OMAP: full duplex mode fix Janusz Krzysztofik
2009-08-03  8:29 ` Jarkko Nikula
2009-08-03  9:43   ` Mark Brown
2009-08-03 14:00   ` Janusz Krzysztofik
2009-08-03 15:14     ` Jarkko Nikula
2009-08-04 20:46       ` Janusz Krzysztofik
2009-08-05  6:45         ` Peter Ujfalusi
2009-08-05 13:14           ` Janusz Krzysztofik
2009-08-06  9:30           ` Janusz Krzysztofik
2009-08-05  7:21         ` Jarkko Nikula
2009-08-05  8:42           ` Jarkko Nikula
2009-08-05 13:26             ` Janusz Krzysztofik
2009-08-06  0:27               ` Janusz Krzysztofik
2009-08-06  9:16             ` Janusz Krzysztofik
2009-08-03 17:53     ` Arun KS
2009-08-03 17:57       ` Arun KS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox