diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-04-24 23:18:47 -0400 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:00:40 -0400 |
commit | 18fc1f9e924571a956d88059376602aed29d7658 (patch) | |
tree | 4f1bb8fdc97386969c3ae13202aab8addd22bdf8 /sound/soc/fsl/imx-ssi.c | |
parent | 22ea0e6c204c35499fd59fe614304919d6e0d39d (diff) |
ASoC: fsl: remove use of imx-pcm-audio from imx-ssi
Commit 3b7d46380beae3de4a0f03ba4dcbd509c97ab503 upstream.
Rather than instantiating imx-pcm-audio to call imx_pcm_dma_init(),
imx-ssi can just directly call it to save the use of imx-pcm-audio.
With this change, imx-ssi becomes not only a cpu DAI but also a
platform device, so updates platform device setup in imx-mc13783 and
mx27vis-aic32x4 accordingly.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'sound/soc/fsl/imx-ssi.c')
-rw-r--r-- | sound/soc/fsl/imx-ssi.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index c6fa03e2114a..034dd9b4a1a0 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
@@ -603,24 +603,13 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
603 | goto failed_pdev_fiq_add; | 603 | goto failed_pdev_fiq_add; |
604 | } | 604 | } |
605 | 605 | ||
606 | ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); | 606 | ret = imx_pcm_dma_init(pdev); |
607 | if (!ssi->soc_platform_pdev) { | 607 | if (ret) |
608 | ret = -ENOMEM; | 608 | goto failed_pcm_dma; |
609 | goto failed_pdev_alloc; | ||
610 | } | ||
611 | |||
612 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); | ||
613 | ret = platform_device_add(ssi->soc_platform_pdev); | ||
614 | if (ret) { | ||
615 | dev_err(&pdev->dev, "failed to add platform device\n"); | ||
616 | goto failed_pdev_add; | ||
617 | } | ||
618 | 609 | ||
619 | return 0; | 610 | return 0; |
620 | 611 | ||
621 | failed_pdev_add: | 612 | failed_pcm_dma: |
622 | platform_device_put(ssi->soc_platform_pdev); | ||
623 | failed_pdev_alloc: | ||
624 | platform_device_del(ssi->soc_platform_pdev_fiq); | 613 | platform_device_del(ssi->soc_platform_pdev_fiq); |
625 | failed_pdev_fiq_add: | 614 | failed_pdev_fiq_add: |
626 | platform_device_put(ssi->soc_platform_pdev_fiq); | 615 | platform_device_put(ssi->soc_platform_pdev_fiq); |
@@ -639,7 +628,7 @@ static int imx_ssi_remove(struct platform_device *pdev) | |||
639 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 628 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
640 | struct imx_ssi *ssi = platform_get_drvdata(pdev); | 629 | struct imx_ssi *ssi = platform_get_drvdata(pdev); |
641 | 630 | ||
642 | platform_device_unregister(ssi->soc_platform_pdev); | 631 | imx_pcm_dma_exit(pdev); |
643 | platform_device_unregister(ssi->soc_platform_pdev_fiq); | 632 | platform_device_unregister(ssi->soc_platform_pdev_fiq); |
644 | 633 | ||
645 | snd_soc_unregister_component(&pdev->dev); | 634 | snd_soc_unregister_component(&pdev->dev); |