aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-04-03 05:00:01 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-03 13:11:08 -0400
commit5aa995e83ac7727b7705431e6eb2b317c59b95ba (patch)
tree1b3fe09db3295725c1d30c4b393ba58ddfc9a91b /sound
parent07961ac7c0ee8b546658717034fe692fd12eefa9 (diff)
ASoC: tegra: Don't claim to support PCM pause and resume
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_pcm.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index c925ab0adeb6..5e2c55c5b255 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -43,8 +43,6 @@
43static const struct snd_pcm_hardware tegra_pcm_hardware = { 43static const struct snd_pcm_hardware tegra_pcm_hardware = {
44 .info = SNDRV_PCM_INFO_MMAP | 44 .info = SNDRV_PCM_INFO_MMAP |
45 SNDRV_PCM_INFO_MMAP_VALID | 45 SNDRV_PCM_INFO_MMAP_VALID |
46 SNDRV_PCM_INFO_PAUSE |
47 SNDRV_PCM_INFO_RESUME |
48 SNDRV_PCM_INFO_INTERLEAVED, 46 SNDRV_PCM_INFO_INTERLEAVED,
49 .formats = SNDRV_PCM_FMTBIT_S16_LE, 47 .formats = SNDRV_PCM_FMTBIT_S16_LE,
50 .channels_min = 2, 48 .channels_min = 2,
@@ -127,26 +125,6 @@ static int tegra_pcm_hw_free(struct snd_pcm_substream *substream)
127 return 0; 125 return 0;
128} 126}
129 127
130static int tegra_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
131{
132 switch (cmd) {
133 case SNDRV_PCM_TRIGGER_START:
134 case SNDRV_PCM_TRIGGER_RESUME:
135 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
136 return snd_dmaengine_pcm_trigger(substream,
137 SNDRV_PCM_TRIGGER_START);
138
139 case SNDRV_PCM_TRIGGER_STOP:
140 case SNDRV_PCM_TRIGGER_SUSPEND:
141 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
142 return snd_dmaengine_pcm_trigger(substream,
143 SNDRV_PCM_TRIGGER_STOP);
144 default:
145 return -EINVAL;
146 }
147 return 0;
148}
149
150static int tegra_pcm_mmap(struct snd_pcm_substream *substream, 128static int tegra_pcm_mmap(struct snd_pcm_substream *substream,
151 struct vm_area_struct *vma) 129 struct vm_area_struct *vma)
152{ 130{
@@ -164,7 +142,7 @@ static struct snd_pcm_ops tegra_pcm_ops = {
164 .ioctl = snd_pcm_lib_ioctl, 142 .ioctl = snd_pcm_lib_ioctl,
165 .hw_params = tegra_pcm_hw_params, 143 .hw_params = tegra_pcm_hw_params,
166 .hw_free = tegra_pcm_hw_free, 144 .hw_free = tegra_pcm_hw_free,
167 .trigger = tegra_pcm_trigger, 145 .trigger = snd_dmaengine_pcm_trigger,
168 .pointer = snd_dmaengine_pcm_pointer, 146 .pointer = snd_dmaengine_pcm_pointer,
169 .mmap = tegra_pcm_mmap, 147 .mmap = tegra_pcm_mmap,
170}; 148};