aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/imx/imx-pcm-dma-mx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/imx/imx-pcm-dma-mx2.c')
-rw-r--r--sound/soc/imx/imx-pcm-dma-mx2.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c
index 0a595da4811d..fd493ee1428e 100644
--- a/sound/soc/imx/imx-pcm-dma-mx2.c
+++ b/sound/soc/imx/imx-pcm-dma-mx2.c
@@ -103,7 +103,7 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream)
103 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 103 struct imx_pcm_runtime_data *iprtd = runtime->private_data;
104 int ret; 104 int ret;
105 105
106 dma_params = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream); 106 dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
107 107
108 iprtd->dma = imx_dma_request_by_prio(DRV_NAME, DMA_PRIO_HIGH); 108 iprtd->dma = imx_dma_request_by_prio(DRV_NAME, DMA_PRIO_HIGH);
109 if (iprtd->dma < 0) { 109 if (iprtd->dma < 0) {
@@ -213,7 +213,7 @@ static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream)
213 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 213 struct imx_pcm_runtime_data *iprtd = runtime->private_data;
214 int err; 214 int err;
215 215
216 dma_params = snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream); 216 dma_params = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
217 217
218 iprtd->substream = substream; 218 iprtd->substream = substream;
219 iprtd->buf = (unsigned int *)substream->dma_buffer.area; 219 iprtd->buf = (unsigned int *)substream->dma_buffer.area;
@@ -318,19 +318,42 @@ static struct snd_pcm_ops imx_pcm_ops = {
318 .mmap = snd_imx_pcm_mmap, 318 .mmap = snd_imx_pcm_mmap,
319}; 319};
320 320
321static struct snd_soc_platform imx_soc_platform_dma = { 321static struct snd_soc_platform_driver imx_soc_platform_mx2 = {
322 .name = "imx-audio", 322 .ops = &imx_pcm_ops,
323 .pcm_ops = &imx_pcm_ops,
324 .pcm_new = imx_pcm_new, 323 .pcm_new = imx_pcm_new,
325 .pcm_free = imx_pcm_free, 324 .pcm_free = imx_pcm_free,
326}; 325};
327 326
328struct snd_soc_platform *imx_ssi_dma_mx2_init(struct platform_device *pdev, 327static int __devinit imx_soc_platform_probe(struct platform_device *pdev)
329 struct imx_ssi *ssi)
330{ 328{
331 ssi->dma_params_tx.burstsize = DMA_TXFIFO_BURST; 329 return snd_soc_register_platform(&pdev->dev, &imx_soc_platform_mx2);
332 ssi->dma_params_rx.burstsize = DMA_RXFIFO_BURST; 330}
331
332static int __devexit imx_soc_platform_remove(struct platform_device *pdev)
333{
334 snd_soc_unregister_platform(&pdev->dev);
335 return 0;
336}
337
338static struct platform_driver imx_pcm_driver = {
339 .driver = {
340 .name = "imx-pcm-audio",
341 .owner = THIS_MODULE,
342 },
333 343
334 return &imx_soc_platform_dma; 344 .probe = imx_soc_platform_probe,
345 .remove = __devexit_p(imx_soc_platform_remove),
346};
347
348static int __init snd_imx_pcm_init(void)
349{
350 return platform_driver_register(&imx_pcm_driver);
351}
352module_init(snd_imx_pcm_init);
353
354static void __exit snd_imx_pcm_exit(void)
355{
356 platform_driver_unregister(&imx_pcm_driver);
335} 357}
358module_exit(snd_imx_pcm_exit);
336 359