Skip to contentSkip to conversation

ASoC: Writing register default value for the reset register

PATCH Applied Axel Lin 3 participants 5 messages Oct 11, 2011

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: Writing register default value for the reset register

The WM8983 can be reset by performing a write of any value to the software reset register.
To avoid writing to the software reset register while resume, we should write the same value in wm8983_reg_defs to software reset register in wm8983_probe().
The write to the reset register is suppressed by the cache restore code when it skips writes of default registers.

---
 sound/soc/codecs/wm8983.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8983.c +1 -1
index 17f04ec..93ee284 100644
@@ -1007,7 +1007,7 @@ static int wm8983_probe(struct snd_soc_codec *codec)
 		return ret;
 	}
 
-	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
+	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);
 	if (ret < 0) {
 		dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
 		return ret;
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 18 lines · Axel Lin

The WM8983 can be reset by performing a write of any value to the software reset register.
To avoid writing to the software reset register while resume, we should write the same value in wm8983_reg_defs to software reset register in wm8983_probe().
The write to the reset register is suppressed by the cache restore code when it skips writes of default registers.

---
 sound/soc/codecs/wm8983.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/wm8983.c +0 -0
index 17f04ec..93ee284 100644

sound/soc/codecs/wm8983.c static int wm8983_probe(struct snd_soc_codec *codec) · line 1013

Quoted 8 lines
sound/soc/codecs/wm8983.c +1 -1
@@ -1007,7 +1007,7 @@ static int wm8983_probe(struct snd_soc_codec *codec)
 		return ret;
 	}
 
-	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
+	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);
 	if (ret < 0) {
 		dev_err(codec->dev, "Failed to issue reset: %d\n", ret);
 		return ret;

We should probably just handle the reset register specially during resume.

Thanks,
Dimitris

#2 lore raw
Quoted 9 lines · Dimitris Papastamos

sound/soc/codecs/wm8983.c static int wm8983_probe(struct snd_soc_codec *codec) · line 1010

Quoted 5 lines · Axel Lin

The WM8983 can be reset by performing a write of any value to the software reset register.

sound/soc/codecs/wm8983.c +1 -1
-	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
+	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);

We should probably just handle the reset register specially during resume.

I really don't think it's worth the code complexity to add special handling like that, this is a trivial patch which avoids the need for any extra infrastructure.

Applied
#4 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

The WM8983 can be reset by performing a write of any value to the software reset register.

Applied, thanks.

#3 lore raw
In reply to Mark Brown
Quoted 11 lines · Mark Brown
Quoted 9 lines · Dimitris Papastamos

sound/soc/codecs/wm8983.c static int wm8983_probe(struct snd_soc_codec *codec) · line 1010

Quoted 5 lines · Axel Lin

The WM8983 can be reset by performing a write of any value to the software reset register.

sound/soc/codecs/wm8983.c +1 -1
-	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0x8983);
+	ret = snd_soc_write(codec, WM8983_SOFTWARE_RESET, 0);

We should probably just handle the reset register specially during resume.

Quoted 3 lines

I really don't think it's worth the code complexity to add special handling like that, this is a trivial patch which avoids the need for any extra infrastructure.

Aw I thought this code was using the old style open coded syncing functions, which would be trivial and perhaps idiomatic to simply check for the reset register and continue.

Thanks,
Dimitris