From: Timur Tabi <timur@freescale.com>
To: broonie@opensource.wolfsonmicro.com, lrg@ti.com,
alsa-devel@alsa-project.org
Subject: [PATCH 2/2] ASoC: fsl: fix initialization of DMA buffers
Date: Wed, 8 Jun 2011 15:02:56 -0500 [thread overview]
Message-ID: <1307563376-13055-2-git-send-email-timur@freescale.com> (raw)
In-Reply-To: <1307563376-13055-1-git-send-email-timur@freescale.com>
The DMA (PCM) driver used by some Freescale PowerPC supports separate DAIs
for playback and capture, so DMA buffers should be allocated only for the
initialized streams. Instead of checking for the number of active channels,
which apparently is not reliable, check to see if the actual stream object
exists.
Also provide a better name for the DMA interrupt.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
sound/soc/fsl/fsl_dma.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 3872598..732208c 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -312,7 +312,7 @@ static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd)
* should allocate a DMA buffer only for the streams that are valid.
*/
- if (dai->driver->playback.channels_min) {
+ if (pcm->streams[0].substream) {
ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
fsl_dma_hardware.buffer_bytes_max,
&pcm->streams[0].substream->dma_buffer);
@@ -322,13 +322,13 @@ static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd)
}
}
- if (dai->driver->capture.channels_min) {
+ if (pcm->streams[1].substream) {
ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
fsl_dma_hardware.buffer_bytes_max,
&pcm->streams[1].substream->dma_buffer);
if (ret) {
- snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer);
dev_err(card->dev, "can't alloc capture dma buffer\n");
+ snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer);
return ret;
}
}
@@ -451,7 +451,8 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
dma_private->ld_buf_phys = ld_buf_phys;
dma_private->dma_buf_phys = substream->dma_buffer.addr;
- ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "DMA", dma_private);
+ ret = request_irq(dma_private->irq, fsl_dma_isr, 0, "fsldma-audio",
+ dma_private);
if (ret) {
dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
dma_private->irq, ret);
--
1.7.3.4
next prev parent reply other threads:[~2011-06-08 20:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 20:02 [PATCH 1/2] ASoC: p1022ds: fix incorrect referencing of device tree properties Timur Tabi
2011-06-08 20:02 ` Timur Tabi [this message]
2011-06-09 10:52 ` [PATCH 2/2] ASoC: fsl: fix initialization of DMA buffers Mark Brown
2011-06-09 12:39 ` Tabi Timur-B04825
2011-06-08 22:06 ` [PATCH 1/2] ASoC: p1022ds: fix incorrect referencing of device tree properties Steve Calfee
2011-06-08 22:27 ` Timur Tabi
2011-06-09 9:45 ` Liam Girdwood
2011-06-09 11:01 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1307563376-13055-2-git-send-email-timur@freescale.com \
--to=timur@freescale.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=lrg@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).