Skip to contentSkip to conversation

tlv320aic32x4: delay i2c access by 1 ms after hardware reset

RFC Superseded Peter Seiderer 2 participants 3 messages Feb 10, 2019 – Feb 11, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 tlv320aic32x4: delay i2c access by 1 ms after hardware reset

As stated in 'TLV320AIC3254 Application Reference Guide' ([1]):

3.2 Device Startup Lockout Times
After the TLV320AIC3254 initializes through hardware reset at power-up or software reset, the internal registers initialize to default values. This initialization takes place within 1ms after pulling the RESET signal high. During this initialization phase, no register-read or register-write operation should be performed on ADC or DAC coefficient buffers. Also, no block within the codec should be powered up during the initialization phase.

[1] http://www.ti.com/lit/an/slaa408a/slaa408a.pdf

---
Note: This came up after the electronic departement took a deeper look at the i2c-bus/vcc/reset pins with a logic analyzer and the documentation because of a vcc/reset timing problem (now fixed on custom board). Not 100% sure if the 1 ms is needed (as restricted to ADC/DAC coefficent and codec block power up).

---
 sound/soc/codecs/tlv320aic32x4.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/tlv320aic32x4.c +2 -0
index e1bfba62fc08..b3beb0ca87c3 100644
@@ -972,6 +972,8 @@ static int aic32x4_component_probe(struct snd_soc_component *component)
 		gpio_set_value(aic32x4->rstn_gpio, 1);
 	}
 
+	mdelay(1);
+
 	snd_soc_component_write(component, AIC32X4_RESET, 0x01);
 
 	if (aic32x4->setup)
Signature · 1 line
2.20.1
maintainer
#1 lore raw

sound/soc/codecs/tlv320aic32x4.c static int aic32x4_component_probe(struct snd_soc_component *component) · line 976

Quoted 6 lines · Peter Seiderer
sound/soc/codecs/tlv320aic32x4.c +2 -0
@@ -972,6 +972,8 @@ static int aic32x4_component_probe(struct snd_soc_component *component)
 		gpio_set_value(aic32x4->rstn_gpio, 1);
 	}
 
+	mdelay(1);
+

Perhaps only do this if we toggled the GPIO? If the device wasn't in reset then there's no need to wait.

#2 lore raw

Hello Mark,

Quoted 11 lines · Mark Brown

sound/soc/codecs/tlv320aic32x4.c static int aic32x4_component_probe(struct snd_soc_component *component) · line 976

Quoted 6 lines · Peter Seiderer
sound/soc/codecs/tlv320aic32x4.c +2 -0
@@ -972,6 +972,8 @@ static int aic32x4_component_probe(struct snd_soc_component *component)
 		gpio_set_value(aic32x4->rstn_gpio, 1);
 	}
 
+	mdelay(1);
+  

Perhaps only do this if we toggled the GPIO? If the device wasn't in reset then there's no need to wait.

You are absolutely right with this, will re-spin the patch with the suggested change, thanks for review...

Regards,
Peter