Commit e8a7f136 authored by Danny Tholen's avatar Danny Tholen Committed by Jaroslav Kysela

[ALSA] hda-intel - Improve HD-audio codec probing robustness

When modem is disabled in the BIOS, detection of the number of codecs
always fails after booting if STATESTS is not cleared first.
This patch fixes this problem and also adds an error check in a place
where a read error would lead to a very large number of pointless loops.
Signed-off-by: default avatarDanny Tholen <obiwan@mailmij.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 768d8c7d
...@@ -155,6 +155,8 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, ...@@ -155,6 +155,8 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid,
unsigned int parm; unsigned int parm;
parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT); parm = snd_hda_param_read(codec, nid, AC_PAR_NODE_COUNT);
if (parm == -1)
return 0;
*start_id = (parm >> 16) & 0x7fff; *start_id = (parm >> 16) & 0x7fff;
return (int)(parm & 0x7fff); return (int)(parm & 0x7fff);
} }
......
...@@ -687,6 +687,9 @@ static int azx_reset(struct azx *chip) ...@@ -687,6 +687,9 @@ static int azx_reset(struct azx *chip)
{ {
int count; int count;
/* clear STATESTS */
azx_writeb(chip, STATESTS, STATESTS_INT_MASK);
/* reset controller */ /* reset controller */
azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_RESET); azx_writel(chip, GCTL, azx_readl(chip, GCTL) & ~ICH6_GCTL_RESET);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment