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

Takashi Iwai tiwai at suse.de
Thu Nov 28 16:20:21 CET 2013


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.


Takashi


More information about the Alsa-devel mailing list