diff options
author | Zidan Wang <zidan.wang@freescale.com> | 2015-06-26 16:06:45 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2015-09-17 09:23:47 -0500 |
commit | 95e84bebfb873d78009277b4298559d2c886f6c9 (patch) | |
tree | c2ffbd77e2bd2722aaa0e40acd1fc1d9d912aa9b /sound | |
parent | d2c2efb54c4740b4a2e089516f1e852260279e38 (diff) |
MLK-11179 ASoC: fsl: implement specify audio DMA buffer size from devicetree
If the property "fsl,dma-buffer-size" is present, using the specified buffer size.
Otherwise, using the default audio buffer size.
Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/fsl_esai.c | 8 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_spdif.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 6 |
4 files changed, 21 insertions, 5 deletions
diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index bffec8bd6e4a..57341bd92e74 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -1,7 +1,7 @@ /* * Freescale ESAI ALSA SoC Digital Audio Interface (DAI) driver * - * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any @@ -875,6 +875,7 @@ static int fsl_esai_probe(struct platform_device *pdev) const uint32_t *iprop; void __iomem *regs; int irq, ret; + u32 buffer_size; esai_priv = devm_kzalloc(&pdev->dev, sizeof(*esai_priv), GFP_KERNEL); if (!esai_priv) @@ -999,7 +1000,10 @@ static int fsl_esai_probe(struct platform_device *pdev) return ret; } - ret = imx_pcm_dma_init(pdev, IMX_ESAI_DMABUF_SIZE); + if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) + buffer_size = IMX_ESAI_DMABUF_SIZE; + + ret = imx_pcm_dma_init(pdev, buffer_size); if (ret) dev_err(&pdev->dev, "failed to init imx pcm dma: %d\n", ret); diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 78c8fbfd65ea..50c2b3c1695d 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -727,6 +727,7 @@ static int fsl_sai_probe(struct platform_device *pdev) void __iomem *base; char tmp[8]; int irq, ret, i; + u32 buffer_size; sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); if (!sai) @@ -833,8 +834,11 @@ static int fsl_sai_probe(struct platform_device *pdev) if (ret) return ret; + if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) + buffer_size = IMX_SAI_DMABUF_SIZE; + if (sai->sai_on_imx) - return imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE); + return imx_pcm_dma_init(pdev, buffer_size); else return devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, SND_DMAENGINE_PCM_FLAG_NO_RESIDUE); diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 3b31f4a5c9a2..eaff4cc082aa 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1191,6 +1191,7 @@ static int fsl_spdif_probe(struct platform_device *pdev) struct resource *res; void __iomem *regs; int irq, ret, i; + u32 buffer_size; if (!np) return -ENODEV; @@ -1304,7 +1305,10 @@ static int fsl_spdif_probe(struct platform_device *pdev) return ret; } - ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE); + if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) + buffer_size = IMX_SPDIF_DMABUF_SIZE; + + ret = imx_pcm_dma_init(pdev, buffer_size); if (ret) dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret); diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 08feebff20d1..39aff7ec6f63 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1259,6 +1259,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev, struct device_node *np = pdev->dev.of_node; u32 dmas[4]; int ret; + u32 buffer_size; if (ssi_private->has_ipg_clk_name) ssi_private->clk = devm_clk_get(&pdev->dev, "ipg"); @@ -1305,6 +1306,9 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev, ssi_private->dma_params_rx.maxburst &= ~0x1; } + if (of_property_read_u32(np, "fsl,dma-buffer-size", &buffer_size)) + buffer_size = IMX_SSI_DMABUF_SIZE; + if (!ssi_private->use_dma) { /* @@ -1325,7 +1329,7 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev, if (ret) goto error_pcm; } else { - ret = imx_pcm_dma_init(pdev, IMX_SSI_DMABUF_SIZE); + ret = imx_pcm_dma_init(pdev, buffer_size); if (ret) goto error_pcm; } |