All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Cc: Ola Lilja <ola.o.lilja@stericsson.com>,
	alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
	Nicolas Ferre <nicolas.ferre@atmel.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Shawn Guo <shawn.guo@linaro.org>,
	Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: [PATCH 2/8] ASoC: tegra: Don't claim to support PCM pause and resume
Date: Wed,  3 Apr 2013 11:00:01 +0200	[thread overview]
Message-ID: <1364979607-15286-3-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1364979607-15286-1-git-send-email-lars@metafoo.de>

The tegra dmaengine driver does not support pausing and resuming a DMA stream.
The tegra PCM driver still claims to support pause and resume though and
implements them by stopping and restarting the stream. This is not what an
application using pause/resume would expect. Usually applications have support
for working around PCMs which do not support suspend and resume, so don't set
the SNDRV_PCM_INFO_PAUSE and SNDRV_PCM_INFO_RESUME flags for the tegra PCM and
use the default snd_dmaengine_pcm_trigger callback.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/tegra/tegra_pcm.c | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index e67af0b..117cccc 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -43,8 +43,6 @@
 static const struct snd_pcm_hardware tegra_pcm_hardware = {
 	.info			= SNDRV_PCM_INFO_MMAP |
 				  SNDRV_PCM_INFO_MMAP_VALID |
-				  SNDRV_PCM_INFO_PAUSE |
-				  SNDRV_PCM_INFO_RESUME |
 				  SNDRV_PCM_INFO_INTERLEAVED,
 	.formats		= SNDRV_PCM_FMTBIT_S16_LE,
 	.channels_min		= 2,
@@ -121,26 +119,6 @@ static int tegra_pcm_hw_free(struct snd_pcm_substream *substream)
 	return 0;
 }
 
-static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
-{
-	switch (cmd) {
-	case SNDRV_PCM_TRIGGER_START:
-	case SNDRV_PCM_TRIGGER_RESUME:
-	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		return snd_dmaengine_pcm_trigger(substream,
-					SNDRV_PCM_TRIGGER_START);
-
-	case SNDRV_PCM_TRIGGER_STOP:
-	case SNDRV_PCM_TRIGGER_SUSPEND:
-	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		return snd_dmaengine_pcm_trigger(substream,
-					SNDRV_PCM_TRIGGER_STOP);
-	default:
-		return -EINVAL;
-	}
-	return 0;
-}
-
 static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
 				struct vm_area_struct *vma)
 {
@@ -158,7 +136,7 @@ static struct snd_pcm_ops tegra_pcm_ops = {
 	.ioctl		= snd_pcm_lib_ioctl,
 	.hw_params	= tegra_pcm_hw_params,
 	.hw_free	= tegra_pcm_hw_free,
-	.trigger	= tegra_pcm_trigger,
+	.trigger	= snd_dmaengine_pcm_trigger,
 	.pointer	= snd_dmaengine_pcm_pointer,
 	.mmap		= tegra_pcm_mmap,
 };
-- 
1.8.0

  parent reply	other threads:[~2013-04-03  8:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03  8:59 [PATCH 0/8] More dmaengine PCM cleanups Lars-Peter Clausen
2013-04-03  9:00 ` [PATCH 1/8] ASoC: ep93xx_pcm: Fix compile error Lars-Peter Clausen
2013-04-05 10:25   ` Mark Brown
2013-04-03  9:00 ` Lars-Peter Clausen [this message]
2013-04-03 16:56   ` [PATCH 2/8] ASoC: tegra: Don't claim to support PCM pause and resume Stephen Warren
2013-04-03 17:04   ` Mark Brown
2013-04-03  9:02 ` [PATCH 3/8] ASoC: ux500_pcm: Use the same snd_pcm_hardware for playback and capture Lars-Peter Clausen
2013-04-03  9:02   ` [PATCH 4/8] ASoC: dmaengine_pcm: Setup device_fc in snd_hwparams_to_dma_slave_config Lars-Peter Clausen
2013-04-03  8:06     ` Nicolas Ferre
2013-04-03 10:07     ` Peter Ujfalusi
2013-04-03 17:04     ` Mark Brown
2013-04-07 19:24   ` [PATCH 3/8] ASoC: ux500_pcm: Use the same snd_pcm_hardware for playback and capture Mark Brown
2013-04-03  9:06 ` [PATCH 5/8] ASoC: dmaengine-pcm: Add a common DAI DMA data struct Lars-Peter Clausen
2013-04-03  9:06   ` [PATCH 6/8] ASoC: tegra: Use " Lars-Peter Clausen
2013-04-03 17:08     ` Stephen Warren
2013-04-03 18:38       ` Lars-Peter Clausen
2013-04-03 17:14     ` Mark Brown
2013-04-03  9:06   ` [PATCH 7/8] ASoC: fsl: " Lars-Peter Clausen
2013-04-05  5:19     ` Shawn Guo
2013-04-05 10:26     ` Mark Brown
2013-04-03  9:06   ` [PATCH 8/8] ASoC: omap: Use common DAI DMA data Lars-Peter Clausen
2013-04-03 10:06     ` Peter Ujfalusi
2013-04-03 12:12       ` Jarkko Nikula
2013-04-03 17:08     ` Mark Brown
2013-04-03 10:07   ` [PATCH 5/8] ASoC: dmaengine-pcm: Add a common DAI DMA data struct Peter Ujfalusi
2013-04-03 17:08   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364979607-15286-3-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jarkko.nikula@bitmer.com \
    --cc=kernel@pengutronix.de \
    --cc=ldewangan@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=ola.o.lilja@stericsson.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=shawn.guo@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.