* [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card()
@ 2012-07-03 8:34 Sachin Kamat
2012-07-03 10:35 ` Sangbeom Kim
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Sachin Kamat @ 2012-07-03 8:34 UTC (permalink / raw)
To: alsa-devel
Cc: linux-samsung-soc, broonie, sbkim73, kgene.kim, tiwai,
sachin.kamat, patches
Current method for machine driver to register with the ASoC core is to use
snd_soc_register_card() instead of creating a "soc-audio" platform device.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
sound/soc/samsung/smdk_wm8994.c | 36 +++++++++++++++++++++++-------------
1 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index 8eb309f..3ea3098 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -149,31 +149,41 @@ static struct snd_soc_card smdk = {
.num_links = ARRAY_SIZE(smdk_dai),
};
-static struct platform_device *smdk_snd_device;
-static int __init smdk_audio_init(void)
+static int __devinit smdk_audio_probe(struct platform_device *pdev)
{
int ret;
+ struct snd_soc_card *card = &smdk;
- smdk_snd_device = platform_device_alloc("soc-audio", -1);
- if (!smdk_snd_device)
- return -ENOMEM;
+ card->dev = &pdev->dev;
+ ret = snd_soc_register_card(card);
- platform_set_drvdata(smdk_snd_device, &smdk);
-
- ret = platform_device_add(smdk_snd_device);
if (ret)
- platform_device_put(smdk_snd_device);
+ dev_err(&pdev->dev, "snd_soc_register_card() failed:%d\n", ret);
return ret;
}
-module_init(smdk_audio_init);
-static void __exit smdk_audio_exit(void)
+static int __devexit smdk_audio_remove(struct platform_device *pdev)
{
- platform_device_unregister(smdk_snd_device);
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+ snd_soc_unregister_card(card);
+
+ return 0;
}
-module_exit(smdk_audio_exit);
+
+static struct platform_driver smdk_audio_driver = {
+ .driver = {
+ .name = "smdk-audio",
+ .owner = THIS_MODULE,
+ },
+ .probe = smdk_audio_probe,
+ .remove = __devexit_p(smdk_audio_remove),
+};
+
+module_platform_driver(smdk_audio_driver);
MODULE_DESCRIPTION("ALSA SoC SMDK WM8994");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:smdk-audio");
--
1.7.4.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card()
2012-07-03 8:34 [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card() Sachin Kamat
@ 2012-07-03 10:35 ` Sangbeom Kim
2012-07-03 18:48 ` Mark Brown
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Sangbeom Kim @ 2012-07-03 10:35 UTC (permalink / raw)
To: 'Sachin Kamat', alsa-devel
Cc: linux-samsung-soc, broonie, kgene.kim, tiwai, patches
Hi!
On Tuesday, Jul 03, 2012 at 05:34PM, Sachin Kamat wrote:
> Current method for machine driver to register with the ASoC core is to use
> snd_soc_register_card() instead of creating a "soc-audio" platform device.
It looks better to include reason of using snd_soc_register_card
instead of creating "soc-audio" or warning message.
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card()
2012-07-03 8:34 [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card() Sachin Kamat
2012-07-03 10:35 ` Sangbeom Kim
@ 2012-07-03 18:48 ` Mark Brown
2012-07-12 8:35 ` [PATCH 1/3] ARM: EXYNOS: Add audio platform device in SMDKV310 board Sangbeom Kim
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-07-03 18:48 UTC (permalink / raw)
To: Sachin Kamat
Cc: alsa-devel, linux-samsung-soc, sbkim73, kgene.kim, tiwai, patches
[-- Attachment #1: Type: text/plain, Size: 302 bytes --]
On Tue, Jul 03, 2012 at 02:04:04PM +0530, Sachin Kamat wrote:
> Current method for machine driver to register with the ASoC core is to use
> snd_soc_register_card() instead of creating a "soc-audio" platform device.
Applied, thanks (it's not a generic Samsung patch, it's just for the one
board BTW).
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/3] ARM: EXYNOS: Add audio platform device in SMDKV310 board
2012-07-03 8:34 [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card() Sachin Kamat
2012-07-03 10:35 ` Sangbeom Kim
2012-07-03 18:48 ` Mark Brown
@ 2012-07-12 8:35 ` Sangbeom Kim
2012-07-12 8:39 ` [PATCH 2/3] ARM: S5PV210: Add audio platform device in Aquila board Sangbeom Kim
2012-07-12 8:40 ` [PATCH 3/3] ARM: S5PV210: Add audio platform device in Goni board Sangbeom Kim
4 siblings, 0 replies; 6+ messages in thread
From: Sangbeom Kim @ 2012-07-12 8:35 UTC (permalink / raw)
To: 'Sachin Kamat'; +Cc: linux-samsung-soc, kgene.kim, patches
Hi!
On Tuesday, Jul 05, 2012 at 09:01:56, Sachin Kamat wrote:
> After using snd_soc_register_card() in smdk_wm8994.c, the sound
> card is registered as a platform driver and it needs related platform
> device entry in machine file.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
Thanks,
Sangbeom.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 2/3] ARM: S5PV210: Add audio platform device in Aquila board
2012-07-03 8:34 [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card() Sachin Kamat
` (2 preceding siblings ...)
2012-07-12 8:35 ` [PATCH 1/3] ARM: EXYNOS: Add audio platform device in SMDKV310 board Sangbeom Kim
@ 2012-07-12 8:39 ` Sangbeom Kim
2012-07-12 8:40 ` [PATCH 3/3] ARM: S5PV210: Add audio platform device in Goni board Sangbeom Kim
4 siblings, 0 replies; 6+ messages in thread
From: Sangbeom Kim @ 2012-07-12 8:39 UTC (permalink / raw)
To: 'Sachin Kamat'; +Cc: linux-samsung-soc, kgene.kim, patches
Hi!
On Thu, Jul 05, 2012 at 09:01:57, Sachin Kamat wrote:
> After using snd_soc_register_card() in smdk_wm8994.c, the sound
> card is registered as a platform driver and it needs related platform
> device entry in machine file.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
Thanks,
Sangbeom.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 3/3] ARM: S5PV210: Add audio platform device in Goni board
2012-07-03 8:34 [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card() Sachin Kamat
` (3 preceding siblings ...)
2012-07-12 8:39 ` [PATCH 2/3] ARM: S5PV210: Add audio platform device in Aquila board Sangbeom Kim
@ 2012-07-12 8:40 ` Sangbeom Kim
4 siblings, 0 replies; 6+ messages in thread
From: Sangbeom Kim @ 2012-07-12 8:40 UTC (permalink / raw)
To: 'Sachin Kamat'; +Cc: linux-samsung-soc, kgene.kim, patches
On Thu, Jul 05, 2012 at 09:01:58, Sachin Kamat wrote:
> After using snd_soc_register_card() in smdk_wm8994.c, the sound
> card is registered as a platform driver and it needs related platform
> device entry in machine file.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
Thanks,
Sangbeom.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-07-12 8:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03 8:34 [PATCH 1/1] ASoC: Samsung: Convert to use snd_soc_register_card() Sachin Kamat
2012-07-03 10:35 ` Sangbeom Kim
2012-07-03 18:48 ` Mark Brown
2012-07-12 8:35 ` [PATCH 1/3] ARM: EXYNOS: Add audio platform device in SMDKV310 board Sangbeom Kim
2012-07-12 8:39 ` [PATCH 2/3] ARM: S5PV210: Add audio platform device in Aquila board Sangbeom Kim
2012-07-12 8:40 ` [PATCH 3/3] ARM: S5PV210: Add audio platform device in Goni board Sangbeom Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox