mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: tas2770: Insert post reset delay
@ 2022-02-01 23:47 Martin Povišer
  2022-02-02 13:24 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Povišer @ 2022-02-01 23:47 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Pierre-Louis Bossart, Ye Bin, Frank Shi, alsa-devel,
	linux-kernel, Martin Povišer

Per TAS2770 datasheet there must be a 1 ms delay from reset to first
command. So insert delays into the driver where appropriate.

Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Martin Povišer <povik+lin@protonmail.com>
---
 sound/soc/codecs/tas2770.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c
index b52c0861edc8..b397a2122dd4 100644
--- a/sound/soc/codecs/tas2770.c
+++ b/sound/soc/codecs/tas2770.c
@@ -38,10 +38,12 @@ static void tas2770_reset(struct tas2770_priv *tas2770)
 		gpiod_set_value_cansleep(tas2770->reset_gpio, 0);
 		msleep(20);
 		gpiod_set_value_cansleep(tas2770->reset_gpio, 1);
+		usleep_range(1000, 2000);
 	}

 	snd_soc_component_write(tas2770->component, TAS2770_SW_RST,
 		TAS2770_RST);
+	usleep_range(1000, 2000);
 }

 static int tas2770_set_bias_level(struct snd_soc_component *component,
@@ -110,6 +112,7 @@ static int tas2770_codec_resume(struct snd_soc_component *component)

 	if (tas2770->sdz_gpio) {
 		gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
+		usleep_range(1000, 2000);
 	} else {
 		ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL,
 						    TAS2770_PWR_CTRL_MASK,
@@ -529,8 +532,10 @@ static int tas2770_codec_probe(struct snd_soc_component *component)

 	tas2770->component = component;

-	if (tas2770->sdz_gpio)
+	if (tas2770->sdz_gpio) {
 		gpiod_set_value_cansleep(tas2770->sdz_gpio, 1);
+		usleep_range(1000, 2000);
+	}

 	tas2770_reset(tas2770);

--
2.33.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: tas2770: Insert post reset delay
  2022-02-01 23:47 [PATCH] ASoC: tas2770: Insert post reset delay Martin Povišer
@ 2022-02-02 13:24 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-02-02 13:24 UTC (permalink / raw)
  To: Martin Povišer
  Cc: Liam Girdwood, Pierre-Louis Bossart, Ye Bin, Frank Shi,
	alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

On Tue, Feb 01, 2022 at 11:47:18PM +0000, Martin Povišer wrote:

You've sent an encrypted mail to a public list, perhaps someone can read
what you've written but I can't.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-02 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01 23:47 [PATCH] ASoC: tas2770: Insert post reset delay Martin Povišer
2022-02-02 13:24 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®