Commit 6169b673618bf0b2518ce413b54925782a603f06

Authored by Takashi Iwai
1 parent 8ae5865ec7

ALSA: hda - Always turn on pins for HDMI/DP

We've seen the broken HDMI *video* output on some machines with GM965,
and the debugging session pointed that the culprit is the disabled
audio output pins.  Toggling these pins dynamically on demand caused
flickering of HDMI TV.

This patch changes the behavior to keep the pin ON constantly.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51421

Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 4 additions and 14 deletions Side-by-side Diff

sound/pci/hda/patch_hdmi.c
... ... @@ -431,9 +431,11 @@
431 431 if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP)
432 432 snd_hda_codec_write(codec, pin_nid, 0,
433 433 AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
434   - /* Disable pin out until stream is active*/
  434 + /* Enable pin out: some machines with GM965 gets broken output when
  435 + * the pin is disabled or changed while using with HDMI
  436 + */
435 437 snd_hda_codec_write(codec, pin_nid, 0,
436   - AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
  438 + AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
437 439 }
438 440  
439 441 static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t cvt_nid)
... ... @@ -1341,7 +1343,6 @@
1341 1343 struct hdmi_spec *spec = codec->spec;
1342 1344 int pin_idx = hinfo_to_pin_index(spec, hinfo);
1343 1345 hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
1344   - int pinctl;
1345 1346 bool non_pcm;
1346 1347  
1347 1348 non_pcm = check_non_pcm_per_cvt(codec, cvt_nid);
... ... @@ -1350,11 +1351,6 @@
1350 1351  
1351 1352 hdmi_setup_audio_infoframe(codec, pin_idx, non_pcm, substream);
1352 1353  
1353   - pinctl = snd_hda_codec_read(codec, pin_nid, 0,
1354   - AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
1355   - snd_hda_codec_write(codec, pin_nid, 0,
1356   - AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT);
1357   -
1358 1354 return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
1359 1355 }
1360 1356  
... ... @@ -1374,7 +1370,6 @@
1374 1370 int cvt_idx, pin_idx;
1375 1371 struct hdmi_spec_per_cvt *per_cvt;
1376 1372 struct hdmi_spec_per_pin *per_pin;
1377   - int pinctl;
1378 1373  
1379 1374 if (hinfo->nid) {
1380 1375 cvt_idx = cvt_nid_to_cvt_index(spec, hinfo->nid);
... ... @@ -1391,11 +1386,6 @@
1391 1386 return -EINVAL;
1392 1387 per_pin = &spec->pins[pin_idx];
1393 1388  
1394   - pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0,
1395   - AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
1396   - snd_hda_codec_write(codec, per_pin->pin_nid, 0,
1397   - AC_VERB_SET_PIN_WIDGET_CONTROL,
1398   - pinctl & ~PIN_OUT);
1399 1389 snd_hda_spdif_ctls_unassign(codec, pin_idx);
1400 1390 per_pin->chmap_set = false;
1401 1391 memset(per_pin->chmap, 0, sizeof(per_pin->chmap));