diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-07 11:42:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-07 11:42:25 -0400 |
commit | 84db18bbeb5c9c1a9c86e38a89d76ee526fd2c6f (patch) | |
tree | 49d3959eb24cd7c0754ed50e05fb96b0fb8d04aa /sound/soc/omap/omap-pcm.c | |
parent | 6948ec70355ae6cf6082519e3d76b280373dade1 (diff) | |
parent | 55b371d4ac5ed6f3338a398fbf9f2eb9ace78799 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: mixart: range checking proc file
ALSA: hda - Fix a wrong array range check in patch_realtek.c
ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream
ALSA: hda - Enable amplifiers on Acer Inspire 6530G
ASoC: Only do WM8994 bias off transition from standby
ASoC: Don't use DCS_DATAPATH_BUSY for WM hubs devices
ASoC: Don't do runtime wm_hubs DC servo updates if using offset correction
ASoC: Support second DC servo readback method for wm_hubs
ASoC: Avoid wraparound in wm_hubs DC servo correction
ALSA: echoaudio - Eliminate use after free
ALSA: i2c: cleanup: change parameter to pointer
ALSA: hda - Add MSI blacklist for Aopen MZ915-M
ASoC: OMAP: Fix capture pointer handling for OMAP1510 to work correctly with recent ALSA PCM code
ALSA: hda - Update document about MSI and interrupts
ALSA: hda: Fix 0 dB offset for Lenovo Thinkpad models using AD1981
ALSA: hda - Add missing printk argument in previous patch
ASoC: Fix passing platform_data to ac97 bus users and fix a leak
ALSA: hda - Fix ADC/MUX assignment of ALC269 codec
ALSA: hda - Fix invalid bit values passed to snd_hda_codec_amp_stereo()
ASoC: wm8994: playback => capture
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r-- | sound/soc/omap/omap-pcm.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index ba8acbb0a7fa..1e521904ea64 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c | |||
@@ -61,12 +61,11 @@ static void omap_pcm_dma_irq(int ch, u16 stat, void *data) | |||
61 | struct omap_runtime_data *prtd = runtime->private_data; | 61 | struct omap_runtime_data *prtd = runtime->private_data; |
62 | unsigned long flags; | 62 | unsigned long flags; |
63 | 63 | ||
64 | if ((cpu_is_omap1510()) && | 64 | if ((cpu_is_omap1510())) { |
65 | (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) { | ||
66 | /* | 65 | /* |
67 | * OMAP1510 doesn't fully support DMA progress counter | 66 | * OMAP1510 doesn't fully support DMA progress counter |
68 | * and there is no software emulation implemented yet, | 67 | * and there is no software emulation implemented yet, |
69 | * so have to maintain our own playback progress counter | 68 | * so have to maintain our own progress counters |
70 | * that can be used by omap_pcm_pointer() instead. | 69 | * that can be used by omap_pcm_pointer() instead. |
71 | */ | 70 | */ |
72 | spin_lock_irqsave(&prtd->lock, flags); | 71 | spin_lock_irqsave(&prtd->lock, flags); |
@@ -101,9 +100,11 @@ static int omap_pcm_hw_params(struct snd_pcm_substream *substream, | |||
101 | struct snd_pcm_runtime *runtime = substream->runtime; | 100 | struct snd_pcm_runtime *runtime = substream->runtime; |
102 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 101 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
103 | struct omap_runtime_data *prtd = runtime->private_data; | 102 | struct omap_runtime_data *prtd = runtime->private_data; |
104 | struct omap_pcm_dma_data *dma_data = rtd->dai->cpu_dai->dma_data; | 103 | struct omap_pcm_dma_data *dma_data; |
105 | int err = 0; | 104 | int err = 0; |
106 | 105 | ||
106 | dma_data = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream); | ||
107 | |||
107 | /* return if this is a bufferless transfer e.g. | 108 | /* return if this is a bufferless transfer e.g. |
108 | * codec <--> BT codec or GSM modem -- lg FIXME */ | 109 | * codec <--> BT codec or GSM modem -- lg FIXME */ |
109 | if (!dma_data) | 110 | if (!dma_data) |
@@ -190,8 +191,7 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream) | |||
190 | dma_params.frame_count = runtime->periods; | 191 | dma_params.frame_count = runtime->periods; |
191 | omap_set_dma_params(prtd->dma_ch, &dma_params); | 192 | omap_set_dma_params(prtd->dma_ch, &dma_params); |
192 | 193 | ||
193 | if ((cpu_is_omap1510()) && | 194 | if ((cpu_is_omap1510())) |
194 | (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) | ||
195 | omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ | | 195 | omap_enable_dma_irq(prtd->dma_ch, OMAP_DMA_FRAME_IRQ | |
196 | OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ); | 196 | OMAP_DMA_LAST_IRQ | OMAP_DMA_BLOCK_IRQ); |
197 | else | 197 | else |
@@ -249,14 +249,15 @@ static snd_pcm_uframes_t omap_pcm_pointer(struct snd_pcm_substream *substream) | |||
249 | dma_addr_t ptr; | 249 | dma_addr_t ptr; |
250 | snd_pcm_uframes_t offset; | 250 | snd_pcm_uframes_t offset; |
251 | 251 | ||
252 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { | 252 | if (cpu_is_omap1510()) { |
253 | offset = prtd->period_index * runtime->period_size; | ||
254 | } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { | ||
253 | ptr = omap_get_dma_dst_pos(prtd->dma_ch); | 255 | ptr = omap_get_dma_dst_pos(prtd->dma_ch); |
254 | offset = bytes_to_frames(runtime, ptr - runtime->dma_addr); | 256 | offset = bytes_to_frames(runtime, ptr - runtime->dma_addr); |
255 | } else if (!(cpu_is_omap1510())) { | 257 | } else { |
256 | ptr = omap_get_dma_src_pos(prtd->dma_ch); | 258 | ptr = omap_get_dma_src_pos(prtd->dma_ch); |
257 | offset = bytes_to_frames(runtime, ptr - runtime->dma_addr); | 259 | offset = bytes_to_frames(runtime, ptr - runtime->dma_addr); |
258 | } else | 260 | } |
259 | offset = prtd->period_index * runtime->period_size; | ||
260 | 261 | ||
261 | if (offset >= runtime->buffer_size) | 262 | if (offset >= runtime->buffer_size) |
262 | offset = 0; | 263 | offset = 0; |