[alsa-devel] [PATCH 2/2] ALSA: hda - reduce msleep time if EPSS power states supported

David Henningsson david.henningsson at canonical.com
Thu Jun 7 09:15:11 CEST 2012


On 06/06/2012 04:02 PM, Wang Xingchao wrote:
> if EPSS supported, transition from D3 state to D0 state in less
> than 10ms
>
> Signed-off-by: Wang Xingchao<xingchao.wang at intel.com>
> ---
>   sound/pci/hda/hda_codec.c |    6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index b89c8ec..5298ba1 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -3526,14 +3526,18 @@ static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg
>   static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
>   				unsigned int power_state)
>   {
> +	bool epss;
>   	if (codec->patch_ops.set_power_state) {
>   		codec->patch_ops.set_power_state(codec, fg, power_state);
>   		return;
>   	}
>
> +	epss = snd_hda_codec_get_supported_ps(codec, fg, AC_PWRST_EPSS);
>   	/* this delay seems necessary to avoid click noise at power-down */
> -	if (power_state == AC_PWRST_D3)
> +	if ((power_state == AC_PWRST_D3)&&  !epss)
>   		msleep(100);
> +	else
> +		msleep(10);

Hi Wang,

You seem to have increased the delay from 0 to 10 ms on all cases when 
power_state != AC_PWRST_D3, is this intentional?

Or did you mean to write like this:

	if (power_state == AC_PWRST_D3) {
		bool epss = snd_hda_codec_get_supported_ps(codec, fg, AC_PWRST_EPSS);
		msleep(epss ? 10 : 100);
	}


-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


More information about the Alsa-devel mailing list