aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/imx-ssi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/fsl/imx-ssi.c')
-rw-r--r--sound/soc/fsl/imx-ssi.c42
1 files changed, 27 insertions, 15 deletions
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 810c7eeb7b03..4ce2d608b37a 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -236,7 +236,7 @@ static int imx_ssi_startup(struct snd_pcm_substream *substream,
236 struct snd_soc_dai *cpu_dai) 236 struct snd_soc_dai *cpu_dai)
237{ 237{
238 struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai); 238 struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai);
239 struct imx_pcm_dma_params *dma_data; 239 struct snd_dmaengine_dai_dma_data *dma_data;
240 240
241 /* Tx/Rx config */ 241 /* Tx/Rx config */
242 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 242 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
@@ -369,8 +369,8 @@ static int imx_ssi_dai_probe(struct snd_soc_dai *dai)
369 369
370 snd_soc_dai_set_drvdata(dai, ssi); 370 snd_soc_dai_set_drvdata(dai, ssi);
371 371
372 val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.burstsize) | 372 val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.maxburst) |
373 SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize); 373 SSI_SFCSR_RFWM0(ssi->dma_params_rx.maxburst);
374 writel(val, ssi->base + SSI_SFCSR); 374 writel(val, ssi->base + SSI_SFCSR);
375 375
376 return 0; 376 return 0;
@@ -400,7 +400,7 @@ static struct snd_soc_dai_driver imx_ac97_dai = {
400 .stream_name = "AC97 Playback", 400 .stream_name = "AC97 Playback",
401 .channels_min = 2, 401 .channels_min = 2,
402 .channels_max = 2, 402 .channels_max = 2,
403 .rates = SNDRV_PCM_RATE_48000, 403 .rates = SNDRV_PCM_RATE_8000_48000,
404 .formats = SNDRV_PCM_FMTBIT_S16_LE, 404 .formats = SNDRV_PCM_FMTBIT_S16_LE,
405 }, 405 },
406 .capture = { 406 .capture = {
@@ -413,6 +413,10 @@ static struct snd_soc_dai_driver imx_ac97_dai = {
413 .ops = &imx_ssi_pcm_dai_ops, 413 .ops = &imx_ssi_pcm_dai_ops,
414}; 414};
415 415
416static const struct snd_soc_component_driver imx_component = {
417 .name = DRV_NAME,
418};
419
416static void setup_channel_to_ac97(struct imx_ssi *imx_ssi) 420static void setup_channel_to_ac97(struct imx_ssi *imx_ssi)
417{ 421{
418 void __iomem *base = imx_ssi->base; 422 void __iomem *base = imx_ssi->base;
@@ -575,23 +579,31 @@ static int imx_ssi_probe(struct platform_device *pdev)
575 579
576 writel(0x0, ssi->base + SSI_SIER); 580 writel(0x0, ssi->base + SSI_SIER);
577 581
578 ssi->dma_params_rx.dma_addr = res->start + SSI_SRX0; 582 ssi->dma_params_rx.addr = res->start + SSI_SRX0;
579 ssi->dma_params_tx.dma_addr = res->start + SSI_STX0; 583 ssi->dma_params_tx.addr = res->start + SSI_STX0;
580 584
581 ssi->dma_params_tx.burstsize = 6; 585 ssi->dma_params_tx.maxburst = 6;
582 ssi->dma_params_rx.burstsize = 4; 586 ssi->dma_params_rx.maxburst = 4;
587
588 ssi->dma_params_tx.filter_data = &ssi->filter_data_tx;
589 ssi->dma_params_rx.filter_data = &ssi->filter_data_rx;
583 590
584 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx0"); 591 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx0");
585 if (res) 592 if (res) {
586 ssi->dma_params_tx.dma = res->start; 593 imx_pcm_dma_params_init_data(&ssi->filter_data_tx, res->start,
594 false);
595 }
587 596
588 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx0"); 597 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx0");
589 if (res) 598 if (res) {
590 ssi->dma_params_rx.dma = res->start; 599 imx_pcm_dma_params_init_data(&ssi->filter_data_rx, res->start,
600 false);
601 }
591 602
592 platform_set_drvdata(pdev, ssi); 603 platform_set_drvdata(pdev, ssi);
593 604
594 ret = snd_soc_register_dai(&pdev->dev, dai); 605 ret = snd_soc_register_component(&pdev->dev, &imx_component,
606 dai, 1);
595 if (ret) { 607 if (ret) {
596 dev_err(&pdev->dev, "register DAI failed\n"); 608 dev_err(&pdev->dev, "register DAI failed\n");
597 goto failed_register; 609 goto failed_register;
@@ -632,7 +644,7 @@ failed_pdev_alloc:
632failed_pdev_fiq_add: 644failed_pdev_fiq_add:
633 platform_device_put(ssi->soc_platform_pdev_fiq); 645 platform_device_put(ssi->soc_platform_pdev_fiq);
634failed_pdev_fiq_alloc: 646failed_pdev_fiq_alloc:
635 snd_soc_unregister_dai(&pdev->dev); 647 snd_soc_unregister_component(&pdev->dev);
636failed_register: 648failed_register:
637 release_mem_region(res->start, resource_size(res)); 649 release_mem_region(res->start, resource_size(res));
638failed_get_resource: 650failed_get_resource:
@@ -650,7 +662,7 @@ static int imx_ssi_remove(struct platform_device *pdev)
650 platform_device_unregister(ssi->soc_platform_pdev); 662 platform_device_unregister(ssi->soc_platform_pdev);
651 platform_device_unregister(ssi->soc_platform_pdev_fiq); 663 platform_device_unregister(ssi->soc_platform_pdev_fiq);
652 664
653 snd_soc_unregister_dai(&pdev->dev); 665 snd_soc_unregister_component(&pdev->dev);
654 666
655 if (ssi->flags & IMX_SSI_USE_AC97) 667 if (ssi->flags & IMX_SSI_USE_AC97)
656 ac97_ssi = NULL; 668 ac97_ssi = NULL;