ASoC: sgtl5000: Fix suspend/resume
Subsystems (3)
Fabio Estevam
maintainerPATCH v2 1/1 ASoC: sgtl5000: Fix suspend/resume
From: Fabio Estevam <[email protected]>
Commit 8419caa72702 ("ASoC: sgtl5000: Do not disable regulators in SND_SOC_BIAS_OFF") causes the sgtl5000 to fail after a suspend/resume sequence:
# aplay /media/a2002011001-e02.wav Playing WAVE '/media/a2002011001-e02.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo aplay: pcm_write:2051: write error: Input/output error
The problem is caused by the fact that the aforementioned commit dropped the cache handling, so re-introduce the register map resync to fix the problem.
---
Changes since v1:
- Re-introduce cache handling (Mark).
Mark,
If this gets applied into next, then I can generate the fixes for the 4.9 and 4.14 stable versions later.
Thanks
sound/soc/codecs/sgtl5000.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
sound/soc/codecs/sgtl5000.c +11 -0
@@ -871,15 +871,26 @@ static int sgtl5000_pcm_hw_params(struct snd_pcm_substream *substream,static int sgtl5000_set_bias_level (struct snd_soc_component *component,enum snd_soc_bias_level level) { +struct sgtl5000_priv *sgtl =snd_soc_component_get_drvdata (component); +int ret; +switch (level) {case SND_SOC_BIAS_ON :case SND_SOC_BIAS_PREPARE :case SND_SOC_BIAS_STANDBY : +regcache_cache_only (sgtl->regmap, false); + ret =regcache_sync (sgtl->regmap); +if (ret) { +regcache_cache_only (sgtl->regmap, true); +return ret; + } +snd_soc_component_update_bits (component,SGTL5000_CHIP_ANA_POWER ,SGTL5000_REFTOP_POWERUP ,SGTL5000_REFTOP_POWERUP );break ;case SND_SOC_BIAS_OFF : +regcache_cache_only (sgtl->regmap, true);snd_soc_component_update_bits (component,SGTL5000_CHIP_ANA_POWER ,SGTL5000_REFTOP_POWERUP ,0 );break ;
Signature · 1 line
2.7.4
Mark Brown
maintainerQuoted 2 lines · Fabio Estevam
If this gets applied into next, then I can generate the fixes for the 4.9 and 4.14 stable versions later.
We should probably also send this to v4.16 - could you please rebase against Linus' tree and then I'll merge it up to -next?