]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: hda - Fix input pin initialization for STAC/IDT codecs
authorTakashi Iwai <tiwai@suse.de>
Tue, 11 Nov 2008 15:47:24 +0000 (16:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 11 Nov 2008 17:00:53 +0000 (18:00 +0100)
The input pins are sometimes not initialized properly because
of the optimization check of the current pinctl code.

Force to initialize the mic input pins so that they can be set up
properly even if they were in a weird state.  But keep other input
pins if already set up as input, since this could be an extra mic
pin.

Reference: Novell bnc#443738
https://bugzilla.novell.com/show_bug.cgi?id=443738

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_sigmatel.c

index 1627756e5c7dc6e586a1bfadba346f8c7e0d1719..a51160106df35a0e89124c01e3271cfb3607f2a1 100644 (file)
@@ -3653,14 +3653,18 @@ static int stac92xx_init(struct hda_codec *codec)
        for (i = 0; i < AUTO_PIN_LAST; i++) {
                hda_nid_t nid = cfg->input_pins[i];
                if (nid) {
-                       unsigned int pinctl = snd_hda_codec_read(codec, nid,
-                               0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
-                       /* if PINCTL already set then skip */
-                       if (pinctl & AC_PINCAP_IN)
-                               continue;
-                       pinctl = AC_PINCTL_IN_EN;
-                       if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC)
-                               pinctl |= stac92xx_get_vref(codec, nid);
+                       unsigned int pinctl;
+                       if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC) {
+                               /* for mic pins, force to initialize */
+                               pinctl = stac92xx_get_vref(codec, nid);
+                       } else {
+                               pinctl = snd_hda_codec_read(codec, nid, 0,
+                                       AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
+                               /* if PINCTL already set then skip */
+                               if (pinctl & AC_PINCTL_IN_EN)
+                                       continue;
+                       }
+                       pinctl |= AC_PINCTL_IN_EN;
                        stac92xx_auto_set_pinctl(codec, nid, pinctl);
                }
        }