26 #include <linux/module.h>
37 "{Turtle Beach,Tropez Plus},"
38 "{SIC CrystalWave 32},"
39 "{Hewlett Packard,Omnibook 5500},"
40 "{TerraTec,Maestro 32/96},"
42 "{{Crystal Semiconductors,CS4235},"
43 "{Crystal Semiconductors,CS4236},"
44 "{Crystal Semiconductors,CS4237},"
45 "{Crystal Semiconductors,CS4238},"
46 "{Crystal Semiconductors,CS4239},"
50 "{Crystal Computer,TidalWave128},"
51 "{Dell,Optiplex GX1},"
52 "{Dell,Workstation 400 sound},"
53 "{EliteGroup,P5TX-LA sound},"
55 "{Gateway,E1000 Onboard CS4236B},"
56 "{Genius,Sound Maker 3DJ},"
57 "{Hewlett Packard,HP6330 sound},"
58 "{IBM,PC 300PL sound},"
59 "{IBM,Aptiva 2137 E24},"
60 "{IBM,IntelliStation M Pro},"
61 "{Intel,Marlin Spike Mobo CS4235},"
62 "{Intel PR440FX Onboard},"
63 "{Guillemot,MaxiSound 16 PnP},"
65 "{TerraTec,AudioSystem EWS64L/XL},"
66 "{Typhoon Soundsystem,CS4236B},"
67 "{Turtle Beach,Malibu},"
68 "{Unknown,Digital PC 5000 Onboard}}");
72 #define IDENT "CS4232+"
73 #define DEV_NAME "cs4232+"
121 static int isa_registered;
122 static int pnpc_registered;
123 static int pnp_registered;
141 static const struct pnp_device_id snd_cs423x_pnpbiosids[] = {
151 #define CS423X_ISAPNP_DRIVER "cs4232_isapnp"
154 { .
id =
"CSC0d32", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"PNPb006" } } },
156 { .id =
"CSC1a32", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
158 { .id =
"CSC4232", .devs = { {
"CSC0000" }, {
"CSC0002" }, {
"CSC0003" } } },
160 { .id =
"CSC4236", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
162 { .id =
"CSC7532", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSCb006" } } },
164 { .id =
"CSC7632", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"PNPb006" } } },
166 { .id =
"CSCf032", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
168 { .id =
"CSCe825", .devs = { {
"CSC0100" }, {
"CSC0110" }, {
"CSC010f" } } },
170 { .id =
"CSC0225", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
172 { .id =
"CSC0225", .devs = { {
"CSC0100" }, {
"CSC0110" }, {
"CSC0103" } } },
174 { .id =
"CSC0225", .devs = { {
"CSC0100" }, {
"CSC0110" } } },
176 { .id =
"CSC0437", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
178 { .id =
"CSC0735", .devs = { {
"CSC0000" }, {
"CSC0010" } } },
180 { .id =
"CSC0b35", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
182 { .id =
"CSC0b36", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
184 { .id =
"CSC1425", .devs = { {
"CSC0100" }, {
"CSC0110" } } },
186 { .id =
"CSC1335", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
188 { .id =
"CSC1525", .devs = { {
"CSC0100" }, {
"CSC0110" }, {
"CSC0103" } } },
190 { .id =
"CSC1e37", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
192 { .id =
"CSC4236", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
194 { .id =
"CSC4237", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
196 { .id =
"CSC4336", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
198 { .id =
"CSC4536", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
200 { .id =
"CSC4625", .devs = { {
"CSC0100" }, {
"CSC0110" }, {
"CSC0103" } } },
202 { .id =
"CSC4637", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
204 { .id =
"CSC4837", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
206 { .id =
"CSC6835", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
208 { .id =
"CSC6835", .devs = { {
"CSC0000" }, {
"CSC0010" } } },
210 { .id =
"CSC6836", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
212 { .id =
"CSC7537", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
214 { .id =
"CSC8025", .devs = { {
"CSC0100" }, {
"CSC0110" }, {
"CSC0103" } } },
216 { .id =
"CSC8037", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
218 { .id =
"CSCc835", .devs = { {
"CSC0000" }, {
"CSC0010" } } },
220 { .id =
"CSC9836", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
222 { .id =
"CSC9837", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
224 { .id =
"CSCa736", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
226 { .id =
"CSCa836", .devs = { {
"CSCa800" }, {
"CSCa810" }, {
"CSCa803" } } },
228 { .id =
"CSCa836", .devs = { {
"CSCa800" }, {
"CSCa810" } } },
230 { .id =
"CSCd925", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
232 { .id =
"CSCd937", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
234 { .id =
"CSCe825", .devs = { {
"CSC0100" }, {
"CSC0110" } } },
236 { .id =
"CSC4825", .devs = { {
"CSC0100" }, {
"CSC0110" } } },
238 { .id =
"CSCe835", .devs = { {
"CSC0000" }, {
"CSC0010" } } },
240 { .id =
"CSCe836", .devs = { {
"CSC0000" }, {
"CSC0010" } } },
242 { .id =
"CSCe936", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
244 { .id =
"CSCf235", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
246 { .id =
"CSCf238", .devs = { {
"CSC0000" }, {
"CSC0010" }, {
"CSC0003" } } },
260 port[
dev] = pnp_port_start(pdev, 0);
261 if (fm_port[dev] > 0)
262 fm_port[
dev] = pnp_port_start(pdev, 1);
263 sb_port[
dev] = pnp_port_start(pdev, 2);
267 snd_printdd(
"isapnp WSS: wss port=0x%lx, fm port=0x%lx, sb port=0x%lx\n",
268 port[dev], fm_port[dev], sb_port[dev]);
269 snd_printdd(
"isapnp WSS: irq=%i, dma1=%i, dma2=%i\n",
270 irq[dev], dma1[dev], dma2[dev]);
275 static int __devinit snd_cs423x_pnp_init_ctrl(
int dev,
struct pnp_dev *pdev)
281 cport[
dev] = pnp_port_start(pdev, 0);
282 snd_printdd(
"isapnp CTRL: control port=0x%lx\n", cport[dev]);
294 mpu_port[
dev] = pnp_port_start(pdev, 0);
295 if (mpu_irq[dev] >= 0 &&
296 pnp_irq_valid(pdev, 0) &&
pnp_irq(pdev, 0) >= 0) {
302 snd_printdd(
"isapnp MPU: port=0x%lx, irq=%i\n", mpu_port[dev], mpu_irq[dev]);
311 if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0)
314 cport[
dev] = pnp_port_start(cdev, 0);
325 if (acard->wss ==
NULL)
328 if (acard->ctrl ==
NULL)
330 if (id->
devs[2].id[0]) {
332 if (acard->mpu ==
NULL)
337 if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0)
341 if (acard->ctrl && cport[dev] > 0) {
342 if (snd_cs423x_pnp_init_ctrl(dev, acard->ctrl) < 0)
346 if (acard->mpu && mpu_port[dev] > 0) {
347 if (snd_cs423x_pnp_init_mpu(dev, acard->mpu) < 0)
355 #define is_isapnp_selected(dev) isapnp[dev]
357 #define is_isapnp_selected(dev) 0
360 static void snd_card_cs4236_free(
struct snd_card *card)
367 static int snd_cs423x_card_new(
int dev,
struct snd_card **cardp)
398 dma1[dev], dma2[dev],
438 fm_port[dev], fm_port[dev] + 2,
452 mpu_irq[dev],
NULL) < 0)
466 dev_err(pdev,
"please specify port\n");
470 dev_err(pdev,
"please specify cport\n");
474 dev_err(pdev,
"please specify irq\n");
478 dev_err(pdev,
"please specify dma1\n");
490 err = snd_cs423x_card_new(dev, &card);
494 if ((err = snd_cs423x_probe(card, dev)) < 0) {
512 static int snd_cs423x_suspend(
struct snd_card *card)
520 static int snd_cs423x_resume(
struct snd_card *card)
528 static int snd_cs423x_isa_suspend(
struct device *dev,
unsigned int n,
534 static int snd_cs423x_isa_resume(
struct device *dev,
unsigned int n)
540 static struct isa_driver cs423x_isa_driver = {
541 .match = snd_cs423x_isa_match,
542 .probe = snd_cs423x_isa_probe,
545 .suspend = snd_cs423x_isa_suspend,
546 .resume = snd_cs423x_isa_resume,
567 if (
enable[dev] && isapnp[dev])
570 if (dev >= SNDRV_CARDS)
581 err = snd_cs423x_card_new(dev, &card);
584 err = snd_card_cs423x_pnp(dev, card->
private_data, pdev, cdev);
591 if ((err = snd_cs423x_probe(card, dev)) < 0) {
595 pnp_set_drvdata(pdev, card);
603 pnp_set_drvdata(pdev,
NULL);
609 return snd_cs423x_suspend(pnp_get_drvdata(pdev));
612 static int snd_cs423x_pnp_resume(
struct pnp_dev *pdev)
614 return snd_cs423x_resume(pnp_get_drvdata(pdev));
618 static struct pnp_driver cs423x_pnp_driver = {
619 .
name =
"cs423x-pnpbios",
620 .id_table = snd_cs423x_pnpbiosids,
621 .probe = snd_cs423x_pnpbios_detect,
624 .suspend = snd_cs423x_pnp_suspend,
625 .resume = snd_cs423x_pnp_resume,
637 if (
enable[dev] && isapnp[dev])
640 if (dev >= SNDRV_CARDS)
643 res = snd_cs423x_card_new(dev, &card);
646 if ((res = snd_card_cs423x_pnpc(dev, card->
private_data, pcard, pid)) < 0) {
648 " is not supported\n");
653 if ((res = snd_cs423x_probe(card, dev)) < 0) {
657 pnp_set_card_drvdata(pcard, card);
665 pnp_set_card_drvdata(pcard,
NULL);
671 return snd_cs423x_suspend(pnp_get_card_drvdata(pcard));
674 static int snd_cs423x_pnpc_resume(
struct pnp_card_link *pcard)
676 return snd_cs423x_resume(pnp_get_card_drvdata(pcard));
682 .name = CS423X_ISAPNP_DRIVER,
683 .id_table = snd_cs423x_pnpids,
684 .probe = snd_cs423x_pnpc_detect,
687 .suspend = snd_cs423x_pnpc_suspend,
688 .resume = snd_cs423x_pnpc_resume,
693 static int __init alsa_card_cs423x_init(
void)
715 static void __exit alsa_card_cs423x_exit(
void)