ASoC: Check for exact register match in wm97xx_reset()
Subsystems (3)
PATCH 1/2 ASoC: Check for exact register match in wm97xx_reset()
To provide added robustness in case an AC97 controller reads back all zeros in error cases check for an exact match when testing to see if resets have brought the codec back.
--- sound/soc/codecs/wm9712.c | 4 ++-- sound/soc/codecs/wm9713.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/wm9712.c +2 -2
@@ -589,12 +589,12 @@ static int wm9712_reset(struct snd_soc_codec *codec, int try_warm) {if (try_warm && soc_ac97_ops.warm_reset) { soc_ac97_ops.warm_reset (codec->ac97); -if (!(ac97_read (codec,0 ) &0x8000 )) +if (ac97_read (codec,0 ) == wm9712_reg[0 ])return 1 ; } soc_ac97_ops.reset (codec->ac97); -if (ac97_read (codec,0 ) &0x8000 ) +if (ac97_read (codec,0 ) != wm9712_reg[0 ]) goto err;return 0 ;
sound/soc/codecs/wm9713.c +2 -2
@@ -1076,12 +1076,12 @@ int wm9713_reset(struct snd_soc_codec *codec, int try_warm) {if (try_warm && soc_ac97_ops.warm_reset) { soc_ac97_ops.warm_reset (codec->ac97); -if (!(ac97_read (codec,0 ) &0x8000 )) +if (ac97_read (codec,0 ) == wm9713_reg[0 ])return 1 ; } soc_ac97_ops.reset (codec->ac97); -if (ac97_read (codec,0 ) &0x8000 ) +if (ac97_read (codec,0 ) != wm9713_reg[0 ])return -EIO ;return 0 ; }
Signature · 1 line
1.5.5.4
PATCH 2/2 ASoC: Don't block system resume
From: Andy Green <[email protected]>
On OpenMoko soc-audio resume is taking 700ms of the whole resume time of 1.3s, dominated by writes to the codec over I2C. This patch shunts the resume guts into a workqueue which then is done asynchronously.
The "card" is locked using the ALSA power state APIs as suggested by Mark Brown.
[Added fix for race with resume to suspend and fixed a couple of nits from checkpatch -- broonie.]
--- include/sound/soc.h | 1 + sound/soc/soc-core.c | 46 +++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-)
include/sound/soc.h +1 -0
@@ -510,6 +510,7 @@ struct snd_soc_device {struct snd_soc_codec *codec;struct snd_soc_codec_device *codec_dev;struct delayed_work delayed_work; +struct work_struct deferred_resume_work;void *codec_data; };
sound/soc/soc-core.c +43 -3
77 lines not on this page · raw message
Signature · 1 line
1.5.5.4
Takashi Iwai
AppliedAt Fri, 13 Jun 2008 16:24:04 +0100,
Quoted 6 lines · Mark Brown
To provide added robustness in case an AC97 controller reads back all zeros in error cases check for an exact match when testing to see if resets have brought the codec back.
Signed-off-by Mark Brown <[email protected]>
Thanks, applied now.
Takashi