diff options
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 4751eab69ab7..0cb5b89cd0c8 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -68,6 +68,7 @@ struct hdmi_spec_per_pin { | |||
68 | hda_nid_t pin_nid; | 68 | hda_nid_t pin_nid; |
69 | int num_mux_nids; | 69 | int num_mux_nids; |
70 | hda_nid_t mux_nids[HDA_MAX_CONNECTIONS]; | 70 | hda_nid_t mux_nids[HDA_MAX_CONNECTIONS]; |
71 | int mux_idx; | ||
71 | hda_nid_t cvt_nid; | 72 | hda_nid_t cvt_nid; |
72 | 73 | ||
73 | struct hda_codec *codec; | 74 | struct hda_codec *codec; |
@@ -1344,6 +1345,8 @@ static int hdmi_choose_cvt(struct hda_codec *codec, | |||
1344 | if (cvt_idx == spec->num_cvts) | 1345 | if (cvt_idx == spec->num_cvts) |
1345 | return -ENODEV; | 1346 | return -ENODEV; |
1346 | 1347 | ||
1348 | per_pin->mux_idx = mux_idx; | ||
1349 | |||
1347 | if (cvt_id) | 1350 | if (cvt_id) |
1348 | *cvt_id = cvt_idx; | 1351 | *cvt_id = cvt_idx; |
1349 | if (mux_id) | 1352 | if (mux_id) |
@@ -1352,6 +1355,22 @@ static int hdmi_choose_cvt(struct hda_codec *codec, | |||
1352 | return 0; | 1355 | return 0; |
1353 | } | 1356 | } |
1354 | 1357 | ||
1358 | /* Assure the pin select the right convetor */ | ||
1359 | static void intel_verify_pin_cvt_connect(struct hda_codec *codec, | ||
1360 | struct hdmi_spec_per_pin *per_pin) | ||
1361 | { | ||
1362 | hda_nid_t pin_nid = per_pin->pin_nid; | ||
1363 | int mux_idx, curr; | ||
1364 | |||
1365 | mux_idx = per_pin->mux_idx; | ||
1366 | curr = snd_hda_codec_read(codec, pin_nid, 0, | ||
1367 | AC_VERB_GET_CONNECT_SEL, 0); | ||
1368 | if (curr != mux_idx) | ||
1369 | snd_hda_codec_write_cache(codec, pin_nid, 0, | ||
1370 | AC_VERB_SET_CONNECT_SEL, | ||
1371 | mux_idx); | ||
1372 | } | ||
1373 | |||
1355 | /* Intel HDMI workaround to fix audio routing issue: | 1374 | /* Intel HDMI workaround to fix audio routing issue: |
1356 | * For some Intel display codecs, pins share the same connection list. | 1375 | * For some Intel display codecs, pins share the same connection list. |
1357 | * So a conveter can be selected by multiple pins and playback on any of these | 1376 | * So a conveter can be selected by multiple pins and playback on any of these |
@@ -1753,6 +1772,19 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1753 | bool non_pcm; | 1772 | bool non_pcm; |
1754 | int pinctl; | 1773 | int pinctl; |
1755 | 1774 | ||
1775 | if (is_haswell_plus(codec) || is_valleyview(codec)) { | ||
1776 | /* Verify pin:cvt selections to avoid silent audio after S3. | ||
1777 | * After S3, the audio driver restores pin:cvt selections | ||
1778 | * but this can happen before gfx is ready and such selection | ||
1779 | * is overlooked by HW. Thus multiple pins can share a same | ||
1780 | * default convertor and mute control will affect each other, | ||
1781 | * which can cause a resumed audio playback become silent | ||
1782 | * after S3. | ||
1783 | */ | ||
1784 | intel_verify_pin_cvt_connect(codec, per_pin); | ||
1785 | intel_not_share_assigned_cvt(codec, pin_nid, per_pin->mux_idx); | ||
1786 | } | ||
1787 | |||
1756 | non_pcm = check_non_pcm_per_cvt(codec, cvt_nid); | 1788 | non_pcm = check_non_pcm_per_cvt(codec, cvt_nid); |
1757 | mutex_lock(&per_pin->lock); | 1789 | mutex_lock(&per_pin->lock); |
1758 | per_pin->channels = substream->runtime->channels; | 1790 | per_pin->channels = substream->runtime->channels; |