Skip to content

Commit

Permalink
ALSA: hda - Don't pick up invalid HP pins in alc_subsystem_id()
Browse files Browse the repository at this point in the history
alc_subsystem_id() tries to pick up a headphone pin if not configured,
but this caused side-effects as the problem in commit
15870f0.

This patch fixes the driver behavior to pick up invalid HP pins; at least,
the pins that are listed as the primary outputs aren't taken any more.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Oct 6, 2009
1 parent f8f25ba commit 01d4825
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,15 +1332,20 @@ static int alc_subsystem_id(struct hda_codec *codec,
* when the external headphone out jack is plugged"
*/
if (!spec->autocfg.hp_pins[0]) {
hda_nid_t nid;
tmp = (ass >> 11) & 0x3; /* HP to chassis */
if (tmp == 0)
spec->autocfg.hp_pins[0] = porta;
nid = porta;
else if (tmp == 1)
spec->autocfg.hp_pins[0] = porte;
nid = porte;
else if (tmp == 2)
spec->autocfg.hp_pins[0] = portd;
nid = portd;
else
return 1;
for (i = 0; i < spec->autocfg.line_outs; i++)
if (spec->autocfg.line_out_pins[i] == nid)
return 1;
spec->autocfg.hp_pins[0] = nid;
}

alc_init_auto_hp(codec);
Expand Down

0 comments on commit 01d4825

Please sign in to comment.