2019-02-11 21:07:55

by Peter Seiderer

[permalink] [raw]
Subject: [RFC v2] 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

Signed-off-by: Peter Seiderer <[email protected]>
---
Changes v1 -> v2:
- call mdelay only in case the reset gpio was toggled (suggested
by Mark Brown)

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 | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index e1bfba62fc08..96f1526cb258 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -970,6 +970,7 @@ static int aic32x4_component_probe(struct snd_soc_component *component)
if (gpio_is_valid(aic32x4->rstn_gpio)) {
ndelay(10);
gpio_set_value(aic32x4->rstn_gpio, 1);
+ mdelay(1);
}

snd_soc_component_write(component, AIC32X4_RESET, 0x01);
--
2.20.1



2019-02-12 14:22:43

by Mark Brown

[permalink] [raw]
Subject: Applied "tlv320aic32x4: delay i2c access by 1 ms after hardware reset" to the asoc tree

The patch

tlv320aic32x4: delay i2c access by 1 ms after hardware reset

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 674f9abd094552dc297a2afd0cb72d30aec539a3 Mon Sep 17 00:00:00 2001
From: Peter Seiderer <[email protected]>
Date: Mon, 11 Feb 2019 22:06:30 +0100
Subject: [PATCH] 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

Signed-off-by: Peter Seiderer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
---
sound/soc/codecs/tlv320aic32x4.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index e1bfba62fc08..96f1526cb258 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -970,6 +970,7 @@ static int aic32x4_component_probe(struct snd_soc_component *component)
if (gpio_is_valid(aic32x4->rstn_gpio)) {
ndelay(10);
gpio_set_value(aic32x4->rstn_gpio, 1);
+ mdelay(1);
}

snd_soc_component_write(component, AIC32X4_RESET, 0x01);
--
2.20.1