All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Olaya, Margarita" <magi.olaya@ti.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"lrg@slimlogic.co.uk" <lrg@slimlogic.co.uk>
Subject: Re: [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion
Date: Wed, 24 Feb 2010 13:59:09 +0000	[thread overview]
Message-ID: <20100224135909.GR18896@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <1889FA7136B567478A67D4B0F85B0CCE65DD1B19@dlee06.ent.ti.com>

On Tue, Feb 23, 2010 at 06:10:54PM -0600, Olaya, Margarita wrote:

> +	if (naudint) {
> +		/* wait for ready interrupt with 48 ms timeout */
> +		time_left = wait_for_completion_timeout(&priv->ready,
> +					msecs_to_jiffies(48));
> +	} else {
> +		/* retry 3 times only */
> +		for (time_left = 3; time_left > 0; time_left--) {
> +			mdelay(16);
> +			twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid,
> +					TWL6030_REG_INTID);
> +			if (intid & TWL6030_READYINT)
> +				break;
> +		}
> +	}

It strikes me that you could combine these two cases - the
wait_for_completion_timeout() will function just as well as a delay.
I'd also expect to see an error reported if the device doesn't report as
ready one way or another.

  reply	other threads:[~2010-02-24 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24  0:10 [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion Olaya, Margarita
2010-02-24 13:59 ` Mark Brown [this message]
2010-02-25  0:24   ` Olaya, Margarita
2010-02-25  8:42     ` Mark Brown
2010-02-26 21:04       ` Olaya, Margarita
2010-02-26 21:27         ` [alsa-devel] " Mark Brown
2010-02-27  0:22           ` Olaya, Margarita
2010-03-01 12:13             ` Mark Brown
2010-03-02  1:52               ` Olaya, Margarita

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=20100224135909.GR18896@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=magi.olaya@ti.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.