All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: arizona: Add delay for output disable
Date: Mon, 19 Jan 2015 16:58:50 +0000	[thread overview]
Message-ID: <20150119165850.GY14516@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20150119162432.GF2809@sirena.org.uk>

On Mon, Jan 19, 2015 at 04:24:32PM +0000, Mark Brown wrote:
> On Mon, Jan 19, 2015 at 03:49:46PM +0000, Charles Keepax wrote:
> 
> > +	case SND_SOC_DAPM_POST_PMD:
> > +		switch (w->shift) {
> > +		case ARIZONA_OUT1L_ENA_SHIFT:
> > +		case ARIZONA_OUT1R_ENA_SHIFT:
> > +		case ARIZONA_OUT2L_ENA_SHIFT:
> > +		case ARIZONA_OUT2R_ENA_SHIFT:
> > +		case ARIZONA_OUT3L_ENA_SHIFT:
> > +		case ARIZONA_OUT3R_ENA_SHIFT:
> > +			udelay(750);
> > +			break;
> 
> That's a really quite long udelay() especially given that as the code is
> written it's going to be cumalative over all the outputs being torn down
> so typically will be 1.5ms for headphones (not sure if that's the
> intention or not).  msleep() would be more friendly than udelay() and
> it'd also be good to arrange to coalesce the delays.  Perhaps set a flag
> in _PRE_PMD and check if a delay is needed in the clock teardown?  Or
> better yet record a timestamp and then figure out if a delay is needed
> when tearing down the clock though that is probably overengineering.

Similar to the power up the delay needs to be cumulative as the
write sequences will queue themselves up if the last one is still
running when the next one is started. It is fairly long for a
udelay I will replace with an msleep(1) instead.

Thanks,
Charles

  reply	other threads:[~2015-01-19 16:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1421682586-6303-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>
2015-01-19 16:24 ` [PATCH] ASoC: arizona: Add delay for output disable Mark Brown
2015-01-19 16:58   ` Charles Keepax [this message]
2015-01-19 17:07     ` Mark Brown
2015-01-19 17:13       ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150119165850.GY14516@opensource.wolfsonmicro.com \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.wolfsonmicro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.