1 From: Takashi Iwai <tiwai@suse.de>
2 Subject: ALSA: hda - Fix input pin initialization for STAC/IDT codecs
6 The input pins are sometimes not initialized properly because
7 of the optimization check of the current pinctl code.
9 Force to initialize the mic input pins so that they can be set up
10 properly even if they were in a weird state. But keep other input
11 pins if already set up as input, since this could be an extra mic
14 Reference: Novell bnc#443738
15 https://bugzilla.novell.com/show_bug.cgi?id=443738
17 Signed-off-by: Takashi Iwai <tiwai@suse.de>
20 sound/pci/hda/patch_sigmatel.c | 20 ++++++++++++--------
21 1 file changed, 12 insertions(+), 8 deletions(-)
23 --- a/sound/pci/hda/patch_sigmatel.c
24 +++ b/sound/pci/hda/patch_sigmatel.c
25 @@ -3658,14 +3658,18 @@ static int stac92xx_init(struct hda_code
26 for (i = 0; i < AUTO_PIN_LAST; i++) {
27 hda_nid_t nid = cfg->input_pins[i];
29 - unsigned int pinctl = snd_hda_codec_read(codec, nid,
30 - 0, AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
31 - /* if PINCTL already set then skip */
32 - if (pinctl & AC_PINCAP_IN)
34 - pinctl = AC_PINCTL_IN_EN;
35 - if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC)
36 - pinctl |= stac92xx_get_vref(codec, nid);
37 + unsigned int pinctl;
38 + if (i == AUTO_PIN_MIC || i == AUTO_PIN_FRONT_MIC) {
39 + /* for mic pins, force to initialize */
40 + pinctl = stac92xx_get_vref(codec, nid);
42 + pinctl = snd_hda_codec_read(codec, nid, 0,
43 + AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
44 + /* if PINCTL already set then skip */
45 + if (pinctl & AC_PINCTL_IN_EN)
48 + pinctl |= AC_PINCTL_IN_EN;
49 stac92xx_auto_set_pinctl(codec, nid, pinctl);