aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ac97/ac97_codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ac97/ac97_codec.c')
-rw-r--r--sound/pci/ac97/ac97_codec.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 8c49a00a5e39..6704acbca8c0 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -67,8 +67,8 @@ struct ac97_codec_id {
67}; 67};
68 68
69static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = { 69static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = {
70{ 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL },
71{ 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL }, 70{ 0x41445300, 0xffffff00, "Analog Devices", NULL, NULL },
71{ 0x414b4d00, 0xffffff00, "Asahi Kasei", NULL, NULL },
72{ 0x414c4300, 0xffffff00, "Realtek", NULL, NULL }, 72{ 0x414c4300, 0xffffff00, "Realtek", NULL, NULL },
73{ 0x414c4700, 0xffffff00, "Realtek", NULL, NULL }, 73{ 0x414c4700, 0xffffff00, "Realtek", NULL, NULL },
74{ 0x434d4900, 0xffffff00, "C-Media Electronics", NULL, NULL }, 74{ 0x434d4900, 0xffffff00, "C-Media Electronics", NULL, NULL },
@@ -94,11 +94,6 @@ static const struct ac97_codec_id snd_ac97_codec_id_vendors[] = {
94}; 94};
95 95
96static const struct ac97_codec_id snd_ac97_codec_ids[] = { 96static const struct ac97_codec_id snd_ac97_codec_ids[] = {
97{ 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL },
98{ 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL },
99{ 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL },
100{ 0x414b4d06, 0xffffffff, "AK4544A", NULL, NULL },
101{ 0x414b4d07, 0xffffffff, "AK4545", NULL, NULL },
102{ 0x41445303, 0xffffffff, "AD1819", patch_ad1819, NULL }, 97{ 0x41445303, 0xffffffff, "AD1819", patch_ad1819, NULL },
103{ 0x41445340, 0xffffffff, "AD1881", patch_ad1881, NULL }, 98{ 0x41445340, 0xffffffff, "AD1881", patch_ad1881, NULL },
104{ 0x41445348, 0xffffffff, "AD1881A", patch_ad1881, NULL }, 99{ 0x41445348, 0xffffffff, "AD1881A", patch_ad1881, NULL },
@@ -112,20 +107,25 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
112{ 0x41445374, 0xffffffff, "AD1981B", patch_ad1981b, NULL }, 107{ 0x41445374, 0xffffffff, "AD1981B", patch_ad1981b, NULL },
113{ 0x41445375, 0xffffffff, "AD1985", patch_ad1985, NULL }, 108{ 0x41445375, 0xffffffff, "AD1985", patch_ad1985, NULL },
114{ 0x41445378, 0xffffffff, "AD1986", patch_ad1986, NULL }, 109{ 0x41445378, 0xffffffff, "AD1986", patch_ad1986, NULL },
110{ 0x414b4d00, 0xffffffff, "AK4540", NULL, NULL },
111{ 0x414b4d01, 0xffffffff, "AK4542", NULL, NULL },
112{ 0x414b4d02, 0xffffffff, "AK4543", NULL, NULL },
113{ 0x414b4d06, 0xffffffff, "AK4544A", NULL, NULL },
114{ 0x414b4d07, 0xffffffff, "AK4545", NULL, NULL },
115{ 0x414c4300, 0xffffff00, "ALC100,100P", NULL, NULL }, 115{ 0x414c4300, 0xffffff00, "ALC100,100P", NULL, NULL },
116{ 0x414c4710, 0xfffffff0, "ALC200,200P", NULL, NULL }, 116{ 0x414c4710, 0xfffffff0, "ALC200,200P", NULL, NULL },
117{ 0x414c4721, 0xffffffff, "ALC650D", NULL, NULL }, /* already patched */ 117{ 0x414c4721, 0xffffffff, "ALC650D", NULL, NULL }, /* already patched */
118{ 0x414c4722, 0xffffffff, "ALC650E", NULL, NULL }, /* already patched */ 118{ 0x414c4722, 0xffffffff, "ALC650E", NULL, NULL }, /* already patched */
119{ 0x414c4723, 0xffffffff, "ALC650F", NULL, NULL }, /* already patched */ 119{ 0x414c4723, 0xffffffff, "ALC650F", NULL, NULL }, /* already patched */
120{ 0x414c4720, 0xfffffff0, "ALC650", patch_alc650, NULL }, 120{ 0x414c4720, 0xfffffff0, "ALC650", patch_alc650, NULL },
121{ 0x414c4730, 0xffffffff, "ALC101", NULL, NULL },
122{ 0x414c4740, 0xfffffff0, "ALC202", NULL, NULL },
123{ 0x414c4750, 0xfffffff0, "ALC250", NULL, NULL },
121{ 0x414c4760, 0xfffffff0, "ALC655", patch_alc655, NULL }, 124{ 0x414c4760, 0xfffffff0, "ALC655", patch_alc655, NULL },
125{ 0x414c4770, 0xfffffff0, "ALC203", patch_alc203, NULL },
122{ 0x414c4781, 0xffffffff, "ALC658D", NULL, NULL }, /* already patched */ 126{ 0x414c4781, 0xffffffff, "ALC658D", NULL, NULL }, /* already patched */
123{ 0x414c4780, 0xfffffff0, "ALC658", patch_alc655, NULL }, 127{ 0x414c4780, 0xfffffff0, "ALC658", patch_alc655, NULL },
124{ 0x414c4790, 0xfffffff0, "ALC850", patch_alc850, NULL }, 128{ 0x414c4790, 0xfffffff0, "ALC850", patch_alc850, NULL },
125{ 0x414c4730, 0xffffffff, "ALC101", NULL, NULL },
126{ 0x414c4740, 0xfffffff0, "ALC202", NULL, NULL },
127{ 0x414c4750, 0xfffffff0, "ALC250", NULL, NULL },
128{ 0x414c4770, 0xfffffff0, "ALC203", NULL, NULL },
129{ 0x434d4941, 0xffffffff, "CMI9738", patch_cm9738, NULL }, 129{ 0x434d4941, 0xffffffff, "CMI9738", patch_cm9738, NULL },
130{ 0x434d4961, 0xffffffff, "CMI9739", patch_cm9739, NULL }, 130{ 0x434d4961, 0xffffffff, "CMI9739", patch_cm9739, NULL },
131{ 0x434d4969, 0xffffffff, "CMI9780", patch_cm9780, NULL }, 131{ 0x434d4969, 0xffffffff, "CMI9780", patch_cm9780, NULL },
@@ -168,7 +168,7 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = {
168{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL }, 168{ 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL },
169{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232 with S/PDIF 169{ 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232 with S/PDIF
170{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF 170{ 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF
171{ 0x56494182, 0xffffffff, "VIA1618", NULL, NULL }, 171{ 0x56494182, 0xffffffff, "VIA1618", patch_vt1618, NULL },
172{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL }, 172{ 0x57454301, 0xffffffff, "W83971D", NULL, NULL },
173{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL }, 173{ 0x574d4c00, 0xffffffff, "WM9701,WM9701A", NULL, NULL },
174{ 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL}, 174{ 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL},
@@ -1890,8 +1890,8 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
1890 .dev_free = snd_ac97_bus_dev_free, 1890 .dev_free = snd_ac97_bus_dev_free,
1891 }; 1891 };
1892 1892
1893 snd_assert(card != NULL, return -EINVAL); 1893 if (snd_BUG_ON(!card))
1894 snd_assert(rbus != NULL, return -EINVAL); 1894 return -EINVAL;
1895 bus = kzalloc(sizeof(*bus), GFP_KERNEL); 1895 bus = kzalloc(sizeof(*bus), GFP_KERNEL);
1896 if (bus == NULL) 1896 if (bus == NULL)
1897 return -ENOMEM; 1897 return -ENOMEM;
@@ -1906,7 +1906,8 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
1906 snd_ac97_bus_free(bus); 1906 snd_ac97_bus_free(bus);
1907 return err; 1907 return err;
1908 } 1908 }
1909 *rbus = bus; 1909 if (rbus)
1910 *rbus = bus;
1910 return 0; 1911 return 0;
1911} 1912}
1912 1913
@@ -1991,10 +1992,14 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
1991 .dev_disconnect = snd_ac97_dev_disconnect, 1992 .dev_disconnect = snd_ac97_dev_disconnect,
1992 }; 1993 };
1993 1994
1994 snd_assert(rac97 != NULL, return -EINVAL); 1995 if (rac97)
1995 *rac97 = NULL; 1996 *rac97 = NULL;
1996 snd_assert(bus != NULL && template != NULL, return -EINVAL); 1997 if (snd_BUG_ON(!bus || !template))
1997 snd_assert(template->num < 4 && bus->codec[template->num] == NULL, return -EINVAL); 1998 return -EINVAL;
1999 if (snd_BUG_ON(template->num >= 4))
2000 return -EINVAL;
2001 if (bus->codec[template->num])
2002 return -EBUSY;
1998 2003
1999 card = bus->card; 2004 card = bus->card;
2000 ac97 = kzalloc(sizeof(*ac97), GFP_KERNEL); 2005 ac97 = kzalloc(sizeof(*ac97), GFP_KERNEL);