[alsa-devel] HD-Audio: can msleep in hda_set_power_state() to D3 be optional?

Lin, Mengdong mengdong.lin at intel.com
Fri Nov 29 03:41:26 CET 2013


> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai at suse.de]
> Sent: Thursday, November 28, 2013 11:20 PM
> To: Lin, Mengdong
> Cc: alsa-devel at alsa-project.org
> Subject: Re: HD-Audio: can msleep in hda_set_power_state() to D3 be
> optional?
> 
> At Thu, 28 Nov 2013 15:07:48 +0000,
> Lin, Mengdong wrote:
> >
> > Hi Takashi,
> >
> > In hda_set_power_state(), there is a mandatory sleep up to 100ms
> before setting state to D3.
> >
> > /* this delay seems necessary to avoid click noise at power-down */ if
> > (power_state == AC_PWRST_D3) {
> >                    msleep(codec->epss ? 10 : 100);   ... Could this
> be optional for specific codecs?
> >                    flags = HDA_RW_NO_RESPONSE_FALLBACK; }
> >
> > Some codecs implement their own sleep in patch_ops.suspend() to
> avoid the noise.
> > So is it okay to add a codec flag to decide whether the sleep is necessary
> here?
> 
> Rather add an integer value to indicate the codec delay, e.g.
> codec->d3_delay.  If it's zero, we can take the default delay (10 or 100) as
> of now.

How to set the integer value if a codec doesn't need sleep here? 
To set a very small value or "-1"?

Thanks
Mengdong


More information about the Alsa-devel mailing list