alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
@ 2011-09-11  9:28 Mika Westerberg
  2011-09-11  9:28 ` [PATCH 1/7] ASoC: ep93xx-pcm: add MODULE_ALIAS Mika Westerberg
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, lrg,
	linux-arm-kernel

Here is a series of patches which convert ep93xx ASoC drivers to use
snd_soc_register_card(). This has the advantage that the machine drivers get
loaded automatically by udev. Also this gets rid of machine_is_xxx() from the
machine drivers.

Tested on Sim.One. The edb93xx and snappercl15 changes are compile tested
only.

Mika Westerberg (7):
  ASoC: ep93xx-pcm: add MODULE_ALIAS
  ASoC: simone: convert to use snd_soc_register_card()
  ASoC: edb93xx: convert to use snd_soc_register_card()
  ASoC: snappercl15: convert to use snd_soc_register_card()
  ARM: ep93xx: simone: register audio platform device
  ARM: ep93xx: edb93xx: register audio platform device
  ARM: ep93xx: snappercl15: register audio platform device

 arch/arm/mach-ep93xx/edb93xx.c     |    6 +++
 arch/arm/mach-ep93xx/simone.c      |   13 +++++++-
 arch/arm/mach-ep93xx/snappercl15.c |   13 +++++++-
 sound/soc/ep93xx/edb93xx.c         |   60 ++++++++++++++++++---------------
 sound/soc/ep93xx/ep93xx-pcm.c      |    1 +
 sound/soc/ep93xx/simone.c          |   64 ++++++++++++++++++++----------------
 sound/soc/ep93xx/snappercl15.c     |   53 ++++++++++++++++++++---------
 7 files changed, 136 insertions(+), 74 deletions(-)

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/7] ASoC: ep93xx-pcm: add MODULE_ALIAS
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
@ 2011-09-11  9:28 ` Mika Westerberg
  2011-09-11  9:28 ` [PATCH 2/7] ASoC: simone: convert to use snd_soc_register_card() Mika Westerberg
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, lrg,
	linux-arm-kernel

To get the PCM module loaded automatically by udev et al. we need to add a
proper MODULE_ALIAS.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
---
 sound/soc/ep93xx/ep93xx-pcm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c
index 8dfd3ad..d00230a 100644
--- a/sound/soc/ep93xx/ep93xx-pcm.c
+++ b/sound/soc/ep93xx/ep93xx-pcm.c
@@ -355,3 +355,4 @@ module_exit(ep93xx_soc_platform_exit);
 MODULE_AUTHOR("Ryan Mallon");
 MODULE_DESCRIPTION("EP93xx ALSA PCM interface");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:ep93xx-pcm-audio");
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/7] ASoC: simone: convert to use snd_soc_register_card()
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
  2011-09-11  9:28 ` [PATCH 1/7] ASoC: ep93xx-pcm: add MODULE_ALIAS Mika Westerberg
@ 2011-09-11  9:28 ` Mika Westerberg
  2011-09-11  9:28 ` [PATCH 3/7] ASoC: edb93xx: " Mika Westerberg
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, lrg,
	linux-arm-kernel

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.

In addition we use platform_device_register_simple() to create a platform
device for the codec. This function will handle putting and deleting the
device automatically which simplifies the error handling in the machine
driver.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
---
 sound/soc/ep93xx/simone.c |   64 +++++++++++++++++++++++++-------------------
 1 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/sound/soc/ep93xx/simone.c b/sound/soc/ep93xx/simone.c
index 2868179..968cb31 100644
--- a/sound/soc/ep93xx/simone.c
+++ b/sound/soc/ep93xx/simone.c
@@ -39,53 +39,61 @@ static struct snd_soc_card snd_soc_simone = {
 };
 
 static struct platform_device *simone_snd_ac97_device;
-static struct platform_device *simone_snd_device;
 
-static int __init simone_init(void)
+static int __devinit simone_probe(struct platform_device *pdev)
 {
+	struct snd_soc_card *card = &snd_soc_simone;
 	int ret;
 
-	if (!machine_is_sim_one())
-		return -ENODEV;
-
-	simone_snd_ac97_device = platform_device_alloc("ac97-codec", -1);
-	if (!simone_snd_ac97_device)
-		return -ENOMEM;
+	simone_snd_ac97_device = platform_device_register_simple("ac97-codec",
+								 -1, NULL, 0);
+	if (IS_ERR(simone_snd_ac97_device))
+		return PTR_ERR(simone_snd_ac97_device);
 
-	ret = platform_device_add(simone_snd_ac97_device);
-	if (ret)
-		goto fail1;
+	card->dev = &pdev->dev;
 
-	simone_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!simone_snd_device) {
-		ret = -ENOMEM;
-		goto fail2;
+	ret = snd_soc_register_card(card);
+	if (ret) {
+		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+			ret);
+		platform_device_unregister(simone_snd_ac97_device);
 	}
 
