diff options
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3a9a1b0c1dbe..01fadf0e0b3c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -903,7 +903,7 @@ static int alc_codec_rename(struct hda_codec *codec, const char *name) | |||
903 | } | 903 | } |
904 | 904 | ||
905 | /* | 905 | /* |
906 | * Rename codecs appropriately from COEF value | 906 | * Rename codecs appropriately from COEF value or subvendor id |
907 | */ | 907 | */ |
908 | struct alc_codec_rename_table { | 908 | struct alc_codec_rename_table { |
909 | unsigned int vendor_id; | 909 | unsigned int vendor_id; |
@@ -912,6 +912,13 @@ struct alc_codec_rename_table { | |||
912 | const char *name; | 912 | const char *name; |
913 | }; | 913 | }; |
914 | 914 | ||
915 | struct alc_codec_rename_pci_table { | ||
916 | unsigned int codec_vendor_id; | ||
917 | unsigned short pci_subvendor; | ||
918 | unsigned short pci_subdevice; | ||
919 | const char *name; | ||
920 | }; | ||
921 | |||
915 | static struct alc_codec_rename_table rename_tbl[] = { | 922 | static struct alc_codec_rename_table rename_tbl[] = { |
916 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, | 923 | { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, |
917 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, | 924 | { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, |
@@ -931,9 +938,20 @@ static struct alc_codec_rename_table rename_tbl[] = { | |||
931 | { } /* terminator */ | 938 | { } /* terminator */ |
932 | }; | 939 | }; |
933 | 940 | ||
941 | static struct alc_codec_rename_pci_table rename_pci_tbl[] = { | ||
942 | { 0x10ec0280, 0x1028, 0, "ALC3220" }, | ||
943 | { 0x10ec0282, 0x1028, 0, "ALC3221" }, | ||
944 | { 0x10ec0283, 0x1028, 0, "ALC3223" }, | ||
945 | { 0x10ec0292, 0x1028, 0, "ALC3226" }, | ||
946 | { 0x10ec0255, 0x1028, 0, "ALC3234" }, | ||
947 | { 0x10ec0668, 0x1028, 0, "ALC3661" }, | ||
948 | { } /* terminator */ | ||
949 | }; | ||
950 | |||
934 | static int alc_codec_rename_from_preset(struct hda_codec *codec) | 951 | static int alc_codec_rename_from_preset(struct hda_codec *codec) |
935 | { | 952 | { |
936 | const struct alc_codec_rename_table *p; | 953 | const struct alc_codec_rename_table *p; |
954 | const struct alc_codec_rename_pci_table *q; | ||
937 | 955 | ||
938 | for (p = rename_tbl; p->vendor_id; p++) { | 956 | for (p = rename_tbl; p->vendor_id; p++) { |
939 | if (p->vendor_id != codec->vendor_id) | 957 | if (p->vendor_id != codec->vendor_id) |
@@ -941,6 +959,17 @@ static int alc_codec_rename_from_preset(struct hda_codec *codec) | |||
941 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) | 959 | if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) |
942 | return alc_codec_rename(codec, p->name); | 960 | return alc_codec_rename(codec, p->name); |
943 | } | 961 | } |
962 | |||
963 | for (q = rename_pci_tbl; q->codec_vendor_id; q++) { | ||
964 | if (q->codec_vendor_id != codec->vendor_id) | ||
965 | continue; | ||
966 | if (q->pci_subvendor != codec->bus->pci->subsystem_vendor) | ||
967 | continue; | ||
968 | if (!q->pci_subdevice || | ||
969 | q->pci_subdevice == codec->bus->pci->subsystem_device) | ||
970 | return alc_codec_rename(codec, q->name); | ||
971 | } | ||
972 | |||
944 | return 0; | 973 | return 0; |
945 | } | 974 | } |
946 | 975 | ||