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

Takashi Iwai tiwai at suse.de
Fri Nov 29 07:16:07 CET 2013


At Fri, 29 Nov 2013 02:41:26 +0000,
Lin, Mengdong wrote:
> 
> > -----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"?

Or make default -1, and >= 0 for explicit delay set by a codec
driver.  It doesn't matter which way.  My point is that it's better to
be a value than a boolean flag.


Takashi


More information about the Alsa-devel mailing list