-	platform_set_drvdata(simone_snd_device, &snd_soc_simone);
-	ret = platform_device_add(simone_snd_device);
-	if (ret)
-		goto fail3;
+	return ret;
+}
+
+static int __devexit simone_remove(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+	snd_soc_unregister_card(card);
+	platform_device_unregister(simone_snd_ac97_device);
 
 	return 0;
+}
 
-fail3:
-	platform_device_put(simone_snd_device);
-fail2:
-	platform_device_del(simone_snd_ac97_device);
-fail1:
-	platform_device_put(simone_snd_ac97_device);
-	return ret;
+static struct platform_driver simone_driver = {
+	.driver		= {
+		.name	= "simone-audio",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= simone_probe,
+	.remove		= __devexit_p(simone_remove),
+};
+
+static int __init simone_init(void)
+{
+	return platform_driver_register(&simone_driver);
 }
 module_init(simone_init);
 
 static void __exit simone_exit(void)
 {
-	platform_device_unregister(simone_snd_device);
-	platform_device_unregister(simone_snd_ac97_device);
+	platform_driver_unregister(&simone_driver);
 }
 module_exit(simone_exit);
 
 MODULE_DESCRIPTION("ALSA SoC Simplemachines Sim.One");
 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:simone-audio");
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/7] ASoC: edb93xx: convert to use snd_soc_register_card()
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
  2011-09-11  9:28 ` [PATCH 1/7] ASoC: ep93xx-pcm: add MODULE_ALIAS Mika Westerberg
  2011-09-11  9:28 ` [PATCH 2/7] ASoC: simone: convert to use snd_soc_register_card() Mika Westerberg
