linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: max98373: Added 10ms delay after amp software reset
@ 2018-08-23  0:15 Ryan Lee
  2018-08-23  0:31 ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Ryan Lee @ 2018-08-23  0:15 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, ryans.lee,
	kuninori.morimoto.gx, alsa-devel, linux-kernel
  Cc: ryan.lee.maxim

Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
---
 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(+)

diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c
index 2764fae..6aaff03 100644
--- a/sound/soc/codecs/max98373.c
+++ b/sound/soc/codecs/max98373.c
@@ -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;
-- 
2.7.4


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

* Re: [PATCH] ASoC: max98373: Added 10ms delay after amp software reset
  2018-08-23  0:15 [PATCH] ASoC: max98373: Added 10ms delay after amp software reset Ryan Lee
@ 2018-08-23  0:31 ` Dmitry Torokhov
  2018-08-23  9:51   ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2018-08-23  0:31 UTC (permalink / raw)
  To: ryans.lee
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Kuninori Morimoto, alsa-devel, lkml, ryan.lee.maxim

On Wed, Aug 22, 2018 at 5:21 PM Ryan Lee <ryans.lee@maximintegrated.com> wrote:
>
> Signed-off-by: Ryan Lee <ryans.lee@maximintegrated.com>
> ---
>  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(+)
>
> diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c
> index 2764fae..6aaff03 100644
> --- a/sound/soc/codecs/max98373.c
> +++ b/sound/soc/codecs/max98373.c
> @@ -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.

>
>         /* 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;
> --
> 2.7.4
>

Thanks.

-- 
Dmitry

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

* Re: [PATCH] ASoC: max98373: Added 10ms delay after amp software reset
  2018-08-23  0:31 ` Dmitry Torokhov
@ 2018-08-23  9:51   ` Mark Brown
  2018-08-24  0:08     ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2018-08-23  9:51 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: ryans.lee, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Kuninori Morimoto, alsa-devel, lkml, ryan.lee.maxim

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

On Wed, Aug 22, 2018 at 05:31:04PM -0700, Dmitry Torokhov wrote:
> On Wed, Aug 22, 2018 at 5:21 PM Ryan Lee <ryans.lee@maximintegrated.com> wrote:
> > +       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.

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

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

* Re: [PATCH] ASoC: max98373: Added 10ms delay after amp software reset
  2018-08-23  9:51   ` Mark Brown
@ 2018-08-24  0:08     ` Dmitry Torokhov
  2018-08-24  1:00       ` Ryan Lee
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Torokhov @ 2018-08-24  0:08 UTC (permalink / raw)
  To: Mark Brown
  Cc: ryans.lee, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Kuninori Morimoto, alsa-devel, lkml, ryan.lee.maxim

On Thu, Aug 23, 2018 at 10:51:07AM +0100, Mark Brown wrote:
> On Wed, Aug 22, 2018 at 05:31:04PM -0700, Dmitry Torokhov wrote:
> > On Wed, Aug 22, 2018 at 5:21 PM Ryan Lee <ryans.lee@maximintegrated.com> wrote:
> > > +       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.

-- 
Dmitry

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

* RE: [PATCH] ASoC: max98373: Added 10ms delay after amp software reset
  2018-08-24  0:08     ` Dmitry Torokhov
@ 2018-08-24  1:00       ` Ryan Lee
  0 siblings, 0 replies; 5+ messages in thread
From: Ryan Lee @ 2018-08-24  1:00 UTC (permalink / raw)
  To: Dmitry Torokhov, Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto,
	alsa-devel, lkml, ryan.lee.maxim

>-----Original Message-----
>From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>Sent: Thursday, August 23, 2018 5:08 PM
>To: Mark Brown <broonie@kernel.org>
>Cc: Ryan Lee <RyanS.Lee@maximintegrated.com>; Liam Girdwood
><lgirdwood@gmail.com>; Jaroslav Kysela <perex@perex.cz>; Takashi Iwai
><tiwai@suse.com>; Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>;
>alsa-devel@alsa-project.org; lkml <linux-kernel@vger.kernel.org>;
>ryan.lee.maxim@gmail.com
>Subject: Re: [PATCH] ASoC: max98373: Added 10ms delay after amp software
>reset
>
>EXTERNAL EMAIL
>
>
>
>On Thu, Aug 23, 2018 at 10:51:07AM +0100, Mark Brown wrote:
>> On Wed, Aug 22, 2018 at 05:31:04PM -0700, Dmitry Torokhov wrote:
>> > On Wed, Aug 22, 2018 at 5:21 PM Ryan Lee
><ryans.lee@maximintegrated.com> wrote:
>> > > +       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 for all your feedback.
Let me apply usleep_range() or msleep() instead of using mdelay().

>
>Thanks.
>
>--
>Dmitry

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

end of thread, other threads:[~2018-08-24  1:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23  0:15 [PATCH] ASoC: max98373: Added 10ms delay after amp software reset Ryan Lee
2018-08-23  0:31 ` Dmitry Torokhov
2018-08-23  9:51   ` Mark Brown
2018-08-24  0:08     ` Dmitry Torokhov
2018-08-24  1:00       ` Ryan Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).