aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mxs/mxs-saif.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mxs/mxs-saif.c')
-rw-r--r--sound/soc/mxs/mxs-saif.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index 41a6136e3535..d31dc52fa862 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -370,7 +370,6 @@ static int mxs_saif_startup(struct snd_pcm_substream *substream,
370 struct snd_soc_dai *cpu_dai) 370 struct snd_soc_dai *cpu_dai)
371{ 371{
372 struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai); 372 struct mxs_saif *saif = snd_soc_dai_get_drvdata(cpu_dai);
373 snd_soc_dai_set_dma_data(cpu_dai, substream, &saif->dma_param);
374 373
375 /* clear error status to 0 for each re-open */ 374 /* clear error status to 0 for each re-open */
376 saif->fifo_underrun = 0; 375 saif->fifo_underrun = 0;
@@ -606,6 +605,8 @@ static int mxs_saif_dai_probe(struct snd_soc_dai *dai)
606 struct mxs_saif *saif = dev_get_drvdata(dai->dev); 605 struct mxs_saif *saif = dev_get_drvdata(dai->dev);
607 606
608 snd_soc_dai_set_drvdata(dai, saif); 607 snd_soc_dai_set_drvdata(dai, saif);
608 dai->playback_dma_data = &saif->dma_param;
609 dai->capture_dma_data = &saif->dma_param;
609 610
610 return 0; 611 return 0;
611} 612}
@@ -628,6 +629,10 @@ static struct snd_soc_dai_driver mxs_saif_dai = {
628 .ops = &mxs_saif_dai_ops, 629 .ops = &mxs_saif_dai_ops,
629}; 630};
630 631
632static const struct snd_soc_component_driver mxs_saif_component = {
633 .name = "mxs-saif",
634};
635
631static irqreturn_t mxs_saif_irq(int irq, void *dev_id) 636static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
632{ 637{
633 struct mxs_saif *saif = dev_id; 638 struct mxs_saif *saif = dev_id;
@@ -754,9 +759,9 @@ static int mxs_saif_probe(struct platform_device *pdev)
754 return ret; 759 return ret;
755 } 760 }
756 761
757 saif->dma_param.chan_irq = platform_get_irq(pdev, 1); 762 saif->dma_param.dma_data.chan_irq = platform_get_irq(pdev, 1);
758 if (saif->dma_param.chan_irq < 0) { 763 if (saif->dma_param.dma_data.chan_irq < 0) {
759 ret = saif->dma_param.chan_irq; 764 ret = saif->dma_param.dma_data.chan_irq;
760 dev_err(&pdev->dev, "failed to get dma irq resource: %d\n", 765 dev_err(&pdev->dev, "failed to get dma irq resource: %d\n",
761 ret); 766 ret);
762 return ret; 767 return ret;
@@ -764,7 +769,8 @@ static int mxs_saif_probe(struct platform_device *pdev)
764 769
765 platform_set_drvdata(pdev, saif); 770 platform_set_drvdata(pdev, saif);
766 771
767 ret = snd_soc_register_dai(&pdev->dev, &mxs_saif_dai); 772 ret = snd_soc_register_component(&pdev->dev, &mxs_saif_component,
773 &mxs_saif_dai, 1);
768 if (ret) { 774 if (ret) {
769 dev_err(&pdev->dev, "register DAI failed\n"); 775 dev_err(&pdev->dev, "register DAI failed\n");
770 return ret; 776 return ret;
@@ -779,7 +785,7 @@ static int mxs_saif_probe(struct platform_device *pdev)
779 return 0; 785 return 0;
780 786
781failed_pdev_alloc: 787failed_pdev_alloc:
782 snd_soc_unregister_dai(&pdev->dev); 788 snd_soc_unregister_component(&pdev->dev);
783 789
784 return ret; 790 return ret;
785} 791}
@@ -787,7 +793,7 @@ failed_pdev_alloc:
787static int mxs_saif_remove(struct platform_device *pdev) 793static int mxs_saif_remove(struct platform_device *pdev)
788{ 794{
789 mxs_pcm_platform_unregister(&pdev->dev); 795 mxs_pcm_platform_unregister(&pdev->dev);
790 snd_soc_unregister_dai(&pdev->dev); 796 snd_soc_unregister_component(&pdev->dev);
791 797
792 return 0; 798 return 0;
793} 799}