diff options
author | Kailang Yang <kailang@realtek.com> | 2017-04-25 04:17:40 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-04-26 06:13:37 -0400 |
commit | ca169cc2f9e1f8ed9c867b197a49d6dd05e5436d (patch) | |
tree | 8d571ac87189e730df5b78c723016e94381c9178 | |
parent | 610793fe2b1c7ced8ca5c06a8d8e892aae72c3f2 (diff) |
ALSA: hda/realtek - Add Dual Codecs support for Lenovo P520/420
Lenovo P520/420 build with two codecs.
ALC233 for front panel.
ALC662 for rear panel.
This patch will rename capture name for slove conflicts.
And create a card longname for UCM profile.
Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 93846bf65a23..58df440013c5 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4824,6 +4824,30 @@ static void alc280_fixup_hp_9480m(struct hda_codec *codec, | |||
4824 | } | 4824 | } |
4825 | } | 4825 | } |
4826 | 4826 | ||
4827 | static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, | ||
4828 | const struct hda_fixup *fix, | ||
4829 | int action) | ||
4830 | { | ||
4831 | alc_fixup_dual_codecs(codec, fix, action); | ||
4832 | switch (action) { | ||
4833 | case HDA_FIXUP_ACT_PRE_PROBE: | ||
4834 | /* override card longname to provide a unique UCM profile */ | ||
4835 | strcpy(codec->card->longname, "HDAudio-Lenovo-DualCodecs"); | ||
4836 | break; | ||
4837 | case HDA_FIXUP_ACT_BUILD: | ||
4838 | /* rename Capture controls depending on the codec */ | ||
4839 | rename_ctl(codec, "Capture Volume", | ||
4840 | codec->addr == 0 ? | ||
4841 | "Rear-Panel Capture Volume" : | ||
4842 | "Front-Panel Capture Volume"); | ||
4843 | rename_ctl(codec, "Capture Switch", | ||
4844 | codec->addr == 0 ? | ||
4845 | "Rear-Panel Capture Switch" : | ||
4846 | "Front-Panel Capture Switch"); | ||
4847 | break; | ||
4848 | } | ||
4849 | } | ||
4850 | |||
4827 | /* for hda_fixup_thinkpad_acpi() */ | 4851 | /* for hda_fixup_thinkpad_acpi() */ |
4828 | #include "thinkpad_helper.c" | 4852 | #include "thinkpad_helper.c" |
4829 | 4853 | ||
@@ -4937,6 +4961,7 @@ enum { | |||
4937 | ALC256_FIXUP_ASUS_AIO_GPIO2, | 4961 | ALC256_FIXUP_ASUS_AIO_GPIO2, |
4938 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, | 4962 | ALC233_FIXUP_ASUS_MIC_NO_PRESENCE, |
4939 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, | 4963 | ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE, |
4964 | ALC233_FIXUP_LENOVO_MULTI_CODECS, | ||
4940 | }; | 4965 | }; |
4941 | 4966 | ||
4942 | static const struct hda_fixup alc269_fixups[] = { | 4967 | static const struct hda_fixup alc269_fixups[] = { |
@@ -5706,6 +5731,10 @@ static const struct hda_fixup alc269_fixups[] = { | |||
5706 | .chained = true, | 5731 | .chained = true, |
5707 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE | 5732 | .chain_id = ALC233_FIXUP_ASUS_MIC_NO_PRESENCE |
5708 | }, | 5733 | }, |
5734 | [ALC233_FIXUP_LENOVO_MULTI_CODECS] = { | ||
5735 | .type = HDA_FIXUP_FUNC, | ||
5736 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | ||
5737 | }, | ||
5709 | }; | 5738 | }; |
5710 | 5739 | ||
5711 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 5740 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -5860,6 +5889,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
5860 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), | 5889 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
5861 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), | 5890 | SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
5862 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), | 5891 | SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), |
5892 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), | ||
5863 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), | 5893 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), |
5864 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), | 5894 | SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), |
5865 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), | 5895 | SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), |
@@ -6881,6 +6911,7 @@ enum { | |||
6881 | ALC892_FIXUP_ASROCK_MOBO, | 6911 | ALC892_FIXUP_ASROCK_MOBO, |
6882 | ALC662_FIXUP_USI_FUNC, | 6912 | ALC662_FIXUP_USI_FUNC, |
6883 | ALC662_FIXUP_USI_HEADSET_MODE, | 6913 | ALC662_FIXUP_USI_HEADSET_MODE, |
6914 | ALC662_FIXUP_LENOVO_MULTI_CODECS, | ||
6884 | }; | 6915 | }; |
6885 | 6916 | ||
6886 | static const struct hda_fixup alc662_fixups[] = { | 6917 | static const struct hda_fixup alc662_fixups[] = { |
@@ -7186,6 +7217,10 @@ static const struct hda_fixup alc662_fixups[] = { | |||
7186 | .chained = true, | 7217 | .chained = true, |
7187 | .chain_id = ALC662_FIXUP_USI_FUNC | 7218 | .chain_id = ALC662_FIXUP_USI_FUNC |
7188 | }, | 7219 | }, |
7220 | [ALC662_FIXUP_LENOVO_MULTI_CODECS] = { | ||
7221 | .type = HDA_FIXUP_FUNC, | ||
7222 | .v.func = alc233_alc662_fixup_lenovo_dual_codecs, | ||
7223 | }, | ||
7189 | }; | 7224 | }; |
7190 | 7225 | ||
7191 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { | 7226 | static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
@@ -7223,6 +7258,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { | |||
7223 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), | 7258 | SND_PCI_QUIRK(0x105b, 0x0cd6, "Foxconn", ALC662_FIXUP_ASUS_MODE2), |
7224 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), | 7259 | SND_PCI_QUIRK(0x144d, 0xc051, "Samsung R720", ALC662_FIXUP_IDEAPAD), |
7225 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), | 7260 | SND_PCI_QUIRK(0x14cd, 0x5003, "USI", ALC662_FIXUP_USI_HEADSET_MODE), |
7261 | SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC662_FIXUP_LENOVO_MULTI_CODECS), | ||
7226 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), | 7262 | SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo Ideapad Y550P", ALC662_FIXUP_IDEAPAD), |
7227 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), | 7263 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD), |
7228 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), | 7264 | SND_PCI_QUIRK(0x1849, 0x5892, "ASRock B150M", ALC892_FIXUP_ASROCK_MOBO), |