diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-04-24 23:18:47 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-15 01:27:27 -0400 |
commit | 3b7d46380beae3de4a0f03ba4dcbd509c97ab503 (patch) | |
tree | 0b80e050e632cf2821fedcf069a32f7a7b3edd93 | |
parent | bd41bc9696b5631b2c2fe26f40c8cdd99b3aeb3e (diff) |
ASoC: fsl: remove use of imx-pcm-audio from imx-ssi
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>
-rw-r--r-- | sound/soc/fsl/imx-mc13783.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/imx-ssi.c | 21 | ||||
-rw-r--r-- | sound/soc/fsl/imx-ssi.h | 1 | ||||
-rw-r--r-- | sound/soc/fsl/mx27vis-aic32x4.c | 2 |
4 files changed, 7 insertions, 19 deletions
diff --git a/sound/soc/fsl/imx-mc13783.c b/sound/soc/fsl/imx-mc13783.c index 4ae30f21fdb5..9df173c091a6 100644 --- a/sound/soc/fsl/imx-mc13783.c +++ b/sound/soc/fsl/imx-mc13783.c | |||
@@ -64,7 +64,7 @@ static struct snd_soc_dai_link imx_mc13783_dai_mc13783[] = { | |||
64 | .codec_dai_name = "mc13783-hifi", | 64 | .codec_dai_name = "mc13783-hifi", |
65 | .codec_name = "mc13783-codec", | 65 | .codec_name = "mc13783-codec", |
66 | .cpu_dai_name = "imx-ssi.0", | 66 | .cpu_dai_name = "imx-ssi.0", |
67 | .platform_name = "imx-pcm-audio.0", | 67 | .platform_name = "imx-ssi.0", |
68 | .ops = &imx_mc13783_hifi_ops, | 68 | .ops = &imx_mc13783_hifi_ops, |
69 | .symmetric_rates = 1, | 69 | .symmetric_rates = 1, |
70 | .dai_fmt = FMT_SSI, | 70 | .dai_fmt = FMT_SSI, |
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index 902fab02b851..b5a2b040816c 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
@@ -608,24 +608,13 @@ static int imx_ssi_probe(struct platform_device *pdev) | |||
608 | goto failed_pdev_fiq_add; | 608 | goto failed_pdev_fiq_add; |
609 | } | 609 | } |
610 | 610 | ||
611 | ssi->soc_platform_pdev = platform_device_alloc("imx-pcm-audio", pdev->id); | 611 | ret = imx_pcm_dma_init(pdev); |
612 | if (!ssi->soc_platform_pdev) { | 612 | if (ret) |
613 | ret = -ENOMEM; | 613 | goto failed_pcm_dma; |
614 | goto failed_pdev_alloc; | ||
615 | } | ||
616 | |||
617 | platform_set_drvdata(ssi->soc_platform_pdev, ssi); | ||
618 | ret = platform_device_add(ssi->soc_platform_pdev); | ||
619 | if (ret) { | ||
620 | dev_err(&pdev->dev, "failed to add platform device\n"); | ||
621 | goto failed_pdev_add; | ||
622 | } | ||
623 | 614 | ||
624 | return 0; | 615 | return 0; |
625 | 616 | ||
626 | failed_pdev_add: | 617 | failed_pcm_dma: |
627 | platform_device_put(ssi->soc_platform_pdev); | ||
628 | failed_pdev_alloc: | ||
629 | platform_device_del(ssi->soc_platform_pdev_fiq); | 618 | platform_device_del(ssi->soc_platform_pdev_fiq); |
630 | failed_pdev_fiq_add: | 619 | failed_pdev_fiq_add: |
631 | platform_device_put(ssi->soc_platform_pdev_fiq); | 620 | platform_device_put(ssi->soc_platform_pdev_fiq); |
@@ -645,7 +634,7 @@ static int imx_ssi_remove(struct platform_device *pdev) | |||
645 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 634 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
646 | struct imx_ssi *ssi = platform_get_drvdata(pdev); | 635 | struct imx_ssi *ssi = platform_get_drvdata(pdev); |
647 | 636 | ||
648 | platform_device_unregister(ssi->soc_platform_pdev); | 637 | imx_pcm_dma_exit(pdev); |
649 | platform_device_unregister(ssi->soc_platform_pdev_fiq); | 638 | platform_device_unregister(ssi->soc_platform_pdev_fiq); |
650 | 639 | ||
651 | snd_soc_unregister_component(&pdev->dev); | 640 | snd_soc_unregister_component(&pdev->dev); |
diff --git a/sound/soc/fsl/imx-ssi.h b/sound/soc/fsl/imx-ssi.h index bb6b3dbb13fd..b052fad8f6c7 100644 --- a/sound/soc/fsl/imx-ssi.h +++ b/sound/soc/fsl/imx-ssi.h | |||
@@ -212,7 +212,6 @@ struct imx_ssi { | |||
212 | 212 | ||
213 | int enabled; | 213 | int enabled; |
214 | 214 | ||
215 | struct platform_device *soc_platform_pdev; | ||
216 | struct platform_device *soc_platform_pdev_fiq; | 215 | struct platform_device *soc_platform_pdev_fiq; |
217 | }; | 216 | }; |
218 | 217 | ||
diff --git a/sound/soc/fsl/mx27vis-aic32x4.c b/sound/soc/fsl/mx27vis-aic32x4.c index 3d1074179057..f4c3bda5e69e 100644 --- a/sound/soc/fsl/mx27vis-aic32x4.c +++ b/sound/soc/fsl/mx27vis-aic32x4.c | |||
@@ -161,7 +161,7 @@ static struct snd_soc_dai_link mx27vis_aic32x4_dai = { | |||
161 | .name = "tlv320aic32x4", | 161 | .name = "tlv320aic32x4", |
162 | .stream_name = "TLV320AIC32X4", | 162 | .stream_name = "TLV320AIC32X4", |
163 | .codec_dai_name = "tlv320aic32x4-hifi", | 163 | .codec_dai_name = "tlv320aic32x4-hifi", |
164 | .platform_name = "imx-pcm-audio.0", | 164 | .platform_name = "imx-ssi.0", |
165 | .codec_name = "tlv320aic32x4.0-0018", | 165 | .codec_name = "tlv320aic32x4.0-0018", |
166 | .cpu_dai_name = "imx-ssi.0", | 166 | .cpu_dai_name = "imx-ssi.0", |
167 | .ops = &mx27vis_aic32x4_snd_ops, | 167 | .ops = &mx27vis_aic32x4_snd_ops, |