-----Original Message----- From: Mark Brown [mailto:broonie@kernel.org] Sent: Monday, June 03, 2013 11:36 PM To: Bard Liao Cc: lgirdwood@gmail.com; alsa-devel@alsa-project.org; Flove; Oder Chiou; swarren@nvidia.com; swarren@wwwdotorg.org Subject: Re: [PATCH] ASoC: add RT5640 CODEC driver
- case SND_SOC_BIAS_STANDBY:
if (SND_SOC_BIAS_OFF == codec->dapm.bias_level) {
snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
RT5640_PWR_VREF1 | RT5640_PWR_MB |
RT5640_PWR_BG | RT5640_PWR_VREF2,
RT5640_PWR_VREF1 | RT5640_PWR_MB |
RT5640_PWR_BG | RT5640_PWR_VREF2);
mdelay(10);
snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
RT5640_PWR_FV1 | RT5640_PWR_FV2,
RT5640_PWR_FV1 | RT5640_PWR_FV2);
regcache_cache_only(rt5640->regmap, false);
regcache_sync(rt5640->regmap);
This looks wrong - you're writing to the device before you take it out of cache only mode so your delay in the above sequence will have no effect.
Actually, I don't know if I need to call "regcache_cache_only(rt5640->regmap, false);" here. We never call "regcache_cache_only(rt5640->regmap, true);" in the codec driver. I assume the cache_only flag is default false. If yes, I think I can remove "regcache_cache_only(rt5640->regmap, false);" from the code driver. If not, I will move it to the beginning of if (SND_SOC_BIAS_OFF == codec->dapm.bias_level) condition.
------Please consider the environment before printing this e-mail.