diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2013-04-24 23:18:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-15 01:27:26 -0400 |
commit | bd41bc9696b5631b2c2fe26f40c8cdd99b3aeb3e (patch) | |
tree | 7e0bb744ac26cf45fc952b314b0fcfe25ad26758 | |
parent | 436947fc82237e2cd78b3b2c11633aaa6ef07641 (diff) |
ASoC: fsl: remove use of imx-pcm-audio from fsl_ssi
Rather than instantiating imx-pcm-audio to call imx_pcm_dma_init(),
fsl_ssi can just directly call it to save the use of imx-pcm-audio.
With this change, fsl_ssi becomes not only a cpu DAI but also a platform
device, so updates platform device setup in imx-sgtl5000 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/fsl_ssi.c | 13 | ||||
-rw-r--r-- | sound/soc/fsl/imx-sgtl5000.c | 2 |
2 files changed, 5 insertions, 10 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 0f0bed6def9e..2f2d837df07f 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -122,7 +122,6 @@ struct fsl_ssi_private { | |||
122 | bool new_binding; | 122 | bool new_binding; |
123 | bool ssi_on_imx; | 123 | bool ssi_on_imx; |
124 | struct clk *clk; | 124 | struct clk *clk; |
125 | struct platform_device *imx_pcm_pdev; | ||
126 | struct snd_dmaengine_dai_dma_data dma_params_tx; | 125 | struct snd_dmaengine_dai_dma_data dma_params_tx; |
127 | struct snd_dmaengine_dai_dma_data dma_params_rx; | 126 | struct snd_dmaengine_dai_dma_data dma_params_rx; |
128 | struct imx_dma_data filter_data_tx; | 127 | struct imx_dma_data filter_data_tx; |
@@ -809,13 +808,9 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
809 | } | 808 | } |
810 | 809 | ||
811 | if (ssi_private->ssi_on_imx) { | 810 | if (ssi_private->ssi_on_imx) { |
812 | ssi_private->imx_pcm_pdev = | 811 | ret = imx_pcm_dma_init(pdev); |
813 | platform_device_register_simple("imx-pcm-audio", | 812 | if (ret) |
814 | -1, NULL, 0); | ||
815 | if (IS_ERR(ssi_private->imx_pcm_pdev)) { | ||
816 | ret = PTR_ERR(ssi_private->imx_pcm_pdev); | ||
817 | goto error_dev; | 813 | goto error_dev; |
818 | } | ||
819 | } | 814 | } |
820 | 815 | ||
821 | /* | 816 | /* |
@@ -854,7 +849,7 @@ done: | |||
854 | 849 | ||
855 | error_dai: | 850 | error_dai: |
856 | if (ssi_private->ssi_on_imx) | 851 | if (ssi_private->ssi_on_imx) |
857 | platform_device_unregister(ssi_private->imx_pcm_pdev); | 852 | imx_pcm_dma_exit(pdev); |
858 | snd_soc_unregister_component(&pdev->dev); | 853 | snd_soc_unregister_component(&pdev->dev); |
859 | 854 | ||
860 | error_dev: | 855 | error_dev: |
@@ -889,7 +884,7 @@ static int fsl_ssi_remove(struct platform_device *pdev) | |||
889 | if (!ssi_private->new_binding) | 884 | if (!ssi_private->new_binding) |
890 | platform_device_unregister(ssi_private->pdev); | 885 | platform_device_unregister(ssi_private->pdev); |
891 | if (ssi_private->ssi_on_imx) { | 886 | if (ssi_private->ssi_on_imx) { |
892 | platform_device_unregister(ssi_private->imx_pcm_pdev); | 887 | imx_pcm_dma_exit(pdev); |
893 | clk_disable_unprepare(ssi_private->clk); | 888 | clk_disable_unprepare(ssi_private->clk); |
894 | clk_put(ssi_private->clk); | 889 | clk_put(ssi_private->clk); |
895 | } | 890 | } |
diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c index 5a6aaa3b947a..a60aaa053d28 100644 --- a/sound/soc/fsl/imx-sgtl5000.c +++ b/sound/soc/fsl/imx-sgtl5000.c | |||
@@ -149,7 +149,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev) | |||
149 | data->dai.codec_dai_name = "sgtl5000"; | 149 | data->dai.codec_dai_name = "sgtl5000"; |
150 | data->dai.codec_of_node = codec_np; | 150 | data->dai.codec_of_node = codec_np; |
151 | data->dai.cpu_of_node = ssi_np; | 151 | data->dai.cpu_of_node = ssi_np; |
152 | data->dai.platform_name = "imx-pcm-audio"; | 152 | data->dai.platform_of_node = ssi_np; |
153 | data->dai.init = &imx_sgtl5000_dai_init; | 153 | data->dai.init = &imx_sgtl5000_dai_init; |
154 | data->dai.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | 154 | data->dai.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
155 | SND_SOC_DAIFMT_CBM_CFM; | 155 | SND_SOC_DAIFMT_CBM_CFM; |