alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: AC97 doesn't use regmap by default
@ 2012-07-31 12:42 Manuel Lauss
  2012-07-31 15:42 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Manuel Lauss @ 2012-07-31 12:42 UTC (permalink / raw)
  To: alsa-devel, Mark Brown; +Cc: Manuel Lauss

From: Manuel Lauss <manuel.lauss@googlemail.com>

Since commit 38cbf9598feba97de9f9b43efa9153fd7c1a2ec9
("ASoC: core: Try to use regmap if the driver doesn't set up any I/O")
any ASoC codec which doesn't set codec::control_data is assumed
to use regmap.  That doesn't work with AC97 so this workaround
sets the codec::control_data member to a random value to restore
proper behaviour.

Tested with WM9712.

Signed-off-by: Manuel Lauss <manuel.lauss@googlemail.com>
---
 sound/soc/codecs/ad1980.c   |    1 +
 sound/soc/codecs/stac9766.c |    1 +
 sound/soc/codecs/wm9712.c   |    1 +
 sound/soc/codecs/wm9713.c   |    1 +
 4 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 8c39ddd..11b1b71 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -186,6 +186,7 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
 
 	printk(KERN_INFO "AD1980 SoC Audio Codec\n");
 
+	codec->control_data = codec;	/* we don't use regmap! */
 	ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
 	if (ret < 0) {
 		printk(KERN_ERR "ad1980: failed to register AC97 codec\n");
diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c
index 982e437..33c0f3d 100644
--- a/sound/soc/codecs/stac9766.c
+++ b/sound/soc/codecs/stac9766.c
@@ -340,6 +340,7 @@ static int stac9766_codec_probe(struct snd_soc_codec *codec)
 
 	printk(KERN_INFO "STAC9766 SoC Audio Codec %s\n", STAC9766_VERSION);
 
+	codec->control_data = codec;	/* we don't use regmap! */
 	ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
 	if (ret < 0)
 		goto codec_err;
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 099e6ec..f16fb36 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -619,6 +619,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
 {
 	int ret = 0;
 
+	codec->control_data = codec;	/* we don't use regmap! */
 	ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
 	if (ret < 0) {
 		printk(KERN_ERR "wm9712: failed to register AC97 codec\n");
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 3eb19fb..d0b8a32 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1196,6 +1196,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
 	if (wm9713 == NULL)
 		return -ENOMEM;
 	snd_soc_codec_set_drvdata(codec, wm9713);
+	codec->control_data = wm9713;	/* we don't use regmap! */
 
 	ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
 	if (ret < 0)
-- 
1.7.8.6

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

* Re: [PATCH] ASoC: AC97 doesn't use regmap by default
  2012-07-31 12:42 [PATCH] ASoC: AC97 doesn't use regmap by default Manuel Lauss
@ 2012-07-31 15:42 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-07-31 15:42 UTC (permalink / raw)
  To: Manuel Lauss; +Cc: alsa-devel, Manuel Lauss

On Tue, Jul 31, 2012 at 02:42:27PM +0200, Manuel Lauss wrote:
> From: Manuel Lauss <manuel.lauss@googlemail.com>
> 
> Since commit 38cbf9598feba97de9f9b43efa9153fd7c1a2ec9
> ("ASoC: core: Try to use regmap if the driver doesn't set up any I/O")
> any ASoC codec which doesn't set codec::control_data is assumed
> to use regmap.  That doesn't work with AC97 so this workaround
> sets the codec::control_data member to a random value to restore
> proper behaviour.

Applied, thanks.

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

end of thread, other threads:[~2012-07-31 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31 12:42 [PATCH] ASoC: AC97 doesn't use regmap by default Manuel Lauss
2012-07-31 15:42 ` 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).