[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240930-wip-bhahn-tlv320aic3x_fix_reset-v1-1-c040d86a4b93@phytec.de>
Date: Mon, 30 Sep 2024 09:16:46 +0200
From: Benjamin Hahn <B.Hahn@...tec.de>
To: Shenghao Ding <shenghao-ding@...com>, Kevin Lu <kevin-lu@...com>, Baojun
Xu <baojun.xu@...com>, Liam Girdwood <lgirdwood@...il.com>, Mark Brown
<broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai
<tiwai@...e.com>, Teresa Remmet <t.remmet@...tec.de>
CC: <alsa-devel@...a-project.org>, <linux-sound@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <upstream@...ts.phytec.de>, Benjamin Hahn
<B.Hahn@...tec.de>
Subject: [PATCH] sound: soc: codecs: tlv320aic3x: Fix codec gpio-reset
The TLV320AIC3007 requires a hardware reset after power-up for proper
operation. After all power supplies are at their specified values,
the RESET pin must be driven low for at least 10 ns. Even though the
datasheet sais min 10ns, I needed more than 10ns when testing this out.
15ns worked for me.
Signed-off-by: Benjamin Hahn <B.Hahn@...tec.de>
---
sound/soc/codecs/tlv320aic3x.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 56e795a00e22..d002fc0b99b5 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1367,8 +1367,11 @@ static int aic3x_regulator_event(struct notifier_block *nb,
* Put codec to reset and require cache sync as at least one
* of the supplies was disabled
*/
- if (aic3x->gpio_reset)
+ if (aic3x->gpio_reset) {
gpiod_set_value(aic3x->gpio_reset, 1);
+ ndelay(15);
+ gpiod_set_value(aic3x->gpio_reset, 0);
+ }
regcache_mark_dirty(aic3x->regmap);
}
@@ -1813,6 +1816,10 @@ int aic3x_probe(struct device *dev, struct regmap *regmap, kernel_ulong_t driver
gpiod_set_consumer_name(aic3x->gpio_reset, "tlv320aic3x reset");
+ /* CODEC datasheet says minimum of 10ns */
+ ndelay(15);
+ gpiod_set_value(aic3x->gpio_reset, 0);
+
for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++)
aic3x->supplies[i].supply = aic3x_supply_names[i];
---
base-commit: ad46e8f95e931e113cb98253daf6d443ac244cde
change-id: 20240930-wip-bhahn-tlv320aic3x_fix_reset-cca918a4889d
Best regards,
--
Benjamin Hahn <B.Hahn@...tec.de>
Powered by blists - more mailing lists