aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/als100.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/als100.c')
-rw-r--r--sound/isa/als100.c121
1 files changed, 86 insertions, 35 deletions
diff --git a/sound/isa/als100.c b/sound/isa/als100.c
index 5fd52e4d7079..20becc89f6f6 100644
--- a/sound/isa/als100.c
+++ b/sound/isa/als100.c
@@ -2,9 +2,13 @@
2/* 2/*
3 card-als100.c - driver for Avance Logic ALS100 based soundcards. 3 card-als100.c - driver for Avance Logic ALS100 based soundcards.
4 Copyright (C) 1999-2000 by Massimo Piccioni <dafastidio@libero.it> 4 Copyright (C) 1999-2000 by Massimo Piccioni <dafastidio@libero.it>
5 Copyright (C) 1999-2002 by Massimo Piccioni <dafastidio@libero.it>
5 6
6 Thanks to Pierfrancesco 'qM2' Passerini. 7 Thanks to Pierfrancesco 'qM2' Passerini.
7 8
9 Generalised for soundcards based on DT-0196 and ALS-007 chips
10 by Jonathan Woithe <jwoithe@physics.adelaide.edu.au>: June 2002.
11
8 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 13 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or 14 the Free Software Foundation; either version 2 of the License, or
@@ -33,10 +37,10 @@
33 37
34#define PFX "als100: " 38#define PFX "als100: "
35 39
36MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>"); 40MODULE_DESCRIPTION("Avance Logic ALS007/ALS1X0");
37MODULE_DESCRIPTION("Avance Logic ALS1X0"); 41MODULE_SUPPORTED_DEVICE("{{Diamond Technologies DT-019X},"
38MODULE_LICENSE("GPL"); 42 "{Avance Logic ALS-007}}"
39MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS100 - PRO16PNP}," 43 "{{Avance Logic,ALS100 - PRO16PNP},"
40 "{Avance Logic,ALS110}," 44 "{Avance Logic,ALS110},"
41 "{Avance Logic,ALS120}," 45 "{Avance Logic,ALS120},"
42 "{Avance Logic,ALS200}," 46 "{Avance Logic,ALS200},"
@@ -45,9 +49,12 @@ MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS100 - PRO16PNP},"
45 "{Avance Logic,ALS120}," 49 "{Avance Logic,ALS120},"
46 "{RTL,RTL3000}}"); 50 "{RTL,RTL3000}}");
47 51
52MODULE_AUTHOR("Massimo Piccioni <dafastidio@libero.it>");
53MODULE_LICENSE("GPL");
54
48static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 55static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
49static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 56static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
50static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 57static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
51static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 58static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
52static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 59static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
53static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 60static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
@@ -57,14 +64,15 @@ static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* PnP setup */
57static int dma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* PnP setup */ 64static int dma16[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* PnP setup */
58 65
59module_param_array(index, int, NULL, 0444); 66module_param_array(index, int, NULL, 0444);
60MODULE_PARM_DESC(index, "Index value for als100 based soundcard."); 67MODULE_PARM_DESC(index, "Index value for Avance Logic based soundcard.");
61module_param_array(id, charp, NULL, 0444); 68module_param_array(id, charp, NULL, 0444);
62MODULE_PARM_DESC(id, "ID string for als100 based soundcard."); 69MODULE_PARM_DESC(id, "ID string for Avance Logic based soundcard.");
63module_param_array(enable, bool, NULL, 0444); 70module_param_array(enable, bool, NULL, 0444);
64MODULE_PARM_DESC(enable, "Enable als100 based soundcard."); 71MODULE_PARM_DESC(enable, "Enable Avance Logic based soundcard.");
72
73MODULE_ALIAS("snd-dt019x");
65 74
66struct snd_card_als100 { 75struct snd_card_als100 {
67 int dev_no;
68 struct pnp_dev *dev; 76 struct pnp_dev *dev;
69 struct pnp_dev *devmpu; 77 struct pnp_dev *devmpu;
70 struct pnp_dev *devopl; 78 struct pnp_dev *devopl;
@@ -72,25 +80,43 @@ struct snd_card_als100 {
72}; 80};
73 81
74static struct pnp_card_device_id snd_als100_pnpids[] = { 82static struct pnp_card_device_id snd_als100_pnpids[] = {
83 /* DT197A30 */
84 { .id = "RWB1688",
85 .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } },
86 .driver_data = SB_HW_DT019X },
87 /* DT0196 / ALS-007 */
88 { .id = "ALS0007",
89 .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } },
90 .driver_data = SB_HW_DT019X },
75 /* ALS100 - PRO16PNP */ 91 /* ALS100 - PRO16PNP */
76 { .id = "ALS0001", .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } } }, 92 { .id = "ALS0001",
93 .devs = { { "@@@0001" }, { "@X@0001" }, { "@H@0001" } },
94 .driver_data = SB_HW_ALS100 },
77 /* ALS110 - MF1000 - Digimate 3D Sound */ 95 /* ALS110 - MF1000 - Digimate 3D Sound */
78 { .id = "ALS0110", .devs = { { "@@@1001" }, { "@X@1001" }, { "@H@1001" } } }, 96 { .id = "ALS0110",
97 .devs = { { "@@@1001" }, { "@X@1001" }, { "@H@1001" } },
98 .driver_data = SB_HW_ALS100 },
79 /* ALS120 */ 99 /* ALS120 */
80 { .id = "ALS0120", .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" } } }, 100 { .id = "ALS0120",
101 .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" } },
102 .driver_data = SB_HW_ALS100 },
81 /* ALS200 */ 103 /* ALS200 */
82 { .id = "ALS0200", .devs = { { "@@@0020" }, { "@X@0020" }, { "@H@0001" } } }, 104 { .id = "ALS0200",
105 .devs = { { "@@@0020" }, { "@X@0020" }, { "@H@0001" } },
106 .driver_data = SB_HW_ALS100 },
83 /* ALS200 OEM */ 107 /* ALS200 OEM */
84 { .id = "ALS0200", .devs = { { "@@@0020" }, { "@X@0020" }, { "@H@0020" } } }, 108 { .id = "ALS0200",
109 .devs = { { "@@@0020" }, { "@X@0020" }, { "@H@0020" } },
110 .driver_data = SB_HW_ALS100 },
85 /* RTL3000 */ 111 /* RTL3000 */
86 { .id = "RTL3000", .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" } } }, 112 { .id = "RTL3000",
87 { .id = "", } /* end */ 113 .devs = { { "@@@2001" }, { "@X@2001" }, { "@H@2001" } },
114 .driver_data = SB_HW_ALS100 },
115 { .id = "" } /* end */
88}; 116};
89 117
90MODULE_DEVICE_TABLE(pnp_card, snd_als100_pnpids); 118MODULE_DEVICE_TABLE(pnp_card, snd_als100_pnpids);
91 119
92#define DRIVER_NAME "snd-card-als100"
93
94static int __devinit snd_card_als100_pnp(int dev, struct snd_card_als100 *acard, 120static int __devinit snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
95 struct pnp_card_link *card, 121 struct pnp_card_link *card,
96 const struct pnp_card_device_id *id) 122 const struct pnp_card_device_id *id)
@@ -113,8 +139,12 @@ static int __devinit snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
113 return err; 139 return err;
114 } 140 }
115 port[dev] = pnp_port_start(pdev, 0); 141 port[dev] = pnp_port_start(pdev, 0);
116 dma8[dev] = pnp_dma(pdev, 1); 142 if (id->driver_data == SB_HW_DT019X)
117 dma16[dev] = pnp_dma(pdev, 0); 143 dma8[dev] = pnp_dma(pdev, 0);
144 else {
145 dma8[dev] = pnp_dma(pdev, 1);
146 dma16[dev] = pnp_dma(pdev, 0);
147 }
118 irq[dev] = pnp_irq(pdev, 0); 148 irq[dev] = pnp_irq(pdev, 0);
119 149
120 pdev = acard->devmpu; 150 pdev = acard->devmpu;
@@ -175,22 +205,33 @@ static int __devinit snd_card_als100_probe(int dev,
175 } 205 }
176 snd_card_set_dev(card, &pcard->card->dev); 206 snd_card_set_dev(card, &pcard->card->dev);
177 207
178 if ((error = snd_sbdsp_create(card, port[dev], 208 if (pid->driver_data == SB_HW_DT019X)
179 irq[dev], 209 dma16[dev] = -1;
180 snd_sb16dsp_interrupt, 210
181 dma8[dev], 211 error = snd_sbdsp_create(card, port[dev], irq[dev],
182 dma16[dev], 212 snd_sb16dsp_interrupt,
183 SB_HW_ALS100, &chip)) < 0) { 213 dma8[dev], dma16[dev],
214 pid->driver_data,
215 &chip);
216 if (error < 0) {
184 snd_card_free(card); 217 snd_card_free(card);
185 return error; 218 return error;
186 } 219 }
187 acard->chip = chip; 220 acard->chip = chip;
188 221
189 strcpy(card->driver, "ALS100"); 222 if (pid->driver_data == SB_HW_DT019X) {
190 strcpy(card->shortname, "Avance Logic ALS100"); 223 strcpy(card->driver, "DT-019X");
191 sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d", 224 strcpy(card->shortname, "Diamond Tech. DT-019X");
192 card->shortname, chip->name, chip->port, 225 sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d",
193 irq[dev], dma8[dev], dma16[dev]); 226 card->shortname, chip->name, chip->port,
227 irq[dev], dma8[dev]);
228 } else {
229 strcpy(card->driver, "ALS100");
230 strcpy(card->shortname, "Avance Logic ALS100");
231 sprintf(card->longname, "%s, %s at 0x%lx, irq %d, dma %d&%d",
232 card->shortname, chip->name, chip->port,
233 irq[dev], dma8[dev], dma16[dev]);
234 }
194 235
195 if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) { 236 if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) {
196 snd_card_free(card); 237 snd_card_free(card);
@@ -203,9 +244,19 @@ static int __devinit snd_card_als100_probe(int dev,
203 } 244 }
204 245
205 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) { 246 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
206 if (snd_mpu401_uart_new(card, 0, MPU401_HW_ALS100, 247 int mpu_type = MPU401_HW_ALS100;
248
249 if (mpu_irq[dev] == SNDRV_AUTO_IRQ)
250 mpu_irq[dev] = -1;
251
252 if (pid->driver_data == SB_HW_DT019X)
253 mpu_type = MPU401_HW_MPU401;
254
255 if (snd_mpu401_uart_new(card, 0,
256 mpu_type,
207 mpu_port[dev], 0, 257 mpu_port[dev], 0,
208 mpu_irq[dev], IRQF_DISABLED, 258 mpu_irq[dev],
259 mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0,
209 NULL) < 0) 260 NULL) < 0)
210 snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]); 261 snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
211 } 262 }
@@ -291,7 +342,7 @@ static int snd_als100_pnp_resume(struct pnp_card_link *pcard)
291 342
292static struct pnp_card_driver als100_pnpc_driver = { 343static struct pnp_card_driver als100_pnpc_driver = {
293 .flags = PNP_DRIVER_RES_DISABLE, 344 .flags = PNP_DRIVER_RES_DISABLE,
294 .name = "als100", 345 .name = "als100",
295 .id_table = snd_als100_pnpids, 346 .id_table = snd_als100_pnpids,
296 .probe = snd_als100_pnp_detect, 347 .probe = snd_als100_pnp_detect,
297 .remove = __devexit_p(snd_als100_pnp_remove), 348 .remove = __devexit_p(snd_als100_pnp_remove),
@@ -312,7 +363,7 @@ static int __init alsa_card_als100_init(void)
312 if (!als100_devices) { 363 if (!als100_devices) {
313 pnp_unregister_card_driver(&als100_pnpc_driver); 364 pnp_unregister_card_driver(&als100_pnpc_driver);
314#ifdef MODULE 365#ifdef MODULE
315 snd_printk(KERN_ERR "no ALS100 based soundcards found\n"); 366 snd_printk(KERN_ERR "no Avance Logic based soundcards found\n");
316#endif 367#endif
317 return -ENODEV; 368 return -ENODEV;
318 } 369 }