changelog shortlog tags manifest raw

changeset: hda-codec - Fix input with STAC92xx

changeset 5085: 200fc3a7ef62
parent 5084:ff3ed7049f84
child 5086:6ee58da0b892
author: tiwai
date: Tue May 29 18:01:06 2007 +0200 (4 years ago)
files: pci/hda/patch_sigmatel.c
description: hda-codec - Fix input with STAC92xx

The recent fix for STAC92xx surround outputs broke the input pin
setting for shared line-in and mic jacks. This patch fixes the
breakage.

Patch-level: ASAP
--- a/pci/hda/patch_sigmatel.c	Tue May 29 16:03:00 2007 +0200
+++ b/pci/hda/patch_sigmatel.c	Tue May 29 18:01:06 2007 +0200
@@ -1797,6 +1797,21 @@ static void stac92xx_set_pinctl(struct h
 	unsigned int pin_ctl = snd_hda_codec_read(codec, nid,
 			0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0x00);
 
+	if (pin_ctl & AC_PINCTL_IN_EN) {
+		/*
+		 * we need to check the current set-up direction of
+		 * shared input pins since they can be switched via
+		 * "xxx as Output" mixer switch
+		 */
+		struct sigmatel_spec *spec = codec->spec;
+		struct auto_pin_cfg *cfg = &spec->autocfg;
+		if ((nid == cfg->input_pins[AUTO_PIN_LINE] &&
+		     spec->line_switch) ||
+		    (nid == cfg->input_pins[AUTO_PIN_MIC] &&
+		     spec->mic_switch))
+			return;
+	}
+
 	/* if setting pin direction bits, clear the current
 	   direction bits first */
 	if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))