@ 2011-09-11  9:28 ` Mika Westerberg
  2011-09-16 16:45   ` Alexander Sverdlin
  2011-09-11  9:28 ` [PATCH 4/7] ASoC: snappercl15: " Mika Westerberg
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, Alexander Sverdlin,
	lrg, linux-arm-kernel

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: Mika Westerberg <mika.westerberg@iki.fi>
Cc: Alexander Sverdlin <subaparts@yandex.ru>
---
 sound/soc/ep93xx/edb93xx.c |   60 ++++++++++++++++++++++++-------------------
 1 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/sound/soc/ep93xx/edb93xx.c b/sound/soc/ep93xx/edb93xx.c
index d3aa151..0134d4e 100644
--- a/sound/soc/ep93xx/edb93xx.c
+++ b/sound/soc/ep93xx/edb93xx.c
@@ -28,12 +28,6 @@
 #include <mach/hardware.h>
 #include "ep93xx-pcm.h"
 
-#define edb93xx_has_audio() (machine_is_edb9301() ||	\
-			     machine_is_edb9302() ||	\
-			     machine_is_edb9302a() ||	\
-			     machine_is_edb9307a() ||	\
-			     machine_is_edb9315a())
-
 static int edb93xx_hw_params(struct snd_pcm_substream *substream,
 			     struct snd_pcm_hw_params *params)
 {
@@ -94,49 +88,61 @@ static struct snd_soc_card snd_soc_edb93xx = {
 	.num_links	= 1,
 };
 
-static struct platform_device *edb93xx_snd_device;
-
-static int __init edb93xx_init(void)
+static int __devinit edb93xx_probe(struct platform_device *pdev)
 {
+	struct snd_soc_card *card = &snd_soc_edb93xx;
 	int ret;
 
-	if (!edb93xx_has_audio())
-		return -ENODEV;
-
 	ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
 				 EP93XX_SYSCON_I2SCLKDIV_ORIDE |
 				 EP93XX_SYSCON_I2SCLKDIV_SPOL);
 	if (ret)
 		return ret;
 
-	edb93xx_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!edb93xx_snd_device) {
-		ret = -ENOMEM;
-		goto free_i2s;
+	card->dev = &pdev->dev;
+
+	ret = snd_soc_register_card(card);
+	if (ret) {
+		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+			ret);
+		ep93xx_i2s_release();
 	}
 
-	platform_set_drvdata(edb93xx_snd_device, &snd_soc_edb93xx);
-	ret = platform_device_add(edb93xx_snd_device);
-	if (ret)
-		goto device_put;
+	return ret;
+}
 
-	return 0;
+static int __devexit edb93xx_remove(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
 
-device_put:
-	platform_device_put(edb93xx_snd_device);
-free_i2s:
+	snd_soc_unregister_card(card);
 	ep93xx_i2s_release();
-	return ret;
+
+	return 0;
+}
+
+static struct platform_driver edb93xx_driver = {
+	.driver		= {
+		.name	= "edb93xx-audio",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= edb93xx_probe,
+	.remove		= __devexit_p(edb93xx_remove),
+};
+
+static int __init edb93xx_init(void)
+{
+	return platform_driver_register(&edb93xx_driver);
 }
 module_init(edb93xx_init);
 
 static void __exit edb93xx_exit(void)
 {
-	platform_device_unregister(edb93xx_snd_device);
-	ep93xx_i2s_release();
+	platform_driver_unregister(&edb93xx_driver);
 }
 module_exit(edb93xx_exit);
 
 MODULE_AUTHOR("Alexander Sverdlin <subaparts@yandex.ru>");
 MODULE_DESCRIPTION("ALSA SoC EDB93xx");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:edb93xx-audio");
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/7] ASoC: snappercl15: convert to use snd_soc_register_card()
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
                   ` (2 preceding siblings ...)
  2011-09-11  9:28 ` [PATCH 3/7] ASoC: edb93xx: " Mika Westerberg
@ 2011-09-11  9:28 ` Mika Westerberg
  2011-09-11  9:28 ` [PATCH 5/7] ARM: ep93xx: simone: register audio platform device Mika Westerberg
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, lrg,
	linux-arm-kernel

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: Mika Westerberg <mika.westerberg@iki.fi>
---
 sound/soc/ep93xx/snappercl15.c |   53 +++++++++++++++++++++++++++-------------
 1 files changed, 36 insertions(+), 17 deletions(-)

diff --git a/sound/soc/ep93xx/snappercl15.c b/sound/soc/ep93xx/snappercl15.c
index c8aa8a5..f74ac54 100644
--- a/sound/soc/ep93xx/snappercl15.c
+++ b/sound/soc/ep93xx/snappercl15.c
@@ -104,37 +104,56 @@ static struct snd_soc_card snd_soc_snappercl15 = {
 	.num_links	= 1,
 };
 
-static struct platform_device *snappercl15_snd_device;
-
-static int __init snappercl15_init(void)
+static int __devinit snappercl15_probe(struct platform_device *pdev)
 {
+	struct snd_soc_card *card = &snd_soc_snappercl15;
 	int ret;
 
-	if (!machine_is_snapper_cl15())
-		return -ENODEV;
-
 	ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
 				 EP93XX_SYSCON_I2SCLKDIV_ORIDE |
 				 EP93XX_SYSCON_I2SCLKDIV_SPOL);
 	if (ret)
 		return ret;
 
-	snappercl15_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!snappercl15_snd_device)
-		return -ENOMEM;
-	
-	platform_set_drvdata(snappercl15_snd_device, &snd_soc_snappercl15);
-	ret = platform_device_add(snappercl15_snd_device);
-	if (ret)
-		platform_device_put(snappercl15_snd_device);
+	card->dev = &pdev->dev;
+
+	ret = snd_soc_register_card(card);
+	if (ret) {
+		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
+			ret);
+		ep93xx_i2s_release();
+	}
 
 	return ret;
 }
 
-static void __exit snappercl15_exit(void)
+static int __devexit snappercl15_remove(struct platform_device *pdev)
 {
-	platform_device_unregister(snappercl15_snd_device);
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+	snd_soc_unregister_card(card);
 	ep93xx_i2s_release();
+
+	return 0;
+}
+
+static struct platform_driver snappercl15_driver = {
+	.driver		= {
+		.name	= "snappercl15-audio",
+		.owner	= THIS_MODULE,
+	},
+	.probe		= snappercl15_probe,
+	.remove		= __devexit_p(snappercl15_remove),
+};
+
+static int __init snappercl15_init(void)
+{
+	return platform_driver_register(&snappercl15_driver);
+}
+
+static void __exit snappercl15_exit(void)
+{
+	platform_driver_unregister(&snappercl15_driver);
 }
 
 module_init(snappercl15_init);
@@ -143,4 +162,4 @@ module_exit(snappercl15_exit);
 MODULE_AUTHOR("Ryan Mallon");
 MODULE_DESCRIPTION("ALSA SoC Snapper CL15");
 MODULE_LICENSE("GPL");
-
+MODULE_ALIAS("platform:snappercl15-audio");
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/7] ARM: ep93xx: simone: register audio platform device
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
                   ` (3 preceding siblings ...)
  2011-09-11  9:28 ` [PATCH 4/7] ASoC: snappercl15: " Mika Westerberg
@ 2011-09-11  9:28 ` Mika Westerberg
  2011-09-11  9:28 ` [PATCH 6/7] ARM: ep93xx: edb93xx: " Mika Westerberg
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, lrg,
	linux-arm-kernel

Since the ASoC machine driver is now a platform driver we need to register
a matching platform device.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
---
 arch/arm/mach-ep93xx/simone.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c
index 8392e95..1445ce5 100644
--- a/arch/arm/mach-ep93xx/simone.c
+++ b/arch/arm/mach-ep93xx/simone.c
@@ -53,6 +53,17 @@ static struct i2c_board_info __initdata simone_i2c_board_info[] = {
 	},
 };
 
+static struct platform_device simone_audio_device = {
+	.name		= "simone-audio",
+	.id		= -1,
+};
+
+static void __init simone_register_audio(void)
+{
+	ep93xx_register_ac97();
+	platform_device_register(&simone_audio_device);
+}
+
 static void __init simone_init_machine(void)
 {
 	ep93xx_init_devices();
@@ -61,7 +72,7 @@ static void __init simone_init_machine(void)
 	ep93xx_register_fb(&simone_fb_info);
 	ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info,
 			    ARRAY_SIZE(simone_i2c_board_info));
-	ep93xx_register_ac97();
+	simone_register_audio();
 }
 
 MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/7] ARM: ep93xx: edb93xx: register audio platform device
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
                   ` (4 preceding siblings ...)
  2011-09-11  9:28 ` [PATCH 5/7] ARM: ep93xx: simone: register audio platform device Mika Westerberg
@ 2011-09-11  9:28 ` Mika Westerberg
  2011-09-11  9:28 ` [PATCH 7/7] ARM: ep93xx: snappercl15: " Mika Westerberg
  2011-09-11 23:15 ` [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Ryan Mallon
  7 siblings, 0 replies; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, Alexander Sverdlin,
	lrg, linux-arm-kernel

Since the ASoC machine driver is now a platform driver we need to register a
matching platform device.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Cc: Alexander Sverdlin <subaparts@yandex.ru>
---
 arch/arm/mach-ep93xx/edb93xx.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 9969bb1..8dc51e4 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -159,6 +159,11 @@ static void __init edb93xx_register_spi(void)
 /*************************************************************************
  * EDB93xx I2S
  *************************************************************************/
+static struct platform_device edb93xx_audio_device = {
+	.name		= "edb93xx-audio",
+	.id		= -1,
+};
+
 static int __init edb93xx_has_audio(void)
 {
 	return (machine_is_edb9301() || machine_is_edb9302() ||
@@ -170,6 +175,7 @@ static void __init edb93xx_register_i2s(void)
 {
 	if (edb93xx_has_audio()) {
 		ep93xx_register_i2s();
+		platform_device_register(&edb93xx_audio_device);
 	}
 }
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 7/7] ARM: ep93xx: snappercl15: register audio platform device
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
                   ` (5 preceding siblings ...)
  2011-09-11  9:28 ` [PATCH 6/7] ARM: ep93xx: edb93xx: " Mika Westerberg
@ 2011-09-11  9:28 ` Mika Westerberg
  2011-09-11 23:15 ` [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Ryan Mallon
  7 siblings, 0 replies; 20+ messages in thread
From: Mika Westerberg @ 2011-09-11  9:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: rmallon, Mika Westerberg, broonie, hsweeten, lrg,
	linux-arm-kernel

Since the ASoC machine driver is now a platform driver we need to register a
matching platform device.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
---
 arch/arm/mach-ep93xx/snappercl15.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c
index 2e9c614..edd75e3 100644
--- a/arch/arm/mach-ep93xx/snappercl15.c
+++ b/arch/arm/mach-ep93xx/snappercl15.c
@@ -150,6 +150,17 @@ static struct ep93xxfb_mach_info __initdata snappercl15_fb_info = {
 	.bpp			= 16,
 };
 
+static struct platform_device snappercl15_audio_device = {
+	.name		= "snappercl15-audio",
+	.id		= -1,
+};
+
+static void __init snappercl15_register_audio(void)
+{
+	ep93xx_register_i2s();
+	platform_device_register(&snappercl15_audio_device);
+}
+
 static void __init snappercl15_init_machine(void)
 {
 	ep93xx_init_devices();
@@ -157,7 +168,7 @@ static void __init snappercl15_init_machine(void)
 	ep93xx_register_i2c(&snappercl15_i2c_gpio_data, snappercl15_i2c_data,
 			    ARRAY_SIZE(snappercl15_i2c_data));
 	ep93xx_register_fb(&snappercl15_fb_info);
-	ep93xx_register_i2s();
+	snappercl15_register_audio();
 	platform_device_register(&snappercl15_nand_device);
 }
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
  2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
                   ` (6 preceding siblings ...)
  2011-09-11  9:28 ` [PATCH 7/7] ARM: ep93xx: snappercl15: " Mika Westerberg
@ 2011-09-11 23:15 ` Ryan Mallon
  2011-09-12  4:55   ` Girdwood, Liam
  7 siblings, 1 reply; 20+ messages in thread
From: Ryan Mallon @ 2011-09-11 23:15 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: hsweeten, alsa-devel, broonie, lrg, linux-arm-kernel

On 11/09/11 19:28, Mika Westerberg wrote:

> Here is a series of patches which convert ep93xx ASoC drivers to use
> snd_soc_register_card(). This has the advantage that the machine drivers get
> loaded automatically by udev. Also this gets rid of machine_is_xxx() from the
> machine drivers.
> 
> Tested on Sim.One. The edb93xx and snappercl15 changes are compile tested
> only.


Thanks for doing this. Unfortunately I don't have any hardware to test
any more, but the code looks correct to me.

Whole series:
Reviewed-by: Ryan Mallon <rmallon@gmail.com>

> 
> Mika Westerberg (7):
>   ASoC: ep93xx-pcm: add MODULE_ALIAS
>   ASoC: simone: convert to use snd_soc_register_card()
>   ASoC: edb93xx: convert to use snd_soc_register_card()
>   ASoC: snappercl15: convert to use snd_soc_register_card()
>   ARM: ep93xx: simone: register audio platform device
>   ARM: ep93xx: edb93xx: register audio platform device
>   ARM: ep93xx: snappercl15: register audio platform device
> 
>  arch/arm/mach-ep93xx/edb93xx.c     |    6 +++
>  arch/arm/mach-ep93xx/simone.c      |   13 +++++++-
>  arch/arm/mach-ep93xx/snappercl15.c |   13 +++++++-
>  sound/soc/ep93xx/edb93xx.c         |   60 ++++++++++++++++++---------------
>  sound/soc/ep93xx/ep93xx-pcm.c      |    1 +
>  sound/soc/ep93xx/simone.c          |   64 ++++++++++++++++++++----------------
>  sound/soc/ep93xx/snappercl15.c     |   53 ++++++++++++++++++++---------
>  7 files changed, 136 insertions(+), 74 deletions(-)
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
  2011-09-11 23:15 ` [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Ryan Mallon
@ 2011-09-12  4:55   ` Girdwood, Liam
  2011-09-12 10:19     ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Girdwood, Liam @ 2011-09-12  4:55 UTC (permalink / raw)
  To: Ryan Mallon
  Cc: hsweeten, Mika Westerberg, broonie, alsa-devel, linux-arm-kernel

On 12 September 2011 00:15, Ryan Mallon <rmallon@gmail.com> wrote:

> On 11/09/11 19:28, Mika Westerberg wrote:
>
> > Here is a series of patches which convert ep93xx ASoC drivers to use
> > snd_soc_register_card(). This has the advantage that the machine drivers
> get
> > loaded automatically by udev. Also this gets rid of machine_is_xxx() from
> the
> > machine drivers.
> >
> > Tested on Sim.One. The edb93xx and snappercl15 changes are compile tested
> > only.
>
>
> Thanks for doing this. Unfortunately I don't have any hardware to test
> any more, but the code looks correct to me.
>
> Whole series:
> Reviewed-by: Ryan Mallon <rmallon@gmail.com>
>
> >
> > Mika Westerberg (7):
> >   ASoC: ep93xx-pcm: add MODULE_ALIAS
> >   ASoC: simone: convert to use snd_soc_register_card()
> >   ASoC: edb93xx: convert to use snd_soc_register_card()
> >   ASoC: snappercl15: convert to use snd_soc_register_card()
> >   ARM: ep93xx: simone: register audio platform device
> >   ARM: ep93xx: edb93xx: register audio platform device
> >   ARM: ep93xx: snappercl15: register audio platform device
> >
> >  arch/arm/mach-ep93xx/edb93xx.c     |    6 +++
> >  arch/arm/mach-ep93xx/simone.c      |   13 +++++++-
> >  arch/arm/mach-ep93xx/snappercl15.c |   13 +++++++-
> >  sound/soc/ep93xx/edb93xx.c         |   60
> ++++++++++++++++++---------------
> >  sound/soc/ep93xx/ep93xx-pcm.c      |    1 +
> >  sound/soc/ep93xx/simone.c          |   64
> ++++++++++++++++++++----------------
> >  sound/soc/ep93xx/snappercl15.c     |   53 ++++++++++++++++++++---------
> >  7 files changed, 136 insertions(+), 74 deletions(-)
> >
>
>
>
ASoC parts

Acked-by: Liam Girdwood <lrg@ti.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
  2011-09-12  4:55   ` Girdwood, Liam
@ 2011-09-12 10:19     ` Mark Brown
  2011-09-12 15:59       ` Mika Westerberg
  0 siblings, 1 reply; 20+ messages in thread
From: Mark Brown @ 2011-09-12 10:19 UTC (permalink / raw)
  To: Girdwood, Liam
  Cc: linux-arm-kernel, hsweeten, Mika Westerberg, Ryan Mallon,
	alsa-devel

On Mon, Sep 12, 2011 at 05:55:49AM +0100, Girdwood, Liam wrote:

> ASoC parts

> Acked-by: Liam Girdwood <lrg@ti.com>

I'm happy with them too - they should probably all go in together,
do folks want me to apply them to ASoC or should we merge via the ARM
tree?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
  2011-09-12 10:19     ` Mark Brown
@ 2011-09-12 15:59       ` Mika Westerberg
  2011-09-12 20:33         ` H Hartley Sweeten
  0 siblings, 1 reply; 20+ messages in thread
From: Mika Westerberg @ 2011-09-12 15:59 UTC (permalink / raw)
  To: Mark Brown
  Cc: hsweeten, alsa-devel, Girdwood, Liam, linux-arm-kernel,
	Ryan Mallon

On Mon, Sep 12, 2011 at 11:19:39AM +0100, Mark Brown wrote:
> On Mon, Sep 12, 2011 at 05:55:49AM +0100, Girdwood, Liam wrote:
> 
> > ASoC parts
> 
> > Acked-by: Liam Girdwood <lrg@ti.com>
> 
> I'm happy with them too - they should probably all go in together,
> do folks want me to apply them to ASoC or should we merge via the ARM
> tree?

I'm kind of hoping that Hartley would (N)ACK the mach-ep93xx parts so that
they could be merged via ASoC tree.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
  2011-09-12 15:59       ` Mika Westerberg
@ 2011-09-12 20:33         ` H Hartley Sweeten
  2011-09-13 17:44           ` Mika Westerberg
  0 siblings, 1 reply; 20+ messages in thread
From: H Hartley Sweeten @ 2011-09-12 20:33 UTC (permalink / raw)
  To: Mika Westerberg, Mark Brown
  Cc: alsa-devel@alsa-project.org, Girdwood, Liam,
	linux-arm-kernel@lists.infradead.org, Ryan Mallon

On Monday, September 12, 2011 8:59 AM, Mika Westerberg wrote:
> On Mon, Sep 12, 2011 at 11:19:39AM +0100, Mark Brown wrote:
>> On Mon, Sep 12, 2011 at 05:55:49AM +0100, Girdwood, Liam wrote:
>>
>>> ASoC parts
>>
>>> Acked-by: Liam Girdwood <lrg@ti.com>
>>
>> I'm happy with them too - they should probably all go in together,
>> do folks want me to apply them to ASoC or should we merge via the ARM
>> tree?
>
> I'm kind of hoping that Hartley would (N)ACK the mach-ep93xx parts so that
> they could be merged via ASoC tree.

Mika,

I'm on vacation this week and did not get a chance to review your patches. I did take
a quick glance at them and didn't see any issues.

I think Ryan Mallon looked them over and gave you a Reviewed-by signoff.  Go with
that one for now.  I'll look the patches over next week and if they have not been merged
into linux-next by then I'll give you the appropriate sign-off or additional comments.

Thanks for doing this!

Regards,
Hartley

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
  2011-09-12 20:33         ` H Hartley Sweeten
@ 2011-09-13 17:44           ` Mika Westerberg
  2011-09-16  9:12             ` Mark Brown
  0 siblings, 1 reply; 20+ messages in thread
From: Mika Westerberg @ 2011-09-13 17:44 UTC (permalink / raw)
  To: H Hartley Sweeten
  Cc: alsa-devel@alsa-project.org, Mark Brown, Girdwood, Liam,
	linux-arm-kernel@lists.infradead.org, Ryan Mallon

On Mon, Sep 12, 2011 at 03:33:46PM -0500, H Hartley Sweeten wrote:
> 
> I'm on vacation this week and did not get a chance to review your patches. I did take
> a quick glance at them and didn't see any issues.

There is no hurry with these patches. Enjoy your vacation and check them
when you come back and have time, unless they are already merged.

> I think Ryan Mallon looked them over and gave you a Reviewed-by signoff.  Go with
> that one for now.  I'll look the patches over next week and if they have not been merged
> into linux-next by then I'll give you the appropriate sign-off or additional comments.

If Mark is ok with these and Reviewed-by from Ryan is enough then I guess
these can be merged in the ASoC tree now. On the other hand if formal acks
from ep93xx maintainers are needed, then these can wait until you come back
from your vacation.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card()
  2011-09-13 17:44           ` Mika Westerberg
@ 2011-09-16  9:12             ` Mark Brown
  0 siblings, 0 replies; 20+ messages in thread
From: Mark Brown @ 2011-09-16  9:12 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: linux-arm-kernel@lists.infradead.org, H Hartley Sweeten,
	Girdwood, Liam, alsa-devel@alsa-project.org, Ryan Mallon

On Tue, Sep 13, 2011 at 08:44:31PM +0300, Mika Westerberg wrote:

> If Mark is ok with these and Reviewed-by from Ryan is enough then I guess
> these can be merged in the ASoC tree now. On the other hand if formal acks
> from ep93xx maintainers are needed, then these can wait until you come back
> from your vacation.

I've applied them all, thanks.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: edb93xx: convert to use snd_soc_register_card()
  2011-09-11  9:28 ` [PATCH 3/7] ASoC: edb93xx: " Mika Westerberg
@ 2011-09-16 16:45   ` Alexander Sverdlin
  2011-09-17  6:52     ` Mika Westerberg
  0 siblings, 1 reply; 20+ messages in thread
From: Alexander Sverdlin @ 2011-09-16 16:45 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: alsa-devel, rmallon, broonie, hsweeten, lrg, linux-arm-kernel

Hello, Mika!

Have you tried the driver on reference boards?
For me it doesn't work any more. Boot messages are ok, as before, but
alsa open produces such messages:
Jan  1 00:32:19 IPCUn user.err kernel: asoc: can't open platform
ep93xx-pcm-audio

and fails.
I'll try to investigate further...

On Sun, 2011-09-11 at 12:28 +0300, Mika Westerberg 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.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
> Cc: Alexander Sverdlin <subaparts@yandex.ru>
> ---
>  sound/soc/ep93xx/edb93xx.c |   60 ++++++++++++++++++++++++-------------------
>  1 files changed, 33 insertions(+), 27 deletions(-)
> 
> diff --git a/sound/soc/ep93xx/edb93xx.c b/sound/soc/ep93xx/edb93xx.c
> index d3aa151..0134d4e 100644
> --- a/sound/soc/ep93xx/edb93xx.c
> +++ b/sound/soc/ep93xx/edb93xx.c
> @@ -28,12 +28,6 @@
>  #include <mach/hardware.h>
>  #include "ep93xx-pcm.h"
>  
> -#define edb93xx_has_audio() (machine_is_edb9301() ||	\
> -			     machine_is_edb9302() ||	\
> -			     machine_is_edb9302a() ||	\
> -			     machine_is_edb9307a() ||	\
> -			     machine_is_edb9315a())
> -
>  static int edb93xx_hw_params(struct snd_pcm_substream *substream,
>  			     struct snd_pcm_hw_params *params)
>  {
> @@ -94,49 +88,61 @@ static struct snd_soc_card snd_soc_edb93xx = {
>  	.num_links	= 1,
>  };
>  
> -static struct platform_device *edb93xx_snd_device;
> -
> -static int __init edb93xx_init(void)
> +static int __devinit edb93xx_probe(struct platform_device *pdev)
>  {
> +	struct snd_soc_card *card = &snd_soc_edb93xx;
>  	int ret;
>  
> -	if (!edb93xx_has_audio())
> -		return -ENODEV;
> -
>  	ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
>  				 EP93XX_SYSCON_I2SCLKDIV_ORIDE |
>  				 EP93XX_SYSCON_I2SCLKDIV_SPOL);
>  	if (ret)
>  		return ret;
>  
> -	edb93xx_snd_device = platform_device_alloc("soc-audio", -1);
> -	if (!edb93xx_snd_device) {
> -		ret = -ENOMEM;
> -		goto free_i2s;
> +	card->dev = &pdev->dev;
> +
> +	ret = snd_soc_register_card(card);
> +	if (ret) {
> +		dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
> +			ret);
> +		ep93xx_i2s_release();
>  	}
>  
> -	platform_set_drvdata(edb93xx_snd_device, &snd_soc_edb93xx);
> -	ret = platform_device_add(edb93xx_snd_device);
> -	if (ret)
> -		goto device_put;
> +	return ret;
> +}
>  
> -	return 0;
> +static int __devexit edb93xx_remove(struct platform_device *pdev)
> +{
> +	struct snd_soc_card *card = platform_get_drvdata(pdev);
>  
> -device_put:
> -	platform_device_put(edb93xx_snd_device);
> -free_i2s:
> +	snd_soc_unregister_card(card);
>  	ep93xx_i2s_release();
> -	return ret;
> +
> +	return 0;
> +}
> +
> +static struct platform_driver edb93xx_driver = {
> +	.driver		= {
> +		.name	= "edb93xx-audio",
> +		.owner	= THIS_MODULE,
> +	},
> +	.probe		= edb93xx_probe,
> +	.remove		= __devexit_p(edb93xx_remove),
> +};
> +
> +static int __init edb93xx_init(void)
> +{
> +	return platform_driver_register(&edb93xx_driver);
>  }
>  module_init(edb93xx_init);
>  
>  static void __exit edb93xx_exit(void)
>  {
> -	platform_device_unregister(edb93xx_snd_device);
> -	ep93xx_i2s_release();
> +	platform_driver_unregister(&edb93xx_driver);
>  }
>  module_exit(edb93xx_exit);
>  
>  MODULE_AUTHOR("Alexander Sverdlin <subaparts@yandex.ru>");
>  MODULE_DESCRIPTION("ALSA SoC EDB93xx");
>  MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:edb93xx-audio");

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: edb93xx: convert to use snd_soc_register_card()
  2011-09-16 16:45   ` Alexander Sverdlin
@ 2011-09-17  6:52     ` Mika Westerberg
  2011-09-17 11:58       ` Alexander Sverdlin
  0 siblings, 1 reply; 20+ messages in thread
From: Mika Westerberg @ 2011-09-17  6:52 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: alsa-devel, rmallon, broonie, hsweeten, lrg, linux-arm-kernel

On Fri, Sep 16, 2011 at 06:45:55PM +0200, Alexander Sverdlin wrote:
> 
> Have you tried the driver on reference boards?

No - I don't have any of those.

> For me it doesn't work any more. Boot messages are ok, as before, but
> alsa open produces such messages:
> Jan  1 00:32:19 IPCUn user.err kernel: asoc: can't open platform
> ep93xx-pcm-audio

Do you have the first patch ("ASoC: ep93xx-pcm: add MODULE_ALIAS") in this
series applied? Have you tried whether it still works if you compile
everything in?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: edb93xx: convert to use snd_soc_register_card()
  2011-09-17  6:52     ` Mika Westerberg
@ 2011-09-17 11:58       ` Alexander Sverdlin
  2011-09-18  7:38         ` Mika Westerberg
  0 siblings, 1 reply; 20+ messages in thread
From: Alexander Sverdlin @ 2011-09-17 11:58 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: alsa-devel, rmallon, broonie, hsweeten, lrg, linux-arm-kernel

Hello!

I've checked mainline linux-next without your patches, it's broken too.
So your patches are not the root cause for that.

On Sat, 2011-09-17 at 09:52 +0300, Mika Westerberg wrote:
> On Fri, Sep 16, 2011 at 06:45:55PM +0200, Alexander Sverdlin wrote:
> > 
> > Have you tried the driver on reference boards?
> 
> No - I don't have any of those.
> 
> > For me it doesn't work any more. Boot messages are ok, as before, but
> > alsa open produces such messages:
> > Jan  1 00:32:19 IPCUn user.err kernel: asoc: can't open platform
> > ep93xx-pcm-audio
> 
> Do you have the first patch ("ASoC: ep93xx-pcm: add MODULE_ALIAS") in this
> series applied? Have you tried whether it still works if you compile
> everything in?
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: edb93xx: convert to use snd_soc_register_card()
  2011-09-17 11:58       ` Alexander Sverdlin
@ 2011-09-18  7:38         ` Mika Westerberg
  2011-09-18 11:43           ` Alexander Sverdlin
  0 siblings, 1 reply; 20+ messages in thread
From: Mika Westerberg @ 2011-09-18  7:38 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: alsa-devel, rmallon, broonie, hsweeten, lrg, linux-arm-kernel

On Sat, Sep 17, 2011 at 01:58:20PM +0200, Alexander Sverdlin wrote:
> 
> I've checked mainline linux-next without your patches, it's broken too.
> So your patches are not the root cause for that.

Ok thanks.

Still it would be good to find out which causes it to fail. Are you able to
load all the modules manually? Does it work then?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 3/7] ASoC: edb93xx: convert to use snd_soc_register_card()
  2011-09-18  7:38         ` Mika Westerberg
@ 2011-09-18 11:43           ` Alexander Sverdlin
  0 siblings, 0 replies; 20+ messages in thread
From: Alexander Sverdlin @ 2011-09-18 11:43 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: alsa-devel, rmallon, broonie, hsweeten, lrg, linux-arm-kernel

Hello!

On Sun, 2011-09-18 at 10:38 +0300, Mika Westerberg wrote:
> On Sat, Sep 17, 2011 at 01:58:20PM +0200, Alexander Sverdlin wrote:
> > 
> > I've checked mainline linux-next without your patches, it's broken too.
> > So your patches are not the root cause for that.
> 
> Ok thanks.
> 
> Still it would be good to find out which causes it to fail. Are you able to
> load all the modules manually? Does it work then?
> 

I've limited access to hardware at the moment, so I'll find out that,
but it will not be so fast )

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-09-18 11:43 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-11  9:28 [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Mika Westerberg
2011-09-11  9:28 ` [PATCH 1/7] ASoC: ep93xx-pcm: add MODULE_ALIAS Mika Westerberg
2011-09-11  9:28 ` [PATCH 2/7] ASoC: simone: convert to use snd_soc_register_card() Mika Westerberg
2011-09-11  9:28 ` [PATCH 3/7] ASoC: edb93xx: " Mika Westerberg
2011-09-16 16:45   ` Alexander Sverdlin
2011-09-17  6:52     ` Mika Westerberg
2011-09-17 11:58       ` Alexander Sverdlin
2011-09-18  7:38         ` Mika Westerberg
2011-09-18 11:43           ` Alexander Sverdlin
2011-09-11  9:28 ` [PATCH 4/7] ASoC: snappercl15: " Mika Westerberg
2011-09-11  9:28 ` [PATCH 5/7] ARM: ep93xx: simone: register audio platform device Mika Westerberg
2011-09-11  9:28 ` [PATCH 6/7] ARM: ep93xx: edb93xx: " Mika Westerberg
2011-09-11  9:28 ` [PATCH 7/7] ARM: ep93xx: snappercl15: " Mika Westerberg
2011-09-11 23:15 ` [PATCH 0/7] ASoC: ep93xx: convert to use snd_soc_register_card() Ryan Mallon
2011-09-12  4:55   ` Girdwood, Liam
2011-09-12 10:19     ` Mark Brown
2011-09-12 15:59       ` Mika Westerberg
2011-09-12 20:33         ` H Hartley Sweeten
2011-09-13 17:44           ` Mika Westerberg
2011-09-16  9:12             ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).