diff options
author | Mengdong Lin <mengdong.lin@intel.com> | 2013-02-08 17:09:52 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-02-08 06:23:13 -0500 |
commit | 1611a9c931e95fab871a33beba49cc9ea39bbba8 (patch) | |
tree | 2d4f193bbe9e0f90502c15f3928796af56247270 /sound/pci/hda/patch_hdmi.c | |
parent | a15d05db41b1d5c9f2c3af11dfbfd46818cc64ba (diff) |
ALSA: hda - Add fixup for Haswell to enable all pin and convertor widgets
Some Haswell machines support more than one display outputs (HDMI or DP),
but its BIOS may not enable the codec's 2nd and 3rd pin and output cvt widgets.
This patch implements a board-specific fixup for Intel Haswell Machines:
If the hidden pins are not enabled by BIOS, the driver will enable them
and call common code to update the codec tree.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 899c4fbbfd83..54243c4a4e9d 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -1714,6 +1714,57 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec) | |||
1714 | snd_hda_override_conn_list(codec, 0x07, 3, list); | 1714 | snd_hda_override_conn_list(codec, 0x07, 3, list); |
1715 | } | 1715 | } |
1716 | 1716 | ||
1717 | #define INTEL_VENDOR_NID 0x08 | ||
1718 | #define INTEL_GET_VENDOR_VERB 0xf81 | ||
1719 | #define INTEL_SET_VENDOR_VERB 0x781 | ||
1720 | #define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */ | ||
1721 | #define INTEL_EN_ALL_PIN_CVTS 0x01 /* enable 2nd & 3rd pins and convertors */ | ||
1722 | |||
1723 | static void intel_haswell_enable_all_pins(struct hda_codec *codec, | ||
1724 | const struct hda_fixup *fix, int action) | ||
1725 | { | ||
1726 | unsigned int vendor_param; | ||
1727 | |||
1728 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | ||
1729 | return; | ||
1730 | vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, | ||
1731 | INTEL_GET_VENDOR_VERB, 0); | ||
1732 | if (vendor_param == -1 || vendor_param & INTEL_EN_ALL_PIN_CVTS) | ||
1733 | return; | ||
1734 | |||
1735 | vendor_param |= INTEL_EN_ALL_PIN_CVTS; | ||
1736 | vendor_param = snd_hda_codec_read(codec, INTEL_VENDOR_NID, 0, | ||
1737 | INTEL_SET_VENDOR_VERB, vendor_param); | ||
1738 | if (vendor_param == -1) | ||
1739 | return; | ||
1740 | |||
1741 | snd_hda_codec_update_widgets(codec); | ||
1742 | return; | ||
1743 | } | ||
1744 | |||
1745 | |||
1746 | /* available models for fixup */ | ||
1747 | enum { | ||
1748 | INTEL_HASWELL, | ||
1749 | }; | ||
1750 | |||
1751 | static const struct hda_model_fixup hdmi_models[] = { | ||
1752 | {.id = INTEL_HASWELL, .name = "Haswell"}, | ||
1753 | {} | ||
1754 | }; | ||
1755 | |||
1756 | static const struct snd_pci_quirk hdmi_fixup_tbl[] = { | ||
1757 | SND_PCI_QUIRK(0x8086, 0x2010, "Haswell", INTEL_HASWELL), | ||
1758 | {} /* terminator */ | ||
1759 | }; | ||
1760 | |||
1761 | static const struct hda_fixup hdmi_fixups[] = { | ||
1762 | [INTEL_HASWELL] = { | ||
1763 | .type = HDA_FIXUP_FUNC, | ||
1764 | .v.func = intel_haswell_enable_all_pins, | ||
1765 | }, | ||
1766 | }; | ||
1767 | |||
1717 | 1768 | ||
1718 | static int patch_generic_hdmi(struct hda_codec *codec) | 1769 | static int patch_generic_hdmi(struct hda_codec *codec) |
1719 | { | 1770 | { |
@@ -1725,6 +1776,9 @@ static int patch_generic_hdmi(struct hda_codec *codec) | |||
1725 | 1776 | ||
1726 | codec->spec = spec; | 1777 | codec->spec = spec; |
1727 | 1778 | ||
1779 | snd_hda_pick_fixup(codec, hdmi_models, hdmi_fixup_tbl, hdmi_fixups); | ||
1780 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | ||
1781 | |||
1728 | if (codec->vendor_id == 0x80862807) | 1782 | if (codec->vendor_id == 0x80862807) |
1729 | intel_haswell_fixup_connect_list(codec); | 1783 | intel_haswell_fixup_connect_list(codec); |
1730 | 1784 | ||