Skip to contentSkip to conversation

ASoC: uda1380: Avoid accessing i2c bus when codec is disabled

PATCH Applied Vasily Khoruzhick 2 participants 2 messages May 3, 2015 – May 4, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: uda1380: Avoid accessing i2c bus when codec is disabled

set_dai_fmt_both() callback is called from snd_soc_runtime_set_dai_fmt() which is called from snd_soc_register_card(), but at this time codec is not powered on yet. Replace direct i2c write with regcache write.

---
 sound/soc/codecs/uda1380.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/uda1380.c +1 -1
index dc7778b..c3c33bd 100644
@@ -437,7 +437,7 @@ static int uda1380_set_dai_fmt_both(struct snd_soc_dai *codec_dai,
 	if ((fmt & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS)
 		return -EINVAL;
 
-	uda1380_write(codec, UDA1380_IFACE, iface);
+	uda1380_write_reg_cache(codec, UDA1380_IFACE, iface);
 
 	return 0;
 }
Signature · 1 line
2.3.5
maintainer Applied
#1 lore raw
Quoted 3 lines · Vasily Khoruzhick

set_dai_fmt_both() callback is called from snd_soc_runtime_set_dai_fmt() which is called from snd_soc_register_card(), but at this time codec is not powered on yet. Replace direct i2c write with regcache write.

Applied, thanks. Of course the most robust thing would be to convert to regmap and mark the device cache only when appropriate...