Commit d0e3cce9 authored by Manuel Lauss's avatar Manuel Lauss Committed by Mark Brown

ASoC: AC97 doesn't use regmap by default

Since commit 38cbf959
("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: default avatarManuel Lauss <manuel.lauss@googlemail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent eef69ac7
...@@ -186,6 +186,7 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec) ...@@ -186,6 +186,7 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
printk(KERN_INFO "AD1980 SoC Audio Codec\n"); 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); ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "ad1980: failed to register AC97 codec\n"); printk(KERN_ERR "ad1980: failed to register AC97 codec\n");
......
...@@ -340,6 +340,7 @@ static int stac9766_codec_probe(struct snd_soc_codec *codec) ...@@ -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); 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); ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0) if (ret < 0)
goto codec_err; goto codec_err;
......
...@@ -619,6 +619,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) ...@@ -619,6 +619,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
{ {
int ret = 0; int ret = 0;
codec->control_data = codec; /* we don't use regmap! */
ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0); ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "wm9712: failed to register AC97 codec\n"); printk(KERN_ERR "wm9712: failed to register AC97 codec\n");
......
...@@ -1196,6 +1196,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec) ...@@ -1196,6 +1196,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
if (wm9713 == NULL) if (wm9713 == NULL)
return -ENOMEM; return -ENOMEM;
snd_soc_codec_set_drvdata(codec, wm9713); 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); ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment