aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_sigmatel.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 992568368ef4..c4447b160a5a 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1600,6 +1600,13 @@ static int stac92xx_io_switch_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
1600 pinctl |= stac92xx_get_vref(codec, nid); 1600 pinctl |= stac92xx_get_vref(codec, nid);
1601 stac92xx_auto_set_pinctl(codec, nid, pinctl); 1601 stac92xx_auto_set_pinctl(codec, nid, pinctl);
1602 } 1602 }
1603
1604 /* check the auto-mute again: we need to mute/unmute the speaker
1605 * appropriately according to the pin direction
1606 */
1607 if (spec->hp_detect)
1608 codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26);
1609
1603 return 1; 1610 return 1;
1604} 1611}
1605 1612
@@ -2483,13 +2490,20 @@ static void stac92xx_reset_pinctl(struct hda_codec *codec, hda_nid_t nid,
2483 pin_ctl & ~flag); 2490 pin_ctl & ~flag);
2484} 2491}
2485 2492
2486static int get_pin_presence(struct hda_codec *codec, hda_nid_t nid) 2493static int get_hp_pin_presence(struct hda_codec *codec, hda_nid_t nid)
2487{ 2494{
2488 if (!nid) 2495 if (!nid)
2489 return 0; 2496 return 0;
2490 if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0x00) 2497 if (snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_PIN_SENSE, 0x00)
2491 & (1 << 31)) 2498 & (1 << 31)) {
2492 return 1; 2499 unsigned int pinctl;
2500 pinctl = snd_hda_codec_read(codec, nid, 0,
2501 AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
2502 if (pinctl & AC_PINCTL_IN_EN)
2503 return 0; /* mic- or line-input */
2504 else
2505 return 1; /* HP-output */
2506 }
2493 return 0; 2507 return 0;
2494} 2508}
2495 2509
@@ -2501,7 +2515,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
2501 2515
2502 presence = 0; 2516 presence = 0;
2503 for (i = 0; i < cfg->hp_outs; i++) { 2517 for (i = 0; i < cfg->hp_outs; i++) {
2504 presence = get_pin_presence(codec, cfg->hp_pins[i]); 2518 presence = get_hp_pin_presence(codec, cfg->hp_pins[i]);
2505 if (presence) 2519 if (presence)
2506 break; 2520 break;
2507 } 2521 }
@@ -3179,7 +3193,7 @@ static int stac9872_vaio_init(struct hda_codec *codec)
3179 3193
3180static void stac9872_vaio_hp_detect(struct hda_codec *codec, unsigned int res) 3194static void stac9872_vaio_hp_detect(struct hda_codec *codec, unsigned int res)
3181{ 3195{
3182 if (get_pin_presence(codec, 0x0a)) { 3196 if (get_hp_pin_presence(codec, 0x0a)) {
3183 stac92xx_reset_pinctl(codec, 0x0f, AC_PINCTL_OUT_EN); 3197 stac92xx_reset_pinctl(codec, 0x0f, AC_PINCTL_OUT_EN);
3184 stac92xx_set_pinctl(codec, 0x0a, AC_PINCTL_OUT_EN); 3198 stac92xx_set_pinctl(codec, 0x0a, AC_PINCTL_OUT_EN);
3185 } else { 3199 } else {