aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_realtek.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index e327e630cac4..c5ea483d7559 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1780,6 +1780,7 @@ enum {
1780 ALC889_FIXUP_DAC_ROUTE, 1780 ALC889_FIXUP_DAC_ROUTE,
1781 ALC889_FIXUP_MBP_VREF, 1781 ALC889_FIXUP_MBP_VREF,
1782 ALC889_FIXUP_IMAC91_VREF, 1782 ALC889_FIXUP_IMAC91_VREF,
1783 ALC889_FIXUP_MBA21_VREF,
1783 ALC882_FIXUP_INV_DMIC, 1784 ALC882_FIXUP_INV_DMIC,
1784 ALC882_FIXUP_NO_PRIMARY_HP, 1785 ALC882_FIXUP_NO_PRIMARY_HP,
1785 ALC887_FIXUP_ASUS_BASS, 1786 ALC887_FIXUP_ASUS_BASS,
@@ -1884,17 +1885,13 @@ static void alc889_fixup_mbp_vref(struct hda_codec *codec,
1884 } 1885 }
1885} 1886}
1886 1887
1887/* Set VREF on speaker pins on imac91 */ 1888static void alc889_fixup_mac_pins(struct hda_codec *codec,
1888static void alc889_fixup_imac91_vref(struct hda_codec *codec, 1889 const hda_nid_t *nids, int num_nids)
1889 const struct hda_fixup *fix, int action)
1890{ 1890{
1891 struct alc_spec *spec = codec->spec; 1891 struct alc_spec *spec = codec->spec;
1892 static hda_nid_t nids[2] = { 0x18, 0x1a };
1893 int i; 1892 int i;
1894 1893
1895 if (action != HDA_FIXUP_ACT_INIT) 1894 for (i = 0; i < num_nids; i++) {
1896 return;
1897 for (i = 0; i < ARRAY_SIZE(nids); i++) {
1898 unsigned int val; 1895 unsigned int val;
1899 val = snd_hda_codec_get_pin_target(codec, nids[i]); 1896 val = snd_hda_codec_get_pin_target(codec, nids[i]);
1900 val |= AC_PINCTL_VREF_50; 1897 val |= AC_PINCTL_VREF_50;
@@ -1903,6 +1900,26 @@ static void alc889_fixup_imac91_vref(struct hda_codec *codec,
1903 spec->gen.keep_vref_in_automute = 1; 1900 spec->gen.keep_vref_in_automute = 1;
1904} 1901}
1905 1902
1903/* Set VREF on speaker pins on imac91 */
1904static void alc889_fixup_imac91_vref(struct hda_codec *codec,
1905 const struct hda_fixup *fix, int action)
1906{
1907 static hda_nid_t nids[2] = { 0x18, 0x1a };
1908
1909 if (action == HDA_FIXUP_ACT_INIT)
1910 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1911}
1912
1913/* Set VREF on speaker pins on mba21 */
1914static void alc889_fixup_mba21_vref(struct hda_codec *codec,
1915 const struct hda_fixup *fix, int action)
1916{
1917 static hda_nid_t nids[2] = { 0x18, 0x19 };
1918
1919 if (action == HDA_FIXUP_ACT_INIT)
1920 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1921}
1922
1906/* Don't take HP output as primary 1923/* Don't take HP output as primary
1907 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio 1924 * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
1908 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05 1925 * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
@@ -2102,6 +2119,12 @@ static const struct hda_fixup alc882_fixups[] = {
2102 .chained = true, 2119 .chained = true,
2103 .chain_id = ALC882_FIXUP_GPIO1, 2120 .chain_id = ALC882_FIXUP_GPIO1,
2104 }, 2121 },
2122 [ALC889_FIXUP_MBA21_VREF] = {
2123 .type = HDA_FIXUP_FUNC,
2124 .v.func = alc889_fixup_mba21_vref,
2125 .chained = true,
2126 .chain_id = ALC889_FIXUP_MBP_VREF,
2127 },
2105 [ALC882_FIXUP_INV_DMIC] = { 2128 [ALC882_FIXUP_INV_DMIC] = {
2106 .type = HDA_FIXUP_FUNC, 2129 .type = HDA_FIXUP_FUNC,
2107 .v.func = alc_fixup_inv_dmic_0x12, 2130 .v.func = alc_fixup_inv_dmic_0x12,
@@ -2172,7 +2195,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2172 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), 2195 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2173 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), 2196 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2174 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF), 2197 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF),
2175 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBP_VREF), 2198 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2176 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), 2199 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2177 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2200 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2178 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO), 2201 SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),