aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-pcm.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-03-25 11:58:16 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-26 10:11:12 -0400
commitabe99370b3c583cd0fc4185e7a776b7bb48311c3 (patch)
treec9204207d3b6046c12a2ff8835a3ad78d539b028 /sound/soc/omap/omap-pcm.c
parent8bb9660418e05bb1845ac1a2428444d78e322cc7 (diff)
ASoC: omap: Call omap_mcbsp_set_threshold() from mcbsp hw_params
The omap PCM driver provides a set_threshold callback which gets called by the PCM driver when either playback or capture is started. The only DAI driver which sets this callback is the mcbsp driver. This patch removes the callback from the PCM driver and moves the invocation of the omap_mcbsp_set_threshold() function to the mcbsp hw_params callback since this is the only place where the threshold size can change. Doing so allows us to use the default dmaengine PCM trigger callback in the omap PCM driver. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r--sound/soc/omap/omap-pcm.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index c722c2ef9665..1626fb7d2cd2 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -129,37 +129,6 @@ static int omap_pcm_hw_free(struct snd_pcm_substream *substream)
129 return 0; 129 return 0;
130} 130}
131 131
132static int omap_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
133{
134 struct snd_soc_pcm_runtime *rtd = substream->private_data;
135 struct omap_pcm_dma_data *dma_data;
136 int ret = 0;
137
138 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
139
140 switch (cmd) {
141 case SNDRV_PCM_TRIGGER_START:
142 case SNDRV_PCM_TRIGGER_RESUME:
143 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
144 /* Configure McBSP internal buffer usage */
145 if (dma_data->set_threshold)
146 dma_data->set_threshold(substream);
147 break;
148
149 case SNDRV_PCM_TRIGGER_STOP:
150 case SNDRV_PCM_TRIGGER_SUSPEND:
151 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
152 break;
153 default:
154 ret = -EINVAL;
155 }
156
157 if (ret == 0)
158 ret = snd_dmaengine_pcm_trigger(substream, cmd);
159
160 return ret;
161}
162
163static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream) 132static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream)
164{ 133{
165 snd_pcm_uframes_t offset; 134 snd_pcm_uframes_t offset;
@@ -208,7 +177,7 @@ static struct snd_pcm_ops omap_pcm_ops = {
208 .ioctl = snd_pcm_lib_ioctl, 177 .ioctl = snd_pcm_lib_ioctl,
209 .hw_params = omap_pcm_hw_params, 178 .hw_params = omap_pcm_hw_params,
210 .hw_free = omap_pcm_hw_free, 179 .hw_free = omap_pcm_hw_free,
211 .trigger = omap_pcm_trigger, 180 .trigger = snd_dmaengine_pcm_trigger,
212 .pointer = omap_pcm_pointer, 181 .pointer = omap_pcm_pointer,
213 .mmap = omap_pcm_mmap, 182 .mmap = omap_pcm_mmap,
214}; 183};