[alsa-devel] [PATCH] 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.
Signed-off-by: Mark Brown broonie@linaro.org --- sound/soc/codecs/sgtl5000.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 1c3b20f..85a32e6 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -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;
Hi Mark,
On Mon, Jun 3, 2013 at 6:22 AM, Mark Brown broonie@linaro.org wrote:
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 broonie@linaro.org
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
On Wed, Jun 05, 2013 at 08:04:10PM -0300, Fabio Estevam wrote:
On Mon, Jun 3, 2013 at 6:22 AM, Mark Brown broonie@linaro.org wrote:
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 broonie@linaro.org
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.
Isn't that the thing with not powering on the regulators before doing the ID read? There was some discussion about that earlier.
On Wed, Jun 5, 2013 at 8:23 PM, Mark Brown broonie@kernel.org wrote:
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
Hi Mark,
On Wed, Jun 5, 2013 at 8:04 PM, Fabio Estevam festevam@gmail.com wrote:
Hi Mark,
On Mon, Jun 3, 2013 at 6:22 AM, Mark Brown broonie@linaro.org wrote:
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 broonie@linaro.org
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
participants (3)
-
Fabio Estevam
-
Mark Brown
-
Mark Brown