35 #include <linux/time.h>
36 #include <linux/wait.h>
38 #include <linux/module.h>
45 #define PFX "azt2320: "
51 "{Aztech Systems,AZT2320},"
52 "{Aztech Systems,AZT3300},"
53 "{Aztech Systems,AZT2320},"
54 "{Aztech Systems,AZT3000}}");
84 { .id =
"AZT1008", .devs = { {
"AZT1008" }, {
"AZT2001" }, } },
86 { .id =
"AZT2320", .devs = { {
"AZT0001" }, {
"AZT0002" }, } },
88 { .id =
"AZT3000", .devs = { {
"AZT1003" }, {
"AZT2001" }, } },
90 { .id =
"AZT3002", .devs = { {
"AZT1004" }, {
"AZT2001" }, } },
92 { .id =
"AZT3005", .devs = { {
"AZT1003" }, {
"AZT2001" }, } },
94 { .id =
"AZT3011", .devs = { {
"AZT1003" }, {
"AZT2001" }, } },
100 #define DRIVER_NAME "snd-card-azt2320"
122 port[
dev] = pnp_port_start(pdev, 0);
123 fm_port[
dev] = pnp_port_start(pdev, 1);
124 wss_port[
dev] = pnp_port_start(pdev, 2);
134 mpu_port[
dev] = pnp_port_start(pdev, 0);
150 static int __devinit snd_card_azt2320_command(
unsigned long port,
unsigned char val)
156 for (i = 50000; i &&
time_after(limit, jiffies); i--)
157 if (!(
inb(port + 0x0c) & 0x80)) {
158 outb(val, port + 0x0c);
164 static int __devinit snd_card_azt2320_enable_wss(
unsigned long port)
168 if ((error = snd_card_azt2320_command(port, 0x09)))
170 if ((error = snd_card_azt2320_command(port, 0x00)))
193 if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) {
199 if ((error = snd_card_azt2320_enable_wss(port[dev]))) {
206 dma1[dev], dma2[dev],
216 card->
shortname, chip->
port, irq[dev], dma1[dev], dma2[dev]);
237 mpu_irq[dev],
NULL) < 0)
243 fm_port[dev], fm_port[dev] + 2,
246 fm_port[dev], fm_port[dev] + 2);
263 pnp_set_card_drvdata(pcard, card);
278 res = snd_card_azt2320_probe(dev, card,
id);
291 pnp_set_card_drvdata(pcard,
NULL);
297 struct snd_card *card = pnp_get_card_drvdata(pcard);
306 static int snd_azt2320_pnp_resume(
struct pnp_card_link *pcard)
308 struct snd_card *card = pnp_get_card_drvdata(pcard);
321 .id_table = snd_azt2320_pnpids,
322 .probe = snd_azt2320_pnp_detect,
325 .suspend = snd_azt2320_pnp_suspend,
326 .resume = snd_azt2320_pnp_resume,
330 static int __init alsa_card_azt2320_init(
void)
338 if (!azt2320_devices) {
348 static void __exit alsa_card_azt2320_exit(
void)