linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: ams-delta: fix card initalization failure
@ 2012-08-27 21:28 Janusz Krzysztofik
  2012-08-27 21:38 ` Mark Brown
  0 siblings, 1 reply; 15+ messages in thread
From: Janusz Krzysztofik @ 2012-08-27 21:28 UTC (permalink / raw)
  To: alsa-devel
  Cc: Janusz Krzysztofik, linux-omap, Mark Brown, Liam Girdwood,
	linux-kernel

Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d, 'device-core:
Ensure drvdata = NULL when no driver is bound', the Amstrad Delta sound
card no longer initializes correctly due to drvdata reset to NULL by an
upper layer before the codec device, required for successful card setup,
is registered. Fix this by moving the codec registration bits up, before
the card is probed for.

Created and tested against linux-3.6-rc3

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
---
 sound/soc/omap/ams-delta.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/sound/soc/omap/ams-delta.c b/sound/soc/omap/ams-delta.c
index 7d4fa8e..270de9c 100644
--- a/sound/soc/omap/ams-delta.c
+++ b/sound/soc/omap/ams-delta.c
@@ -590,20 +590,22 @@ static int __init ams_delta_module_init(void)
 	if (!ams_delta_audio_platform_device)
 		return -ENOMEM;
 
-	platform_set_drvdata(ams_delta_audio_platform_device,
-				&ams_delta_audio_card);
-
-	ret = platform_device_add(ams_delta_audio_platform_device);
-	if (ret)
-		goto err;
-
 	/*
 	 * Codec platform device could be registered from elsewhere (board?),
 	 * but I do it here as it makes sense only if used with the card.
+	 * Moreover, it must be registered before the card is probed for,
+	 * or the card setup fails due to drvdata reset by upper layers.
 	 */
 	cx20442_platform_device =
 		platform_device_register_simple("cx20442-codec", -1, NULL, 0);
-	return 0;
+
+	platform_set_drvdata(ams_delta_audio_platform_device,
+			     &ams_delta_audio_card);
+
+	ret = platform_device_add(ams_delta_audio_platform_device);
+	if (!ret)
+		return ret;
+
 err:
 	platform_device_put(ams_delta_audio_platform_device);
 	return ret;
-- 
1.7.3.4

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

end of thread, other threads:[~2012-10-04 17:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 21:28 [PATCH] ASoC: ams-delta: fix card initalization failure Janusz Krzysztofik
2012-08-27 21:38 ` Mark Brown
2012-08-28 15:13   ` Janusz Krzysztofik
2012-08-28 18:13     ` Mark Brown
2012-08-29  5:04       ` [alsa-devel] " Janusz Krzysztofik
2012-08-31 21:31         ` Mark Brown
2012-09-01  9:09           ` Janusz Krzysztofik
2012-09-06  7:36             ` [alsa-devel] " Mark Brown
2012-09-16 19:17               ` [PATCH] ASoC: ams-delta: Convert to use snd_soc_register_card() Janusz Krzysztofik
2012-09-16 20:44                 ` Tony Lindgren
2012-10-02 21:07                 ` Janusz Krzysztofik
2012-10-03 10:38                   ` Mark Brown
2012-10-03 10:46               ` [RESEND][PATCH] " Janusz Krzysztofik
2012-10-03 13:51                 ` Janusz Krzysztofik
2012-10-04 17:50                 ` 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).