diff options
author | Mengdong Lin <mengdong.lin@intel.com> | 2012-08-10 08:11:58 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-08-10 08:11:58 -0400 |
commit | e037cb4a54e26b5f55f856e0e7445cfcfb2f3d31 (patch) | |
tree | 87ae699143576670557110a862711bf006fe2f46 | |
parent | 14bc9c6dc694e2d7930802f7afd275de25ef8394 (diff) |
ALSA : hda - bug fix on checking the supported power states of a codec
The return value of snd_hda_param_read() is -1 for an error, otherwise
it's the supported power states of a codec.
The supported power states is a 32-bit value. Bit 31 will be set to 1
if the codec supports EPSS, thus making "sup" negative. And the bit
28:5 is reserved as "0".
So a negative value other than -1 shall be further checked.
Please refer to High-Definition spec 7.3.4.12 "Supported Power
States", thanks!
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 88a9c20eb7a2..629131ad7b8b 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3497,7 +3497,7 @@ static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg | |||
3497 | { | 3497 | { |
3498 | int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE); | 3498 | int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE); |
3499 | 3499 | ||
3500 | if (sup < 0) | 3500 | if (sup == -1) |
3501 | return false; | 3501 | return false; |
3502 | if (sup & power_state) | 3502 | if (sup & power_state) |
3503 | return true; | 3503 | return true; |