RE: [alsa-devel] [PATCHv4 7/7] ASoC: TWL6030: Detect power-up sequence completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, February 26, 2010 3:27 PM  Mark Brown wrote: 

> On Fri, Feb 26, 2010 at 03:04:22PM -0600, Olaya, Margarita wrote:
> 
>> In both cases if READYINIT is not set before the timeout runs out
>> it means the codec is not powering on and the driver reports an
>> error. 
> 
> That's kind of my point - because you're checking for the same
> status there shouldn't be any need to special case the situation
> where there's
> no interrupt, I'd expect to be able to use
> wait_for_timeout_interruptible()
> for the delay and have the timeout completion interrupt cause
> that to be
> signalled.  No *terribly* important but it makes it clearer
> what's going
> on.

Do you mean something like this?
time_left = wait_for_completion_timeout(&priv->ready,
                                        msecs_to_jiffies(48));
if(!time_left) {
	twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &intid,
                                        TWL6040_REG_INTID);
      if (!(intid & TWL6040_READYINT))
		goto error;
}

	return 0;

error:
	dev_err(codec->dev, "timeout waiting for READYINT\n");
	return -ETIMEDOUT;

but in this case will it not take unnecessarily 48ms when the
interruption line is not valid?

Regards,
Margarita

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux