Skip to content

Commit 6169b67

Browse files
committed
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>
1 parent 8ae5865 commit 6169b67

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

sound/pci/hda/patch_hdmi.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,11 @@ static void hdmi_init_pin(struct hda_codec *codec, hda_nid_t pin_nid)
431431
if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP)
432432
snd_hda_codec_write(codec, pin_nid, 0,
433433
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+
*/
435437
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);
437439
}
438440

439441
static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t cvt_nid)
@@ -1341,7 +1343,6 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
13411343
struct hdmi_spec *spec = codec->spec;
13421344
int pin_idx = hinfo_to_pin_index(spec, hinfo);
13431345
hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
1344-
int pinctl;
13451346
bool non_pcm;
13461347

13471348
non_pcm = check_non_pcm_per_cvt(codec, cvt_nid);
@@ -1350,11 +1351,6 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
13501351

13511352
hdmi_setup_audio_infoframe(codec, pin_idx, non_pcm, substream);
13521353

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-
13581354
return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
13591355
}
13601356

@@ -1374,7 +1370,6 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
13741370
int cvt_idx, pin_idx;
13751371
struct hdmi_spec_per_cvt *per_cvt;
13761372
struct hdmi_spec_per_pin *per_pin;
1377-
int pinctl;
13781373

13791374
if (hinfo->nid) {
13801375
cvt_idx = cvt_nid_to_cvt_index(spec, hinfo->nid);
@@ -1391,11 +1386,6 @@ static int hdmi_pcm_close(struct hda_pcm_stream *hinfo,
13911386
return -EINVAL;
13921387
per_pin = &spec->pins[pin_idx];
13931388

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);
13991389
snd_hda_spdif_ctls_unassign(codec, pin_idx);
14001390
per_pin->chmap_set = false;
14011391
memset(per_pin->chmap, 0, sizeof(per_pin->chmap));

0 commit comments

Comments
 (0)