ASoC: sgtl5000: Make device cache only when powered off
Subsystems (3)
PATCH 1/1 ASoC: sgtl5000: Make device cache only when powered off
When the regulators have been disabled mark the device as cache only so that we don't try to interact with the hardware.
--- sound/soc/codecs/sgtl5000.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
sound/soc/codecs/sgtl5000.c +15 -0
@@ -911,10 +911,25 @@ static int sgtl5000_set_bias_level(struct snd_soc_codec *codec,if (ret)return ret;udelay (10 ); + +regcache_cache_only (sgtl5000->regmap, false); + + ret =regcache_sync (sgtl5000->regmap); +if (ret !=0 ) { +dev_err (codec->dev, +"Failed to restore cache: %d\n" , ret); + +regcache_cache_only (sgtl5000->regmap, true); +regulator_bulk_disable (ARRAY_SIZE (sgtl5000->supplies), + sgtl5000->supplies); + +return ret; + } }break ;case SND_SOC_BIAS_OFF : +regcache_cache_only (sgtl5000->regmap, true);regulator_bulk_disable (ARRAY_SIZE (sgtl5000->supplies), sgtl5000->supplies);break ;
Signature · 1 line
1.7.10.4
Fabio Estevam
maintainerHi Mark,
Quoted 4 lines · Mark Brown
When the regulators have been disabled mark the device as cache only so that we don't try to interact with the hardware.
Signed-off-by Mark Brown <[email protected]>
I tried to test your patch, but noticed that even without your patch sgtl5000 fails to probe in linux-next 20130605.
It fails when doing a regmap_read of the sgtl5000 ID register.
I will debug this, but in case you have any ideas about recent regmap changes that could lead to this, please let me know.
Regards,
Fabio Estevam
Mark Brown
maintainerQuoted 7 lines · Fabio Estevam
Quoted 4 lines · Mark Brown
When the regulators have been disabled mark the device as cache only so that we don't try to interact with the hardware.
Signed-off-by Mark Brown <[email protected]>
Quoted 7 lines
I tried to test your patch, but noticed that even without your patch sgtl5000 fails to probe in linux-next 20130605.
It fails when doing a
regmap_readof the sgtl5000 ID register.I will debug this, but in case you have any ideas about recent regmap changes that could lead to this, please let me know.
Isn't that the thing with not powering on the regulators before doing the ID read? There was some discussion about that earlier.
Fabio Estevam
maintainerQuoted 2 lines · Mark Brown
Isn't that the thing with not powering on the regulators before doing the ID read? There was some discussion about that earlier.
No, the board I am using has the sgtl5000 voltages always applied.
Will try to bisect it.
Thanks,
Fabio Estevam
Fabio Estevam
maintainerHi Mark,
Quoted 10 lines · Fabio Estevam
Hi Mark,
Quoted 4 lines · Mark Brown
When the regulators have been disabled mark the device as cache only so that we don't try to interact with the hardware.
Signed-off-by Mark Brown <[email protected]>I tried to test your patch, but noticed that even without your patch sgtl5000 fails to probe in linux-next 20130605.
Thanks, I managed to test your patch now and it works fine. I needed to turn on the codec clock sooner in the arch/arm/mach-imx/mach-imx6q.c.
Regards,
Fabio Estevam