Commit fbd07a2c authored by Nicolin Chen's avatar Nicolin Chen

ENGR00233731 ALSA: add DMABUF allocating for different driver

 Patch ENGR00233056 added DMABUF size setting for hw_param and changed SSI's
buffer allocating size.
 But didn't add allocation for ESAI and SPDIF, which might cause some dma
transmitting issue.
 This Patch add new allocation code that detects the driver before allocating
its DMABUF.
Signed-off-by: default avatarNicolin Chen <b42378@freescale.com>
parent bbdb7813
......@@ -439,8 +439,18 @@ EXPORT_SYMBOL_GPL(snd_imx_pcm_mmap);
static int imx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
{
struct snd_pcm_substream *substream = pcm->streams[stream].substream;
struct snd_soc_pcm_runtime *rtd = pcm->private_data;
struct snd_dma_buffer *buf = &substream->dma_buffer;
size_t size = IMX_SSI_DMABUF_SIZE;
size_t size;
if (!strncmp(rtd->cpu_dai->name, "imx-ssi", strlen("imx-ssi")))
size = IMX_SSI_DMABUF_SIZE;
else if (!strncmp(rtd->cpu_dai->name, "imx-esai", strlen("imx-esai")))
size = IMX_ESAI_DMABUF_SIZE;
else if (!strncmp(rtd->cpu_dai->name, "imx-spdif", strlen("imx-spdif")))
size = IMX_SPDIF_DMABUF_SIZE;
else
size = IMX_DEFAULT_DMABUF_SIZE;
buf->dev.type = SNDRV_DMA_TYPE_DEV;
buf->dev.dev = pcm->card->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment