mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
14bc9c6dc6
commit
e037cb4a54
1 changed files with 1 additions and 1 deletions
|
@ -3497,7 +3497,7 @@ static bool snd_hda_codec_get_supported_ps(struct hda_codec *codec, hda_nid_t fg
|
||||||
{
|
{
|
||||||
int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE);
|
int sup = snd_hda_param_read(codec, fg, AC_PAR_POWER_STATE);
|
||||||
|
|
||||||
if (sup < 0)
|
if (sup == -1)
|
||||||
return false;
|
return false;
|
||||||
if (sup & power_state)
|
if (sup & power_state)
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue