From fcefb456e5fd217b746965f90ff5f7d9b137d2c5 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Fri, 23 Nov 2012 13:05:41 +0000 Subject: [PATCH] --- yaml --- r: 342783 b: refs/heads/master c: 1428c20f7c38e9fbf59923d1b9615ebdaf2862b7 h: refs/heads/master i: 342781: e7c00bcbfb2c99b9602d99a907092b2f3089f37d 342779: 80731724acc24472486c5243d36a5be5a323807b 342775: 7ccbf2a1e469c8660483b2aef20b4cdc33b0cb9d 342767: 52c2a4628adcd946e8a7e97594f317014d1dcf76 342751: 5d2e371f9eb8d5103a17b5914259ac1718e00afc 342719: 309bc8e24b2a70c4a6e167e8ed65fcfa237d1b94 342655: c136e0523cbae262a8e5c3126cf43aec4fa2c8ad 342527: 90b738781ef04affef4f62306d8f998d72cd3cca v: v3 --- [refs] | 2 +- trunk/sound/soc/ux500/mop500.c | 4 ++-- trunk/sound/soc/ux500/ux500_msp_dai.c | 13 +++++++++++++ trunk/sound/soc/ux500/ux500_pcm.c | 19 ++++--------------- trunk/sound/soc/ux500/ux500_pcm.h | 3 +++ 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index f9550e0b254a..38da3a73dfc9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f61ab093828df646b5df35f244577859efe4329c +refs/heads/master: 1428c20f7c38e9fbf59923d1b9615ebdaf2862b7 diff --git a/trunk/sound/soc/ux500/mop500.c b/trunk/sound/soc/ux500/mop500.c index 356611d9654d..6f67e6b2582d 100644 --- a/trunk/sound/soc/ux500/mop500.c +++ b/trunk/sound/soc/ux500/mop500.c @@ -33,7 +33,7 @@ struct snd_soc_dai_link mop500_dai_links[] = { .stream_name = "ab8500_0", .cpu_dai_name = "ux500-msp-i2s.1", .codec_dai_name = "ab8500-codec-dai.0", - .platform_name = "ux500-pcm.0", + .platform_name = "ux500-msp-i2s.1", .codec_name = "ab8500-codec.0", .init = mop500_ab8500_machine_init, .ops = mop500_ab8500_ops, @@ -43,7 +43,7 @@ struct snd_soc_dai_link mop500_dai_links[] = { .stream_name = "ab8500_1", .cpu_dai_name = "ux500-msp-i2s.3", .codec_dai_name = "ab8500-codec-dai.1", - .platform_name = "ux500-pcm.0", + .platform_name = "ux500-msp-i2s.3", .codec_name = "ab8500-codec.0", .init = NULL, .ops = mop500_ab8500_ops, diff --git a/trunk/sound/soc/ux500/ux500_msp_dai.c b/trunk/sound/soc/ux500/ux500_msp_dai.c index 74bb3c0e81f5..478b4b60e0cc 100644 --- a/trunk/sound/soc/ux500/ux500_msp_dai.c +++ b/trunk/sound/soc/ux500/ux500_msp_dai.c @@ -28,6 +28,7 @@ #include "ux500_msp_i2s.h" #include "ux500_msp_dai.h" +#include "ux500_pcm.h" static int setup_pcm_multichan(struct snd_soc_dai *dai, struct ux500_msp_config *msp_config) @@ -832,8 +833,18 @@ static int __devinit ux500_msp_drv_probe(struct platform_device *pdev) goto err_init_msp; } + ret = ux500_pcm_register_platform(pdev); + if (ret < 0) { + dev_err(&pdev->dev, + "Error: %s: Failed to register PCM platform device!\n", + __func__); + goto err_reg_plat; + } + return 0; +err_reg_plat: + snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv)); err_init_msp: clk_put(drvdata->clk); err_clk: @@ -848,6 +859,8 @@ static int __devexit ux500_msp_drv_remove(struct platform_device *pdev) { struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(&pdev->dev); + ux500_pcm_unregister_platform(pdev); + snd_soc_unregister_dais(&pdev->dev, ARRAY_SIZE(ux500_msp_dai_drv)); devm_regulator_put(drvdata->reg_vape); diff --git a/trunk/sound/soc/ux500/ux500_pcm.c b/trunk/sound/soc/ux500/ux500_pcm.c index 1a04e248453c..894c9f4bb9f6 100644 --- a/trunk/sound/soc/ux500/ux500_pcm.c +++ b/trunk/sound/soc/ux500/ux500_pcm.c @@ -282,7 +282,7 @@ static struct snd_soc_platform_driver ux500_pcm_soc_drv = { .pcm_new = ux500_pcm_new, }; -static int __devexit ux500_pcm_drv_probe(struct platform_device *pdev) +int __devinit ux500_pcm_register_platform(struct platform_device *pdev) { int ret; @@ -296,23 +296,12 @@ static int __devexit ux500_pcm_drv_probe(struct platform_device *pdev) return 0; } +EXPORT_SYMBOL_GPL(ux500_pcm_register_platform); -static int __devinit ux500_pcm_drv_remove(struct platform_device *pdev) +int __devexit ux500_pcm_unregister_platform(struct platform_device *pdev) { snd_soc_unregister_platform(&pdev->dev); return 0; } - -static struct platform_driver ux500_pcm_driver = { - .driver = { - .name = "ux500-pcm", - .owner = THIS_MODULE, - }, - - .probe = ux500_pcm_drv_probe, - .remove = __devexit_p(ux500_pcm_drv_remove), -}; -module_platform_driver(ux500_pcm_driver); - -MODULE_LICENSE("GPL v2"); +EXPORT_SYMBOL_GPL(ux500_pcm_unregister_platform); diff --git a/trunk/sound/soc/ux500/ux500_pcm.h b/trunk/sound/soc/ux500/ux500_pcm.h index 77ed44d371e9..76d344476afc 100644 --- a/trunk/sound/soc/ux500/ux500_pcm.h +++ b/trunk/sound/soc/ux500/ux500_pcm.h @@ -32,4 +32,7 @@ #define UX500_PLATFORM_PERIODS_MAX 48 #define UX500_PLATFORM_BUFFER_BYTES_MAX (2048 * PAGE_SIZE) +int ux500_pcm_register_platform(struct platform_device *pdev); +int ux500_pcm_unregister_platform(struct platform_device *pdev); + #endif