26 #include <linux/time.h>
27 #include <linux/wait.h>
28 #include <linux/module.h>
34 #define SNDRV_LEGACY_FIND_FREE_IRQ
35 #define SNDRV_LEGACY_FIND_FREE_DMA
38 #define CRD_NAME "Generic ESS ES1688/ES688 AudioDrive"
39 #define DEV_NAME "es1688"
45 "{ESS,ES1688 PnP AudioDrive,pnp:ESS0102},"
46 "{ESS,ES688 AudioDrive,pnp:ESS6881},"
47 "{ESS,ES1688 AudioDrive,pnp:ESS1681}}");
88 #define is_isapnp_selected(dev) isapnp[dev]
90 #define is_isapnp_selected(dev) 0
102 static long possible_ports[] = {0x220, 0x240, 0x260};
103 static int possible_irqs[] = {5, 9, 10, 7, -1};
104 static int possible_dmas[] = {1, 3, 0, -1};
109 irq[
n] = snd_legacy_find_free_irq(possible_irqs);
111 dev_err(dev,
"unable to find a free IRQ\n");
116 dma8[
n] = snd_legacy_find_free_dma(possible_dmas);
118 dev_err(dev,
"unable to find a free DMA\n");
129 port[
n] = possible_ports[
i];
132 }
while (error < 0 && ++i <
ARRAY_SIZE(possible_ports));
155 "%s at 0x%lx, irq %i, dma %i", pcm->
name, chip->
port,
161 if (fm_port[n] > 0) {
165 "opl3 not detected at 0x%lx\n", fm_port[n]);
185 static int __devinit snd_es1688_isa_probe(
struct device *dev,
unsigned int n)
195 error = snd_es1688_legacy_create(card, dev, n);
201 error = snd_es1688_probe(card, n);
213 static int __devexit snd_es1688_isa_remove(
struct device *dev,
unsigned int n)
220 static struct isa_driver snd_es1688_driver = {
221 .match = snd_es1688_match,
222 .probe = snd_es1688_isa_probe,
225 .suspend = snd_es1688_suspend,
226 .resume = snd_es1688_resume,
233 static int snd_es968_pnp_is_probed;
253 port[
n] = pnp_port_start(pdev, 0);
265 static unsigned int dev;
269 if (snd_es968_pnp_is_probed)
272 if (
enable[dev] && isapnp[dev])
275 if (dev == SNDRV_CARDS)
284 error = snd_card_es968_pnp(card, dev, pcard, pid);
290 error = snd_es1688_probe(card, dev);
293 pnp_set_card_drvdata(pcard, card);
294 snd_es968_pnp_is_probed = 1;
301 pnp_set_card_drvdata(pcard,
NULL);
302 snd_es968_pnp_is_probed = 0;
306 static int snd_es968_pnp_suspend(
struct pnp_card_link *pcard,
309 struct snd_card *card = pnp_get_card_drvdata(pcard);
313 snd_pcm_suspend_all(chip->
pcm);
319 struct snd_card *card = pnp_get_card_drvdata(pcard);
329 { .
id =
"ESS0968", .devs = { {
"@@@0968" }, } },
330 { .id =
"ESS0968", .devs = { {
"ESS0968" }, } },
339 .id_table = snd_es968_pnpids,
340 .probe = snd_es968_pnp_detect,
343 .suspend = snd_es968_pnp_suspend,
344 .resume = snd_es968_pnp_resume,
349 static int __init alsa_card_es1688_init(
void)
353 if (snd_es968_pnp_is_probed)
360 static void __exit alsa_card_es1688_exit(
void)
362 if (!snd_es968_pnp_is_probed) {