Skip to content

Commit

Permalink
ASoC: tegra: Don't claim to support PCM pause and resume
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
larsclausen authored and broonie committed Apr 3, 2013
1 parent 07961ac commit 5aa995e
Showing 1 changed file with 1 addition and 23 deletions.
24 changes: 1 addition & 23 deletions sound/soc/tegra/tegra_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -127,26 +125,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)
{
Expand All @@ -164,7 +142,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,
};
Expand Down

0 comments on commit 5aa995e

Please sign in to comment.