aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2013-06-20 09:20:21 -0400
committerMark Brown <broonie@linaro.org>2013-07-15 06:10:36 -0400
commit9051cba110000985c1a50374fea16f1493955b6e (patch)
treeb82b9fbaff799921e836f9ace4f5270ae039d0d5 /sound/soc/fsl
parentc364796a473db467b9201ea31a096bc0cf23547a (diff)
ASoC: imx-pcm-fiq: Introduce pcm-fiq-params
Cleaner parameter passing for imx-pcm-fiq. Create a seperated fiq-params struct to pass all arguments. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/imx-pcm-fiq.c18
-rw-r--r--sound/soc/fsl/imx-pcm.h15
-rw-r--r--sound/soc/fsl/imx-ssi.c7
-rw-r--r--sound/soc/fsl/imx-ssi.h1
4 files changed, 30 insertions, 11 deletions
diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c
index 310d90290320..3b2ba994beee 100644
--- a/sound/soc/fsl/imx-pcm-fiq.c
+++ b/sound/soc/fsl/imx-pcm-fiq.c
@@ -22,6 +22,7 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23 23
24#include <sound/core.h> 24#include <sound/core.h>
25#include <sound/dmaengine_pcm.h>
25#include <sound/initval.h> 26#include <sound/initval.h>
26#include <sound/pcm.h> 27#include <sound/pcm.h>
27#include <sound/pcm_params.h> 28#include <sound/pcm_params.h>
@@ -32,6 +33,7 @@
32#include <linux/platform_data/asoc-imx-ssi.h> 33#include <linux/platform_data/asoc-imx-ssi.h>
33 34
34#include "imx-ssi.h" 35#include "imx-ssi.h"
36#include "imx-pcm.h"
35 37
36struct imx_pcm_runtime_data { 38struct imx_pcm_runtime_data {
37 unsigned int period; 39 unsigned int period;
@@ -366,9 +368,9 @@ static struct snd_soc_platform_driver imx_soc_platform_fiq = {
366 .pcm_free = imx_pcm_fiq_free, 368 .pcm_free = imx_pcm_fiq_free,
367}; 369};
368 370
369int imx_pcm_fiq_init(struct platform_device *pdev) 371int imx_pcm_fiq_init(struct platform_device *pdev,
372 struct imx_pcm_fiq_params *params)
370{ 373{
371 struct imx_ssi *ssi = platform_get_drvdata(pdev);
372 int ret; 374 int ret;
373 375
374 ret = claim_fiq(&fh); 376 ret = claim_fiq(&fh);
@@ -377,15 +379,15 @@ int imx_pcm_fiq_init(struct platform_device *pdev)
377 return ret; 379 return ret;
378 } 380 }
379 381
380 mxc_set_irq_fiq(ssi->irq, 1); 382 mxc_set_irq_fiq(params->irq, 1);
381 ssi_irq = ssi->irq; 383 ssi_irq = params->irq;
382 384
383 imx_pcm_fiq = ssi->irq; 385 imx_pcm_fiq = params->irq;
384 386
385 imx_ssi_fiq_base = (unsigned long)ssi->base; 387 imx_ssi_fiq_base = (unsigned long)params->base;
386 388
387 ssi->dma_params_tx.maxburst = 4; 389 params->dma_params_tx->maxburst = 4;
388 ssi->dma_params_rx.maxburst = 6; 390 params->dma_params_rx->maxburst = 6;
389 391
390 ret = snd_soc_register_platform(&pdev->dev, &imx_soc_platform_fiq); 392 ret = snd_soc_register_platform(&pdev->dev, &imx_soc_platform_fiq);
391 if (ret) 393 if (ret)
diff --git a/sound/soc/fsl/imx-pcm.h b/sound/soc/fsl/imx-pcm.h
index 67f656c7c320..fd56cad43cd6 100644
--- a/sound/soc/fsl/imx-pcm.h
+++ b/sound/soc/fsl/imx-pcm.h
@@ -32,6 +32,15 @@ imx_pcm_dma_params_init_data(struct imx_dma_data *dma_data,
32 dma_data->peripheral_type = IMX_DMATYPE_SSI; 32 dma_data->peripheral_type = IMX_DMATYPE_SSI;
33} 33}
34 34
35struct imx_pcm_fiq_params {
36 int irq;
37 void __iomem *base;
38
39 /* Pointer to original ssi driver to setup tx rx sizes */
40 struct snd_dmaengine_dai_dma_data *dma_params_rx;
41 struct snd_dmaengine_dai_dma_data *dma_params_tx;
42};
43
35#ifdef CONFIG_SND_SOC_IMX_PCM_DMA 44#ifdef CONFIG_SND_SOC_IMX_PCM_DMA
36int imx_pcm_dma_init(struct platform_device *pdev); 45int imx_pcm_dma_init(struct platform_device *pdev);
37void imx_pcm_dma_exit(struct platform_device *pdev); 46void imx_pcm_dma_exit(struct platform_device *pdev);
@@ -47,10 +56,12 @@ static inline void imx_pcm_dma_exit(struct platform_device *pdev)
47#endif 56#endif
48 57
49#ifdef CONFIG_SND_SOC_IMX_PCM_FIQ 58#ifdef CONFIG_SND_SOC_IMX_PCM_FIQ
50int imx_pcm_fiq_init(struct platform_device *pdev); 59int imx_pcm_fiq_init(struct platform_device *pdev,
60 struct imx_pcm_fiq_params *params);
51void imx_pcm_fiq_exit(struct platform_device *pdev); 61void imx_pcm_fiq_exit(struct platform_device *pdev);
52#else 62#else
53static inline int imx_pcm_fiq_init(struct platform_device *pdev) 63static inline int imx_pcm_fiq_init(struct platform_device *pdev,
64 struct imx_pcm_fiq_params *params)
54{ 65{
55 return -ENODEV; 66 return -ENODEV;
56} 67}
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 51be3772cba9..f029e27366de 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -595,7 +595,12 @@ static int imx_ssi_probe(struct platform_device *pdev)
595 goto failed_register; 595 goto failed_register;
596 } 596 }
597 597
598 ret = imx_pcm_fiq_init(pdev); 598 ssi->fiq_params.irq = ssi->irq;
599 ssi->fiq_params.base = ssi->base;
600 ssi->fiq_params.dma_params_rx = &ssi->dma_params_rx;
601 ssi->fiq_params.dma_params_tx = &ssi->dma_params_tx;
602
603 ret = imx_pcm_fiq_init(pdev, &ssi->fiq_params);
599 if (ret) 604 if (ret)
600 goto failed_pcm_fiq; 605 goto failed_pcm_fiq;
601 606
diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h
index d5003cefca8d..fb1616ba8c59 100644
--- a/sound/soc/fsl/imx-ssi.h
+++ b/sound/soc/fsl/imx-ssi.h
@@ -209,6 +209,7 @@ struct imx_ssi {
209 struct snd_dmaengine_dai_dma_data dma_params_tx; 209 struct snd_dmaengine_dai_dma_data dma_params_tx;
210 struct imx_dma_data filter_data_tx; 210 struct imx_dma_data filter_data_tx;
211 struct imx_dma_data filter_data_rx; 211 struct imx_dma_data filter_data_rx;
212 struct imx_pcm_fiq_params fiq_params;
212 213
213 int enabled; 214 int enabled;
214}; 215};