Skip to contentSkip to conversation

ASoC: max98373: Added 10ms delay after amp software reset

PATCH Superseded Ryan Lee 3 participants 5 messages Aug 23, 2018 – Aug 24, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ryan Lee

author
#0 lore raw

PATCH 1/1 ASoC: max98373: Added 10ms delay after amp software reset

---
Changes : Applied 10ms delay after amp software reset.
10ms guard time is required for stability.

 sound/soc/codecs/max98373.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/max98373.c +2 -0
index 2764fae..6aaff03 100644
@@ -730,6 +730,7 @@ static int max98373_probe(struct snd_soc_component *component)
 	/* Software Reset */
 	regmap_write(max98373->regmap,
 		MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
+	mdelay(10);
 
 	/* IV default slot configuration */
 	regmap_write(max98373->regmap,
@@ -818,6 +819,7 @@ static int max98373_resume(struct device *dev)
 
 	regmap_write(max98373->regmap,
 		MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
+	mdelay(10);
 	regcache_cache_only(max98373->regmap, false);
 	regcache_sync(max98373->regmap);
 	return 0;
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · Ryan Lee

---
Changes : Applied 10ms delay after amp software reset.
10ms guard time is required for stability.

 sound/soc/codecs/max98373.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/max98373.c +0 -0
index 2764fae..6aaff03 100644

sound/soc/codecs/max98373.c static int max98373_probe(struct snd_soc_component *component) · line 733

Quoted 4 lines
sound/soc/codecs/max98373.c +1 -0
@@ -730,6 +730,7 @@ static int max98373_probe(struct snd_soc_component *component)
        /* Software Reset */
        regmap_write(max98373->regmap,
                MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
+       mdelay(10);

Is it really necessary for the CPU to spin for 10msec here? usleep_range() would be better solution.

Quoted 12 lines
sound/soc/codecs/max98373.c +1 -1
        /* IV default slot configuration */
        regmap_write(max98373->regmap,
@@ -818,6 +819,7 @@ static int max98373_resume(struct device *dev)
 
        regmap_write(max98373->regmap,
                MAX98373_R2000_SW_RESET, MAX98373_SOFT_RESET);
+       mdelay(10);
        regcache_cache_only(max98373->regmap, false);
        regcache_sync(max98373->regmap);
        return 0;
--
Quoted 2 lines

2.7.4

Thanks.

Signature · 1 line
Dmitry
maintainer
#2 lore raw
Quoted 5 lines · Dmitry Torokhov
Quoted 1 line · Ryan Lee

+ mdelay(10);

Is it really necessary for the CPU to spin for 10msec here? usleep_range() would be better solution.

Or msleep() for that matter, it's not going ot be the end of the world if we delay a bit too long.

#3 lore raw
Quoted 9 lines · Mark Brown
Quoted 5 lines · Dmitry Torokhov
Quoted 1 line · Ryan Lee

+ mdelay(10);

Is it really necessary for the CPU to spin for 10msec here? usleep_range() would be better solution.

Or msleep() for that matter, it's not going ot be the end of the world if we delay a bit too long.

Frankly, I'd rather we did not introduce extra delays. I do not know if we use this part, but on ChromeOS we are interested in shaving as much from the boot time as possible and 10 msecs here and 10 msecs there do add up.

Thanks.

Signature · 1 line
Dmitry
author
#4 lore raw
Quoted 25 lines

-----Original Message-----
From: Dmitry Torokhov <[email protected]>
Sent: Thursday, August 23, 2018 5:08 PM
To: Mark Brown <[email protected]>
Cc: Ryan Lee <[email protected]>; Liam Girdwood <[email protected]>; Jaroslav Kysela <[email protected]>; Takashi Iwai <[email protected]>; Kuninori Morimoto <[email protected]>; [email protected]; lkml <[email protected]>; [email protected]
Subject: Re: [PATCH] ASoC: max98373: Added 10ms delay after amp software reset

EXTERNAL EMAIL

Quoted 2 lines · Mark Brown
Quoted 1 line · Dmitry Torokhov

On Wed, Aug 22, 2018 at 5:21 PM Ryan Lee

Quoted 5 lines · <[email protected]> wrote:
Quoted 4 lines
Quoted 1 line

+ mdelay(10);

Is it really necessary for the CPU to spin for 10msec here? usleep_range() would be better solution.

Quoted 6 lines
Quoted 2 lines

Or msleep() for that matter, it's not going ot be the end of the world if we delay a bit too long.

Frankly, I'd rather we did not introduce extra delays. I do not know if we use this part, but on ChromeOS we are interested in shaving as much from the boot time as possible and 10 msecs here and 10 msecs there do add up.

Thanks for all your feedback.
Let me apply usleep_range() or msleep() instead of using mdelay().

Quoted 5 lines

Thanks.

--
Dmitry