aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-11-23 08:05:41 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-23 09:06:02 -0500
commit1428c20f7c38e9fbf59923d1b9615ebdaf2862b7 (patch)
tree9b946dc80e618243e5895f5b3fcdda8e746a6146 /sound/soc/ux500
parentf61ab093828df646b5df35f244577859efe4329c (diff)
ASoC: Ux500: Initialise PCM from MSP probe rather than as a device
The PCM is a pseudo-device. It doesn't have any of it's own registers or hardware. It rather acts as a layer of abstraction for DMA transfers. Hence, instead of classifying it as a device in its own right, we call the initialisation from the MSP driver. Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Ola LILJA2 <ola.o.lilja@stericsson.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/ux500')
-rw-r--r--sound/soc/ux500/mop500.c4
-rw-r--r--sound/soc/ux500/ux500_msp_dai.c13
-rw-r--r--sound/soc/ux500/ux500_pcm.c19
-rw-r--r--sound/soc/ux500/ux500_pcm.h3
4 files changed, 22 insertions, 17 deletions
diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index 356611d9654d..6f67e6b2582d 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -33,7 +33,7 @@ struct snd_soc_dai_link mop500_dai_links[] = {
33 .stream_name = "ab8500_0", 33 .stream_name = "ab8500_0",
34 .cpu_dai_name = "ux500-msp-i2s.1", 34 .cpu_dai_name = "ux500-msp-i2s.1",
35 .codec_dai_name = "ab8500-codec-dai.0", 35 .codec_dai_name = "ab8500-codec-dai.0",
36 .platform_name = "ux500-pcm.0", 36 .platform_name = "ux500-msp-i2s.1",
37 .codec_name = "ab8500-codec.0", 37 .codec_name = "ab8500-codec.0",
38 .init = mop500_ab8500_machine_init, 38 .init = mop500_ab8500_machine_init,
39 .ops = mop500_ab8500_ops, 39 .ops = mop500_ab8500_ops,
@@ -43,7 +43,7 @@ struct snd_soc_dai_link mop500_dai_links[] = {
43 .stream_name = "ab8500_1", 43 .stream_name = "ab8500_1",
44 .cpu_dai_name = "ux500-msp-i2s.3", 44 .cpu_dai_name = "ux500-msp-i2s.3",
45 .codec_dai_name = "ab8500-codec-dai.1", 45 .codec_dai_name = "ab8500-codec-dai.1",
46 .platform_name = "ux500-pcm.0", 46 .platform_name = "ux500-msp-i2s.3",
47 .codec_name = "ab8500-codec.0", 47 .codec_name = "ab8500-codec.0",
48 .init = NULL, 48 .init = NULL,
49 .ops = mop500_ab8500_ops, 49 .ops = mop500_ab8500_ops,
diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c
index 74bb3c0e81f5..478b4b60e0cc 100644
--- a/sound/soc/ux500/ux500_msp_dai.c
+++ b/sound/soc/ux500/ux500_msp_dai.c
@@ -28,6 +28,7 @@
28 28
29#include "ux500_msp_i2s.h" 29#include "ux500_msp_i2s.h"
30#include "ux500_msp_dai.h" 30#include "ux500_msp_dai.h"
31#include "ux500_pcm.h"
31 32
32static int setup_pcm_multichan(struct snd_soc_dai *dai, 33static int setup_pcm_multichan(struct snd_soc_dai *dai,
33 struct ux500_msp_config *msp_config) 34 struct ux500_msp_config *msp_config)
@@ -832,8 +833,18 @@ static int __devinit ux500_msp_drv_probe(struct platform_device *pdev)
832 goto err_init_msp; 833 goto err_init_msp;
833 } 834 }
834 835
836 ret = ux500_pcm_register_platform(pdev);
837 if (ret < 0) {
838 dev_err(&pdev->dev,
839 "Error: %s: Failed to register PCM platform device!\n",
840 __func__);
841 goto err_reg_plat;
842 }
843
835 return 0; 844 return 0;
836 845
846err_reg_plat:
847 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv));
837err_init_msp: 848err_init_msp:
838 clk_put(drvdata->clk); 849 clk_put(drvdata->clk);
839err_clk: 850err_clk:
@@ -848,6 +859,8 @@ static int __devexit ux500_msp_drv_remove(struct platform_device *pdev)
848{ 859{
849 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev); 860 struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev);
850 861
862 ux500_pcm_unregister_platform(pdev);
863
851 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv)); 864 snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv));
852 865
853 devm_regulator_put(drvdata->reg_vape); 866 devm_regulator_put(drvdata->reg_vape);
diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
index 1a04e248453c..894c9f4bb9f6 100644
--- a/sound/soc/ux500/ux500_pcm.c
+++ b/sound/soc/ux500/ux500_pcm.c
@@ -282,7 +282,7 @@ static struct snd_soc_platform_driver ux500_pcm_soc_drv = {
282 .pcm_new = ux500_pcm_new, 282 .pcm_new = ux500_pcm_new,
283}; 283};
284 284
285static int __devexit ux500_pcm_drv_probe(struct platform_device *pdev) 285int __devinit ux500_pcm_register_platform(struct platform_device *pdev)
286{ 286{
287 int ret; 287 int ret;
288 288
@@ -296,23 +296,12 @@ static int __devexit ux500_pcm_drv_probe(struct platform_device *pdev)
296 296
297 return 0; 297 return 0;
298} 298}
299EXPORT_SYMBOL_GPL(ux500_pcm_register_platform);
299 300
300static int __devinit ux500_pcm_drv_remove(struct platform_device *pdev) 301int __devexit ux500_pcm_unregister_platform(struct platform_device *pdev)
301{ 302{
302 snd_soc_unregister_platform(&pdev->dev); 303 snd_soc_unregister_platform(&pdev->dev);
303 304
304 return 0; 305 return 0;
305} 306}
306 307EXPORT_SYMBOL_GPL(ux500_pcm_unregister_platform);
307static struct platform_driver ux500_pcm_driver = {
308 .driver = {
309 .name = "ux500-pcm",
310 .owner = THIS_MODULE,
311 },
312
313 .probe = ux500_pcm_drv_probe,
314 .remove = __devexit_p(ux500_pcm_drv_remove),
315};
316module_platform_driver(ux500_pcm_driver);
317
318MODULE_LICENSE("GPL v2");
diff --git a/sound/soc/ux500/ux500_pcm.h b/sound/soc/ux500/ux500_pcm.h
index 77ed44d371e9..76d344476afc 100644
--- a/sound/soc/ux500/ux500_pcm.h
+++ b/sound/soc/ux500/ux500_pcm.h
@@ -32,4 +32,7 @@
32#define UX500_PLATFORM_PERIODS_MAX 48 32#define UX500_PLATFORM_PERIODS_MAX 48
33#define UX500_PLATFORM_BUFFER_BYTES_MAX (2048 * PAGE_SIZE) 33#define UX500_PLATFORM_BUFFER_BYTES_MAX (2048 * PAGE_SIZE)
34 34
35int ux500_pcm_register_platform(struct platform_device *pdev);
36int ux500_pcm_unregister_platform(struct platform_device *pdev);
37
35#endif 38#endif