aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-04-07 03:54:41 -0400
committerTakashi Iwai <tiwai@suse.de>2010-04-07 03:54:41 -0400
commit7445c995b06f2a999541ccf127886d24a2a7d012 (patch)
tree940cb9cce2e2e3dcbbe3502bf720fd10481769af /sound/soc/omap
parent1172234cbe94658c16bc83e50ca57b5a47085209 (diff)
parent5f712b2b73a9fc87fcc52124cfe8adefaa0c92f5 (diff)
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/omap-mcbsp.c4
-rw-r--r--sound/soc/omap/omap-mcpdm.c3
-rw-r--r--sound/soc/omap/omap-pcm.c21
3 files changed, 16 insertions, 12 deletions
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index e814a9591f78..8ad9dc901007 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -297,7 +297,9 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
297 omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode; 297 omap_mcbsp_dai_dma_params[id][substream->stream].sync_mode = sync_mode;
298 omap_mcbsp_dai_dma_params[id][substream->stream].data_type = 298 omap_mcbsp_dai_dma_params[id][substream->stream].data_type =
299 OMAP_DMA_DATA_TYPE_S16; 299 OMAP_DMA_DATA_TYPE_S16;
300 cpu_dai->dma_data = &omap_mcbsp_dai_dma_params[id][substream->stream]; 300
301 snd_soc_dai_set_dma_data(cpu_dai, substream,
302 &omap_mcbsp_dai_dma_params[id][substream->stream]);
301 303
302 if (mcbsp_data->configured) { 304 if (mcbsp_data->configured) {
303 /* McBSP already configured by another stream */ 305 /* McBSP already configured by another stream */
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 25f19e4728bf..b7f4f7e015f3 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -150,7 +150,8 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream,
150 int stream = substream->stream; 150 int stream = substream->stream;
151 int channels, err, link_mask = 0; 151 int channels, err, link_mask = 0;
152 152
153 cpu_dai->dma_data = &omap_mcpdm_dai_dma_params[stream]; 153 snd_soc_dai_set_dma_data(cpu_dai, substream,
154 &omap_mcpdm_dai_dma_params[stream]);
154 155
155 channels = params_channels(params); 156 channels = params_channels(params);
156 switch (channels) { 157 switch (channels) {
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 825db385f01f..39456447132c 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -60,12 +60,11 @@ static void omap_pcm_dma_irq(int ch, u16 stat, void *data)
60 struct omap_runtime_data *prtd = runtime->private_data; 60 struct omap_runtime_data *prtd = runtime->private_data;
61 unsigned long flags; 61 unsigned long flags;
62 62
63 if ((cpu_is_omap1510()) && 63 if ((cpu_is_omap1510())) {
64 (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) {
65 /* 64 /*
66 * OMAP1510 doesn't fully support DMA progress counter 65 * OMAP1510 doesn't fully support DMA progress counter
67 * and there is no software emulation implemented yet, 66 * and there is no software emulation implemented yet,
68 * so have to maintain our own playback progress counter 67 * so have to maintain our own progress counters
69 * that can be used by omap_pcm_pointer() instead. 68 * that can be used by omap_pcm_pointer() instead.
70 */ 69 */
71 spin_lock_irqsave(&prtd->lock, flags); 70 spin_lock_irqsave(&prtd->lock, flags);
@@ -100,9 +99,11 @@ static int omap_pcm_hw_params(struct snd_pcm_substream *substream,
100 struct snd_pcm_runtime *runtime = substream->runtime; 99 struct snd_pcm_runtime *runtime = substream->runtime;
101 struct snd_soc_pcm_runtime *rtd = substream->private_data; 100 struct snd_soc_pcm_runtime *rtd = substream->private_data;
102 struct omap_runtime_data *prtd = runtime->private_data; 101 struct omap_runtime_data *prtd = runtime->private_data;
103 struct omap_pcm_dma_data *dma_data = rtd->dai->cpu_dai->dma_data; 102 struct omap_pcm_dma_data *dma_data;
104 int err = 0; 103 int err = 0;
105 104
105 dma_data = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream);
106
106 /* return if this is a bufferless transfer e.g. 107 /* return if this is a bufferless transfer e.g.
107 * codec <--> BT codec or GSM modem -- lg FIXME */ 108 * codec <--> BT codec or GSM modem -- lg FIXME */
108 if (!dma_data) 109 if (!dma_data)
@@ -189,8 +190,7 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
189 dma_params.frame_count = runtime->periods; 190 dma_params.frame_count = runtime->periods;
190 omap_set_dma_params(prtd->dma_ch, &dma_params); 191 omap_set_dma_params(prtd->dma_ch, &dma_params);
191 192
192 if ((cpu_is_omap1510()) && 193 if ((cpu_is_omap1510()))
193 (substream->stream == SNDRV_PCM_STREAM_PLAYBACK))
194 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ | 194 omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ |
195 OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ); 195 OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ);
196 else 196 else
@@ -248,14 +248,15 @@ static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream)
248 dma_addr_t ptr; 248 dma_addr_t ptr;
249 snd_pcm_uframes_t offset; 249 snd_pcm_uframes_t offset;
250 250
251 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { 251 if (cpu_is_omap1510()) {
252 offset = prtd->period_index * runtime->period_size;
253 } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
252 ptr = omap_get_dma_dst_pos(prtd->dma_ch); 254 ptr = omap_get_dma_dst_pos(prtd->dma_ch);
253 offset = bytes_to_frames(runtime, ptr - runtime->dma_addr); 255 offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
254 } else if (!(cpu_is_omap1510())) { 256 } else {
255 ptr = omap_get_dma_src_pos(prtd->dma_ch); 257 ptr = omap_get_dma_src_pos(prtd->dma_ch);
256 offset = bytes_to_frames(runtime, ptr - runtime->dma_addr); 258 offset = bytes_to_frames(runtime, ptr - runtime->dma_addr);
257 } else 259 }
258 offset = prtd->period_index * runtime->period_size;
259 260
260 if (offset >= runtime->buffer_size) 261 if (offset >= runtime->buffer_size)
261 offset = 0; 262 offset = 0;