aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-09-14 15:36:14 +0200
committerTakashi Iwai <tiwai@suse.de>2009-09-14 15:36:14 +0200
commit5f380eb1eff2031b5101a64c76b54cca8e1c7079 (patch)
tree614f6422b85859756dba9099a7ce2fdf6cfc365a /sound
parentfc64b26cfa3c7ee5ba23ab549ecd6415bed6b0eb (diff)
ALSA: hda - Fix HP/line-out initialization with IDT/STAC codecs
It's possible that hp_detect is set even though no headphone pin is detected. The driver issues, however, an unsol event only to hp_pins[0], which can be invalid. This patch adds the check of the valid pin to send an unsol event at initialization and resume callbacks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_sigmatel.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 23a698715e7..fe2ba764d34 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4166,7 +4166,10 @@ static int stac92xx_init(struct hda_codec *codec)
stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0],
AC_PINCTL_OUT_EN);
/* fake event to set up pins */
- stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]);
+ if (cfg->hp_pins[0])
+ stac_issue_unsol_event(codec, cfg->hp_pins[0]);
+ else if (cfg->line_out_pins[0])
+ stac_issue_unsol_event(codec, cfg->line_out_pins[0]);
} else {
stac92xx_auto_init_multi_out(codec);
stac92xx_auto_init_hp_out(codec);
@@ -4688,8 +4691,13 @@ static int stac92xx_resume(struct hda_codec *codec)
snd_hda_codec_resume_amp(codec);
snd_hda_codec_resume_cache(codec);
/* fake event to set up pins again to override cached values */
- if (spec->hp_detect)
- stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]);
+ if (spec->hp_detect) {
+ if (spec->autocfg.hp_pins[0])
+ stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]);
+ else if (spec->autocfg.line_out_pins[0])
+ stac_issue_unsol_event(codec,
+ spec->autocfg.line_out_pins[0]);
+ }
return 0;
}