aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /sound/isa
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/Kconfig16
-rw-r--r--sound/isa/Makefile2
-rw-r--r--sound/isa/ad1816a/ad1816a.c86
-rw-r--r--sound/isa/ad1816a/ad1816a_lib.c57
-rw-r--r--sound/isa/ad1848/ad1848.c14
-rw-r--r--sound/isa/adlib.c10
-rw-r--r--sound/isa/als100.c31
-rw-r--r--sound/isa/azt2320.c33
-rw-r--r--sound/isa/cmi8328.c483
-rw-r--r--sound/isa/cmi8330.c50
-rw-r--r--sound/isa/cs423x/cs4231.c13
-rw-r--r--sound/isa/cs423x/cs4236.c59
-rw-r--r--sound/isa/es1688/es1688.c36
-rw-r--r--sound/isa/es1688/es1688_lib.c35
-rw-r--r--sound/isa/es18xx.c92
-rw-r--r--sound/isa/galaxy/galaxy.c31
-rw-r--r--sound/isa/gus/gus_main.c3
-rw-r--r--sound/isa/gus/gus_volume.c1
-rw-r--r--sound/isa/gus/gusclassic.c19
-rw-r--r--sound/isa/gus/gusextreme.c31
-rw-r--r--sound/isa/gus/gusmax.c22
-rw-r--r--sound/isa/gus/interwave.c67
-rw-r--r--sound/isa/msnd/msnd.c1
-rw-r--r--sound/isa/msnd/msnd.h2
-rw-r--r--sound/isa/msnd/msnd_midi.c1
-rw-r--r--sound/isa/msnd/msnd_pinnacle.c48
-rw-r--r--sound/isa/msnd/msnd_pinnacle_mixer.c3
-rw-r--r--sound/isa/opl3sa2.c53
-rw-r--r--sound/isa/opti9xx/miro.c91
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c152
-rw-r--r--sound/isa/sb/emu8000.c46
-rw-r--r--sound/isa/sb/emu8000_callback.c3
-rw-r--r--sound/isa/sb/emu8000_synth.c1
-rw-r--r--sound/isa/sb/jazz16.c21
-rw-r--r--sound/isa/sb/sb16.c37
-rw-r--r--sound/isa/sb/sb16_csp.c1
-rw-r--r--sound/isa/sb/sb16_main.c1
-rw-r--r--sound/isa/sb/sb8.c12
-rw-r--r--sound/isa/sb/sb8_main.c1
-rw-r--r--sound/isa/sb/sb_common.c3
-rw-r--r--sound/isa/sc6000.c43
-rw-r--r--sound/isa/sscape.c43
-rw-r--r--sound/isa/wavefront/wavefront.c66
-rw-r--r--sound/isa/wavefront/wavefront_fx.c3
-rw-r--r--sound/isa/wavefront/wavefront_midi.c2
-rw-r--r--sound/isa/wavefront/wavefront_synth.c17
-rw-r--r--sound/isa/wss/wss_lib.c8
47 files changed, 630 insertions, 1220 deletions
diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
index affa1348065..52064cfa91f 100644
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -117,18 +117,6 @@ config SND_AZT2320
117 To compile this driver as a module, choose M here: the module 117 To compile this driver as a module, choose M here: the module
118 will be called snd-azt2320. 118 will be called snd-azt2320.
119 119
120config SND_CMI8328
121 tristate "C-Media CMI8328"
122 select SND_WSS_LIB
123 select SND_OPL3_LIB
124 select SND_MPU401_UART
125 help
126 Say Y here to include support for soundcards based on the
127 C-Media CMI8328 chip.
128
129 To compile this driver as a module, choose M here: the module
130 will be called snd-cmi8328.
131
132config SND_CMI8330 120config SND_CMI8330
133 tristate "C-Media CMI8330" 121 tristate "C-Media CMI8330"
134 select SND_WSS_LIB 122 select SND_WSS_LIB
@@ -425,7 +413,7 @@ config SND_WAVEFRONT
425 413
426config SND_MSND_PINNACLE 414config SND_MSND_PINNACLE
427 tristate "Turtle Beach MultiSound Pinnacle/Fiji driver" 415 tristate "Turtle Beach MultiSound Pinnacle/Fiji driver"
428 depends on X86 416 depends on X86 && EXPERIMENTAL
429 select FW_LOADER 417 select FW_LOADER
430 select SND_MPU401_UART 418 select SND_MPU401_UART
431 select SND_PCM 419 select SND_PCM
@@ -438,7 +426,7 @@ config SND_MSND_PINNACLE
438 426
439config SND_MSND_CLASSIC 427config SND_MSND_CLASSIC
440 tristate "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey" 428 tristate "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey"
441 depends on X86 429 depends on X86 && EXPERIMENTAL
442 select FW_LOADER 430 select FW_LOADER
443 select SND_MPU401_UART 431 select SND_MPU401_UART
444 select SND_PCM 432 select SND_PCM
diff --git a/sound/isa/Makefile b/sound/isa/Makefile
index 9a15f1497b1..8d781e419e2 100644
--- a/sound/isa/Makefile
+++ b/sound/isa/Makefile
@@ -6,7 +6,6 @@
6snd-adlib-objs := adlib.o 6snd-adlib-objs := adlib.o
7snd-als100-objs := als100.o 7snd-als100-objs := als100.o
8snd-azt2320-objs := azt2320.o 8snd-azt2320-objs := azt2320.o
9snd-cmi8328-objs := cmi8328.o
10snd-cmi8330-objs := cmi8330.o 9snd-cmi8330-objs := cmi8330.o
11snd-es18xx-objs := es18xx.o 10snd-es18xx-objs := es18xx.o
12snd-opl3sa2-objs := opl3sa2.o 11snd-opl3sa2-objs := opl3sa2.o
@@ -17,7 +16,6 @@ snd-sscape-objs := sscape.o
17obj-$(CONFIG_SND_ADLIB) += snd-adlib.o 16obj-$(CONFIG_SND_ADLIB) += snd-adlib.o
18obj-$(CONFIG_SND_ALS100) += snd-als100.o 17obj-$(CONFIG_SND_ALS100) += snd-als100.o
19obj-$(CONFIG_SND_AZT2320) += snd-azt2320.o 18obj-$(CONFIG_SND_AZT2320) += snd-azt2320.o
20obj-$(CONFIG_SND_CMI8328) += snd-cmi8328.o
21obj-$(CONFIG_SND_CMI8330) += snd-cmi8330.o 19obj-$(CONFIG_SND_CMI8330) += snd-cmi8330.o
22obj-$(CONFIG_SND_ES18XX) += snd-es18xx.o 20obj-$(CONFIG_SND_ES18XX) += snd-es18xx.o
23obj-$(CONFIG_SND_OPL3SA2) += snd-opl3sa2.o 21obj-$(CONFIG_SND_OPL3SA2) += snd-opl3sa2.o
diff --git a/sound/isa/ad1816a/ad1816a.c b/sound/isa/ad1816a/ad1816a.c
index 26ce26a5884..3cb75bc9769 100644
--- a/sound/isa/ad1816a/ad1816a.c
+++ b/sound/isa/ad1816a/ad1816a.c
@@ -22,7 +22,7 @@
22#include <linux/time.h> 22#include <linux/time.h>
23#include <linux/wait.h> 23#include <linux/wait.h>
24#include <linux/pnp.h> 24#include <linux/pnp.h>
25#include <linux/module.h> 25#include <linux/moduleparam.h>
26#include <sound/core.h> 26#include <sound/core.h>
27#include <sound/initval.h> 27#include <sound/initval.h>
28#include <sound/ad1816a.h> 28#include <sound/ad1816a.h>
@@ -44,7 +44,7 @@ MODULE_SUPPORTED_DEVICE("{{Highscreen,Sound-Boostar 16 3D},"
44 44
45static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */ 45static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */
46static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 46static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
47static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 47static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
48static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 48static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
49static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 49static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
50static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 50static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
@@ -63,6 +63,11 @@ MODULE_PARM_DESC(enable, "Enable ad1816a based soundcard.");
63module_param_array(clockfreq, int, NULL, 0444); 63module_param_array(clockfreq, int, NULL, 0444);
64MODULE_PARM_DESC(clockfreq, "Clock frequency for ad1816a driver (default = 0)."); 64MODULE_PARM_DESC(clockfreq, "Clock frequency for ad1816a driver (default = 0).");
65 65
66struct snd_card_ad1816a {
67 struct pnp_dev *dev;
68 struct pnp_dev *devmpu;
69};
70
66static struct pnp_card_device_id snd_ad1816a_pnpids[] = { 71static struct pnp_card_device_id snd_ad1816a_pnpids[] = {
67 /* Analog Devices AD1815 */ 72 /* Analog Devices AD1815 */
68 { .id = "ADS7150", .devs = { { .id = "ADS7150" }, { .id = "ADS7151" } } }, 73 { .id = "ADS7150", .devs = { { .id = "ADS7150" }, { .id = "ADS7151" } } },
@@ -94,16 +99,25 @@ MODULE_DEVICE_TABLE(pnp_card, snd_ad1816a_pnpids);
94#define DRIVER_NAME "snd-card-ad1816a" 99#define DRIVER_NAME "snd-card-ad1816a"
95 100
96 101
97static int snd_card_ad1816a_pnp(int dev, struct pnp_card_link *card, 102static int __devinit snd_card_ad1816a_pnp(int dev, struct snd_card_ad1816a *acard,
98 const struct pnp_card_device_id *id) 103 struct pnp_card_link *card,
104 const struct pnp_card_device_id *id)
99{ 105{
100 struct pnp_dev *pdev; 106 struct pnp_dev *pdev;
101 int err; 107 int err;
102 108
103 pdev = pnp_request_card_device(card, id->devs[0].id, NULL); 109 acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
104 if (pdev == NULL) 110 if (acard->dev == NULL)
105 return -EBUSY; 111 return -EBUSY;
106 112
113 acard->devmpu = pnp_request_card_device(card, id->devs[1].id, NULL);
114 if (acard->devmpu == NULL) {
115 mpu_port[dev] = -1;
116 snd_printk(KERN_WARNING PFX "MPU401 device busy, skipping.\n");
117 }
118
119 pdev = acard->dev;
120
107 err = pnp_activate_dev(pdev); 121 err = pnp_activate_dev(pdev);
108 if (err < 0) { 122 if (err < 0) {
109 printk(KERN_ERR PFX "AUDIO PnP configure failure\n"); 123 printk(KERN_ERR PFX "AUDIO PnP configure failure\n");
@@ -116,17 +130,16 @@ static int snd_card_ad1816a_pnp(int dev, struct pnp_card_link *card,
116 dma2[dev] = pnp_dma(pdev, 1); 130 dma2[dev] = pnp_dma(pdev, 1);
117 irq[dev] = pnp_irq(pdev, 0); 131 irq[dev] = pnp_irq(pdev, 0);
118 132
119 pdev = pnp_request_card_device(card, id->devs[1].id, NULL); 133 if (acard->devmpu == NULL)
120 if (pdev == NULL) {
121 mpu_port[dev] = -1;
122 snd_printk(KERN_WARNING PFX "MPU401 device busy, skipping.\n");
123 return 0; 134 return 0;
124 } 135
136 pdev = acard->devmpu;
125 137
126 err = pnp_activate_dev(pdev); 138 err = pnp_activate_dev(pdev);
127 if (err < 0) { 139 if (err < 0) {
128 printk(KERN_ERR PFX "MPU401 PnP configure failure\n"); 140 printk(KERN_ERR PFX "MPU401 PnP configure failure\n");
129 mpu_port[dev] = -1; 141 mpu_port[dev] = -1;
142 acard->devmpu = NULL;
130 } else { 143 } else {
131 mpu_port[dev] = pnp_port_start(pdev, 0); 144 mpu_port[dev] = pnp_port_start(pdev, 0);
132 mpu_irq[dev] = pnp_irq(pdev, 0); 145 mpu_irq[dev] = pnp_irq(pdev, 0);
@@ -135,22 +148,23 @@ static int snd_card_ad1816a_pnp(int dev, struct pnp_card_link *card,
135 return 0; 148 return 0;
136} 149}
137 150
138static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard, 151static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
139 const struct pnp_card_device_id *pid) 152 const struct pnp_card_device_id *pid)
140{ 153{
141 int error; 154 int error;
142 struct snd_card *card; 155 struct snd_card *card;
156 struct snd_card_ad1816a *acard;
143 struct snd_ad1816a *chip; 157 struct snd_ad1816a *chip;
144 struct snd_opl3 *opl3; 158 struct snd_opl3 *opl3;
145 struct snd_timer *timer; 159 struct snd_timer *timer;
146 160
147 error = snd_card_create(index[dev], id[dev], THIS_MODULE, 161 error = snd_card_create(index[dev], id[dev], THIS_MODULE,
148 sizeof(struct snd_ad1816a), &card); 162 sizeof(struct snd_card_ad1816a), &card);
149 if (error < 0) 163 if (error < 0)
150 return error; 164 return error;
151 chip = card->private_data; 165 acard = card->private_data;
152 166
153 if ((error = snd_card_ad1816a_pnp(dev, pcard, pid))) { 167 if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) {
154 snd_card_free(card); 168 snd_card_free(card);
155 return error; 169 return error;
156 } 170 }
@@ -160,7 +174,7 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
160 irq[dev], 174 irq[dev],
161 dma1[dev], 175 dma1[dev],
162 dma2[dev], 176 dma2[dev],
163 chip)) < 0) { 177 &chip)) < 0) {
164 snd_card_free(card); 178 snd_card_free(card);
165 return error; 179 return error;
166 } 180 }
@@ -190,7 +204,7 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
190 204
191 if (mpu_port[dev] > 0) { 205 if (mpu_port[dev] > 0) {
192 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 206 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
193 mpu_port[dev], 0, mpu_irq[dev], 207 mpu_port[dev], 0, mpu_irq[dev], IRQF_DISABLED,
194 NULL) < 0) 208 NULL) < 0)
195 printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n", mpu_port[dev]); 209 printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n", mpu_port[dev]);
196 } 210 }
@@ -217,10 +231,10 @@ static int snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard,
217 return 0; 231 return 0;
218} 232}
219 233
220static unsigned int ad1816a_devices; 234static unsigned int __devinitdata ad1816a_devices;
221 235
222static int snd_ad1816a_pnp_detect(struct pnp_card_link *card, 236static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card,
223 const struct pnp_card_device_id *id) 237 const struct pnp_card_device_id *id)
224{ 238{
225 static int dev; 239 static int dev;
226 int res; 240 int res;
@@ -238,43 +252,19 @@ static int snd_ad1816a_pnp_detect(struct pnp_card_link *card,
238 return -ENODEV; 252 return -ENODEV;
239} 253}
240 254
241static void snd_ad1816a_pnp_remove(struct pnp_card_link *pcard) 255static void __devexit snd_ad1816a_pnp_remove(struct pnp_card_link * pcard)
242{ 256{
243 snd_card_free(pnp_get_card_drvdata(pcard)); 257 snd_card_free(pnp_get_card_drvdata(pcard));
244 pnp_set_card_drvdata(pcard, NULL); 258 pnp_set_card_drvdata(pcard, NULL);
245} 259}
246 260
247#ifdef CONFIG_PM
248static int snd_ad1816a_pnp_suspend(struct pnp_card_link *pcard,
249 pm_message_t state)
250{
251 struct snd_card *card = pnp_get_card_drvdata(pcard);
252
253 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
254 snd_ad1816a_suspend(card->private_data);
255 return 0;
256}
257
258static int snd_ad1816a_pnp_resume(struct pnp_card_link *pcard)
259{
260 struct snd_card *card = pnp_get_card_drvdata(pcard);
261
262 snd_ad1816a_resume(card->private_data);
263 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
264 return 0;
265}
266#endif
267
268static struct pnp_card_driver ad1816a_pnpc_driver = { 261static struct pnp_card_driver ad1816a_pnpc_driver = {
269 .flags = PNP_DRIVER_RES_DISABLE, 262 .flags = PNP_DRIVER_RES_DISABLE,
270 .name = "ad1816a", 263 .name = "ad1816a",
271 .id_table = snd_ad1816a_pnpids, 264 .id_table = snd_ad1816a_pnpids,
272 .probe = snd_ad1816a_pnp_detect, 265 .probe = snd_ad1816a_pnp_detect,
273 .remove = snd_ad1816a_pnp_remove, 266 .remove = __devexit_p(snd_ad1816a_pnp_remove),
274#ifdef CONFIG_PM 267 /* FIXME: suspend/resume */
275 .suspend = snd_ad1816a_pnp_suspend,
276 .resume = snd_ad1816a_pnp_resume,
277#endif
278}; 268};
279 269
280static int __init alsa_card_ad1816a_init(void) 270static int __init alsa_card_ad1816a_init(void)
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c
index f0fd98e695e..05aef8b97e9 100644
--- a/sound/isa/ad1816a/ad1816a_lib.c
+++ b/sound/isa/ad1816a/ad1816a_lib.c
@@ -491,7 +491,7 @@ static int snd_ad1816a_capture_close(struct snd_pcm_substream *substream)
491} 491}
492 492
493 493
494static void snd_ad1816a_init(struct snd_ad1816a *chip) 494static void __devinit snd_ad1816a_init(struct snd_ad1816a *chip)
495{ 495{
496 unsigned long flags; 496 unsigned long flags;
497 497
@@ -511,33 +511,7 @@ static void snd_ad1816a_init(struct snd_ad1816a *chip)
511 spin_unlock_irqrestore(&chip->lock, flags); 511 spin_unlock_irqrestore(&chip->lock, flags);
512} 512}
513 513
514#ifdef CONFIG_PM 514static int __devinit snd_ad1816a_probe(struct snd_ad1816a *chip)
515void snd_ad1816a_suspend(struct snd_ad1816a *chip)
516{
517 int reg;
518 unsigned long flags;
519
520 snd_pcm_suspend_all(chip->pcm);
521 spin_lock_irqsave(&chip->lock, flags);
522 for (reg = 0; reg < 48; reg++)
523 chip->image[reg] = snd_ad1816a_read(chip, reg);
524 spin_unlock_irqrestore(&chip->lock, flags);
525}
526
527void snd_ad1816a_resume(struct snd_ad1816a *chip)
528{
529 int reg;
530 unsigned long flags;
531
532 snd_ad1816a_init(chip);
533 spin_lock_irqsave(&chip->lock, flags);
534 for (reg = 0; reg < 48; reg++)
535 snd_ad1816a_write(chip, reg, chip->image[reg]);
536 spin_unlock_irqrestore(&chip->lock, flags);
537}
538#endif
539
540static int snd_ad1816a_probe(struct snd_ad1816a *chip)
541{ 515{
542 unsigned long flags; 516 unsigned long flags;
543 517
@@ -574,6 +548,7 @@ static int snd_ad1816a_free(struct snd_ad1816a *chip)
574 snd_dma_disable(chip->dma2); 548 snd_dma_disable(chip->dma2);
575 free_dma(chip->dma2); 549 free_dma(chip->dma2);
576 } 550 }
551 kfree(chip);
577 return 0; 552 return 0;
578} 553}
579 554
@@ -583,7 +558,7 @@ static int snd_ad1816a_dev_free(struct snd_device *device)
583 return snd_ad1816a_free(chip); 558 return snd_ad1816a_free(chip);
584} 559}
585 560
586static const char *snd_ad1816a_chip_id(struct snd_ad1816a *chip) 561static const char __devinit *snd_ad1816a_chip_id(struct snd_ad1816a *chip)
587{ 562{
588 switch (chip->hardware) { 563 switch (chip->hardware) {
589 case AD1816A_HW_AD1816A: return "AD1816A"; 564 case AD1816A_HW_AD1816A: return "AD1816A";
@@ -596,15 +571,21 @@ static const char *snd_ad1816a_chip_id(struct snd_ad1816a *chip)
596 } 571 }
597} 572}
598 573
599int snd_ad1816a_create(struct snd_card *card, 574int __devinit snd_ad1816a_create(struct snd_card *card,
600 unsigned long port, int irq, int dma1, int dma2, 575 unsigned long port, int irq, int dma1, int dma2,
601 struct snd_ad1816a *chip) 576 struct snd_ad1816a **rchip)
602{ 577{
603 static struct snd_device_ops ops = { 578 static struct snd_device_ops ops = {
604 .dev_free = snd_ad1816a_dev_free, 579 .dev_free = snd_ad1816a_dev_free,
605 }; 580 };
606 int error; 581 int error;
582 struct snd_ad1816a *chip;
583
584 *rchip = NULL;
607 585
586 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
587 if (chip == NULL)
588 return -ENOMEM;
608 chip->irq = -1; 589 chip->irq = -1;
609 chip->dma1 = -1; 590 chip->dma1 = -1;
610 chip->dma2 = -1; 591 chip->dma2 = -1;
@@ -614,7 +595,7 @@ int snd_ad1816a_create(struct snd_card *card,
614 snd_ad1816a_free(chip); 595 snd_ad1816a_free(chip);
615 return -EBUSY; 596 return -EBUSY;
616 } 597 }
617 if (request_irq(irq, snd_ad1816a_interrupt, 0, "AD1816A", (void *) chip)) { 598 if (request_irq(irq, snd_ad1816a_interrupt, IRQF_DISABLED, "AD1816A", (void *) chip)) {
618 snd_printk(KERN_ERR "ad1816a: can't grab IRQ %d\n", irq); 599 snd_printk(KERN_ERR "ad1816a: can't grab IRQ %d\n", irq);
619 snd_ad1816a_free(chip); 600 snd_ad1816a_free(chip);
620 return -EBUSY; 601 return -EBUSY;
@@ -650,6 +631,7 @@ int snd_ad1816a_create(struct snd_card *card,
650 return error; 631 return error;
651 } 632 }
652 633
634 *rchip = chip;
653 return 0; 635 return 0;
654} 636}
655 637
@@ -675,7 +657,7 @@ static struct snd_pcm_ops snd_ad1816a_capture_ops = {
675 .pointer = snd_ad1816a_capture_pointer, 657 .pointer = snd_ad1816a_capture_pointer,
676}; 658};
677 659
678int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm) 660int __devinit snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm)
679{ 661{
680 int error; 662 int error;
681 struct snd_pcm *pcm; 663 struct snd_pcm *pcm;
@@ -702,8 +684,7 @@ int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm)
702 return 0; 684 return 0;
703} 685}
704 686
705int snd_ad1816a_timer(struct snd_ad1816a *chip, int device, 687int __devinit snd_ad1816a_timer(struct snd_ad1816a *chip, int device, struct snd_timer **rtimer)
706 struct snd_timer **rtimer)
707{ 688{
708 struct snd_timer *timer; 689 struct snd_timer *timer;
709 struct snd_timer_id tid; 690 struct snd_timer_id tid;
@@ -924,7 +905,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0);
924static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); 905static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0);
925static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); 906static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0);
926 907
927static struct snd_kcontrol_new snd_ad1816a_controls[] = { 908static struct snd_kcontrol_new snd_ad1816a_controls[] __devinitdata = {
928AD1816A_DOUBLE("Master Playback Switch", AD1816A_MASTER_ATT, 15, 7, 1, 1), 909AD1816A_DOUBLE("Master Playback Switch", AD1816A_MASTER_ATT, 15, 7, 1, 1),
929AD1816A_DOUBLE_TLV("Master Playback Volume", AD1816A_MASTER_ATT, 8, 0, 31, 1, 910AD1816A_DOUBLE_TLV("Master Playback Volume", AD1816A_MASTER_ATT, 8, 0, 31, 1,
930 db_scale_5bit), 911 db_scale_5bit),
@@ -970,7 +951,7 @@ AD1816A_SINGLE("3D Control - Switch", AD1816A_3D_PHAT_CTRL, 15, 1, 1),
970AD1816A_SINGLE("3D Control - Level", AD1816A_3D_PHAT_CTRL, 0, 15, 0), 951AD1816A_SINGLE("3D Control - Level", AD1816A_3D_PHAT_CTRL, 0, 15, 0),
971}; 952};
972 953
973int snd_ad1816a_mixer(struct snd_ad1816a *chip) 954int __devinit snd_ad1816a_mixer(struct snd_ad1816a *chip)
974{ 955{
975 struct snd_card *card; 956 struct snd_card *card;
976 unsigned int idx; 957 unsigned int idx;
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index c214ecf4540..4beeb6f98e0 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -26,7 +26,7 @@
26#include <linux/isa.h> 26#include <linux/isa.h>
27#include <linux/time.h> 27#include <linux/time.h>
28#include <linux/wait.h> 28#include <linux/wait.h>
29#include <linux/module.h> 29#include <linux/moduleparam.h>
30#include <sound/core.h> 30#include <sound/core.h>
31#include <sound/wss.h> 31#include <sound/wss.h>
32#include <sound/initval.h> 32#include <sound/initval.h>
@@ -43,11 +43,11 @@ MODULE_SUPPORTED_DEVICE("{{Analog Devices,AD1848},"
43 43
44static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 44static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 45static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
46static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 46static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
47static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 47static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
48static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ 48static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
49static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ 49static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
50static bool thinkpad[SNDRV_CARDS]; /* Thinkpad special case */ 50static int thinkpad[SNDRV_CARDS]; /* Thinkpad special case */
51 51
52module_param_array(index, int, NULL, 0444); 52module_param_array(index, int, NULL, 0444);
53MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); 53MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard.");
@@ -64,7 +64,7 @@ MODULE_PARM_DESC(dma1, "DMA1 # for " CRD_NAME " driver.");
64module_param_array(thinkpad, bool, NULL, 0444); 64module_param_array(thinkpad, bool, NULL, 0444);
65MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 360/750/755 series."); 65MODULE_PARM_DESC(thinkpad, "Enable only for the onboard CS4248 of IBM Thinkpad 360/750/755 series.");
66 66
67static int snd_ad1848_match(struct device *dev, unsigned int n) 67static int __devinit snd_ad1848_match(struct device *dev, unsigned int n)
68{ 68{
69 if (!enable[n]) 69 if (!enable[n])
70 return 0; 70 return 0;
@@ -84,7 +84,7 @@ static int snd_ad1848_match(struct device *dev, unsigned int n)
84 return 1; 84 return 1;
85} 85}
86 86
87static int snd_ad1848_probe(struct device *dev, unsigned int n) 87static int __devinit snd_ad1848_probe(struct device *dev, unsigned int n)
88{ 88{
89 struct snd_card *card; 89 struct snd_card *card;
90 struct snd_wss *chip; 90 struct snd_wss *chip;
@@ -132,7 +132,7 @@ out: snd_card_free(card);
132 return error; 132 return error;
133} 133}
134 134
135static int snd_ad1848_remove(struct device *dev, unsigned int n) 135static int __devexit snd_ad1848_remove(struct device *dev, unsigned int n)
136{ 136{
137 snd_card_free(dev_get_drvdata(dev)); 137 snd_card_free(dev_get_drvdata(dev));
138 dev_set_drvdata(dev, NULL); 138 dev_set_drvdata(dev, NULL);
@@ -164,7 +164,7 @@ static int snd_ad1848_resume(struct device *dev, unsigned int n)
164static struct isa_driver snd_ad1848_driver = { 164static struct isa_driver snd_ad1848_driver = {
165 .match = snd_ad1848_match, 165 .match = snd_ad1848_match,
166 .probe = snd_ad1848_probe, 166 .probe = snd_ad1848_probe,
167 .remove = snd_ad1848_remove, 167 .remove = __devexit_p(snd_ad1848_remove),
168#ifdef CONFIG_PM 168#ifdef CONFIG_PM
169 .suspend = snd_ad1848_suspend, 169 .suspend = snd_ad1848_suspend,
170 .resume = snd_ad1848_resume, 170 .resume = snd_ad1848_resume,
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c
index d2654554373..7465ae036e0 100644
--- a/sound/isa/adlib.c
+++ b/sound/isa/adlib.c
@@ -18,7 +18,7 @@ MODULE_LICENSE("GPL");
18 18
19static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 19static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
20static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 20static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
21static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; 21static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
22static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 22static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
23 23
24module_param_array(index, int, NULL, 0444); 24module_param_array(index, int, NULL, 0444);
@@ -30,7 +30,7 @@ MODULE_PARM_DESC(enable, "Enable " CRD_NAME " soundcard.");
30module_param_array(port, long, NULL, 0444); 30module_param_array(port, long, NULL, 0444);
31MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver."); 31MODULE_PARM_DESC(port, "Port # for " CRD_NAME " driver.");
32 32
33static int snd_adlib_match(struct device *dev, unsigned int n) 33static int __devinit snd_adlib_match(struct device *dev, unsigned int n)
34{ 34{
35 if (!enable[n]) 35 if (!enable[n])
36 return 0; 36 return 0;
@@ -47,7 +47,7 @@ static void snd_adlib_free(struct snd_card *card)
47 release_and_free_resource(card->private_data); 47 release_and_free_resource(card->private_data);
48} 48}
49 49
50static int snd_adlib_probe(struct device *dev, unsigned int n) 50static int __devinit snd_adlib_probe(struct device *dev, unsigned int n)
51{ 51{
52 struct snd_card *card; 52 struct snd_card *card;
53 struct snd_opl3 *opl3; 53 struct snd_opl3 *opl3;
@@ -98,7 +98,7 @@ out: snd_card_free(card);
98 return error; 98 return error;
99} 99}
100 100
101static int snd_adlib_remove(struct device *dev, unsigned int n) 101static int __devexit snd_adlib_remove(struct device *dev, unsigned int n)
102{ 102{
103 snd_card_free(dev_get_drvdata(dev)); 103 snd_card_free(dev_get_drvdata(dev));
104 dev_set_drvdata(dev, NULL); 104 dev_set_drvdata(dev, NULL);
@@ -108,7 +108,7 @@ static int snd_adlib_remove(struct device *dev, unsigned int n)
108static struct isa_driver snd_adlib_driver = { 108static struct isa_driver snd_adlib_driver = {
109 .match = snd_adlib_match, 109 .match = snd_adlib_match,
110 .probe = snd_adlib_probe, 110 .probe = snd_adlib_probe,
111 .remove = snd_adlib_remove, 111 .remove = __devexit_p(snd_adlib_remove),
112 112
113 .driver = { 113 .driver = {
114 .name = DEV_NAME 114 .name = DEV_NAME
diff --git a/sound/isa/als100.c b/sound/isa/als100.c
index 10f08a18fe3..20becc89f6f 100644
--- a/sound/isa/als100.c
+++ b/sound/isa/als100.c
@@ -7,7 +7,7 @@
7 Thanks to Pierfrancesco 'qM2' Passerini. 7 Thanks to Pierfrancesco 'qM2' Passerini.
8 8
9 Generalised for soundcards based on DT-0196 and ALS-007 chips 9 Generalised for soundcards based on DT-0196 and ALS-007 chips
10 by Jonathan Woithe <jwoithe@just42.net>: June 2002. 10 by Jonathan Woithe <jwoithe@physics.adelaide.edu.au>: June 2002.
11 11
12 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
13 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
@@ -28,7 +28,7 @@
28#include <linux/wait.h> 28#include <linux/wait.h>
29#include <linux/time.h> 29#include <linux/time.h>
30#include <linux/pnp.h> 30#include <linux/pnp.h>
31#include <linux/module.h> 31#include <linux/moduleparam.h>
32#include <sound/core.h> 32#include <sound/core.h>
33#include <sound/initval.h> 33#include <sound/initval.h>
34#include <sound/mpu401.h> 34#include <sound/mpu401.h>
@@ -54,7 +54,7 @@ MODULE_LICENSE("GPL");
54 54
55static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 55static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
56static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 56static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
57static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 57static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
58static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 58static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
59static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 59static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
60static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 60static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
@@ -117,9 +117,9 @@ static struct pnp_card_device_id snd_als100_pnpids[] = {
117 117
118MODULE_DEVICE_TABLE(pnp_card, snd_als100_pnpids); 118MODULE_DEVICE_TABLE(pnp_card, snd_als100_pnpids);
119 119
120static int 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,
121 struct pnp_card_link *card, 121 struct pnp_card_link *card,
122 const struct pnp_card_device_id *id) 122 const struct pnp_card_device_id *id)
123{ 123{
124 struct pnp_dev *pdev; 124 struct pnp_dev *pdev;
125 int err; 125 int err;
@@ -183,9 +183,9 @@ static int snd_card_als100_pnp(int dev, struct snd_card_als100 *acard,
183 return 0; 183 return 0;
184} 184}
185 185
186static int snd_card_als100_probe(int dev, 186static int __devinit snd_card_als100_probe(int dev,
187 struct pnp_card_link *pcard, 187 struct pnp_card_link *pcard,
188 const struct pnp_card_device_id *pid) 188 const struct pnp_card_device_id *pid)
189{ 189{
190 int error; 190 int error;
191 struct snd_sb *chip; 191 struct snd_sb *chip;
@@ -233,7 +233,7 @@ static int snd_card_als100_probe(int dev,
233 irq[dev], dma8[dev], dma16[dev]); 233 irq[dev], dma8[dev], dma16[dev]);
234 } 234 }
235 235
236 if ((error = snd_sb16dsp_pcm(chip, 0, &chip->pcm)) < 0) { 236 if ((error = snd_sb16dsp_pcm(chip, 0, NULL)) < 0) {
237 snd_card_free(card); 237 snd_card_free(card);
238 return error; 238 return error;
239 } 239 }
@@ -256,6 +256,7 @@ static int snd_card_als100_probe(int dev,
256 mpu_type, 256 mpu_type,
257 mpu_port[dev], 0, 257 mpu_port[dev], 0,
258 mpu_irq[dev], 258 mpu_irq[dev],
259 mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0,
259 NULL) < 0) 260 NULL) < 0)
260 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]);
261 } 262 }
@@ -286,10 +287,10 @@ static int snd_card_als100_probe(int dev,
286 return 0; 287 return 0;
287} 288}
288 289
289static unsigned int als100_devices; 290static unsigned int __devinitdata als100_devices;
290 291
291static int snd_als100_pnp_detect(struct pnp_card_link *card, 292static int __devinit snd_als100_pnp_detect(struct pnp_card_link *card,
292 const struct pnp_card_device_id *id) 293 const struct pnp_card_device_id *id)
293{ 294{
294 static int dev; 295 static int dev;
295 int res; 296 int res;
@@ -307,7 +308,7 @@ static int snd_als100_pnp_detect(struct pnp_card_link *card,
307 return -ENODEV; 308 return -ENODEV;
308} 309}
309 310
310static void snd_als100_pnp_remove(struct pnp_card_link *pcard) 311static void __devexit snd_als100_pnp_remove(struct pnp_card_link * pcard)
311{ 312{
312 snd_card_free(pnp_get_card_drvdata(pcard)); 313 snd_card_free(pnp_get_card_drvdata(pcard));
313 pnp_set_card_drvdata(pcard, NULL); 314 pnp_set_card_drvdata(pcard, NULL);
@@ -344,7 +345,7 @@ static struct pnp_card_driver als100_pnpc_driver = {
344 .name = "als100", 345 .name = "als100",
345 .id_table = snd_als100_pnpids, 346 .id_table = snd_als100_pnpids,
346 .probe = snd_als100_pnp_detect, 347 .probe = snd_als100_pnp_detect,
347 .remove = snd_als100_pnp_remove, 348 .remove = __devexit_p(snd_als100_pnp_remove),
348#ifdef CONFIG_PM 349#ifdef CONFIG_PM
349 .suspend = snd_als100_pnp_suspend, 350 .suspend = snd_als100_pnp_suspend,
350 .resume = snd_als100_pnp_resume, 351 .resume = snd_als100_pnp_resume,
diff --git a/sound/isa/azt2320.c b/sound/isa/azt2320.c
index db301ff94ec..aac8dc15c2f 100644
--- a/sound/isa/azt2320.c
+++ b/sound/isa/azt2320.c
@@ -35,7 +35,7 @@
35#include <linux/time.h> 35#include <linux/time.h>
36#include <linux/wait.h> 36#include <linux/wait.h>
37#include <linux/pnp.h> 37#include <linux/pnp.h>
38#include <linux/module.h> 38#include <linux/moduleparam.h>
39#include <sound/core.h> 39#include <sound/core.h>
40#include <sound/initval.h> 40#include <sound/initval.h>
41#include <sound/wss.h> 41#include <sound/wss.h>
@@ -55,7 +55,7 @@ MODULE_SUPPORTED_DEVICE("{{Aztech Systems,PRO16V},"
55 55
56static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 56static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
58static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 58static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
59static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 59static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
60static long wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 60static long wss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
61static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 61static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
@@ -99,9 +99,9 @@ MODULE_DEVICE_TABLE(pnp_card, snd_azt2320_pnpids);
99 99
100#define DRIVER_NAME "snd-card-azt2320" 100#define DRIVER_NAME "snd-card-azt2320"
101 101
102static int snd_card_azt2320_pnp(int dev, struct snd_card_azt2320 *acard, 102static int __devinit snd_card_azt2320_pnp(int dev, struct snd_card_azt2320 *acard,
103 struct pnp_card_link *card, 103 struct pnp_card_link *card,
104 const struct pnp_card_device_id *id) 104 const struct pnp_card_device_id *id)
105{ 105{
106 struct pnp_dev *pdev; 106 struct pnp_dev *pdev;
107 int err; 107 int err;
@@ -147,7 +147,7 @@ static int snd_card_azt2320_pnp(int dev, struct snd_card_azt2320 *acard,
147} 147}
148 148
149/* same of snd_sbdsp_command by Jaroslav Kysela */ 149/* same of snd_sbdsp_command by Jaroslav Kysela */
150static int snd_card_azt2320_command(unsigned long port, unsigned char val) 150static int __devinit snd_card_azt2320_command(unsigned long port, unsigned char val)
151{ 151{
152 int i; 152 int i;
153 unsigned long limit; 153 unsigned long limit;
@@ -161,7 +161,7 @@ static int snd_card_azt2320_command(unsigned long port, unsigned char val)
161 return -EBUSY; 161 return -EBUSY;
162} 162}
163 163
164static int snd_card_azt2320_enable_wss(unsigned long port) 164static int __devinit snd_card_azt2320_enable_wss(unsigned long port)
165{ 165{
166 int error; 166 int error;
167 167
@@ -174,9 +174,9 @@ static int snd_card_azt2320_enable_wss(unsigned long port)
174 return 0; 174 return 0;
175} 175}
176 176
177static int snd_card_azt2320_probe(int dev, 177static int __devinit snd_card_azt2320_probe(int dev,
178 struct pnp_card_link *pcard, 178 struct pnp_card_link *pcard,
179 const struct pnp_card_device_id *pid) 179 const struct pnp_card_device_id *pid)
180{ 180{
181 int error; 181 int error;
182 struct snd_card *card; 182 struct snd_card *card;
@@ -234,7 +234,8 @@ static int snd_card_azt2320_probe(int dev,
234 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) { 234 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
235 if (snd_mpu401_uart_new(card, 0, MPU401_HW_AZT2320, 235 if (snd_mpu401_uart_new(card, 0, MPU401_HW_AZT2320,
236 mpu_port[dev], 0, 236 mpu_port[dev], 0,
237 mpu_irq[dev], NULL) < 0) 237 mpu_irq[dev], IRQF_DISABLED,
238 NULL) < 0)
238 snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]); 239 snd_printk(KERN_ERR PFX "no MPU-401 device at 0x%lx\n", mpu_port[dev]);
239 } 240 }
240 241
@@ -264,10 +265,10 @@ static int snd_card_azt2320_probe(int dev,
264 return 0; 265 return 0;
265} 266}
266 267
267static unsigned int azt2320_devices; 268static unsigned int __devinitdata azt2320_devices;
268 269
269static int snd_azt2320_pnp_detect(struct pnp_card_link *card, 270static int __devinit snd_azt2320_pnp_detect(struct pnp_card_link *card,
270 const struct pnp_card_device_id *id) 271 const struct pnp_card_device_id *id)
271{ 272{
272 static int dev; 273 static int dev;
273 int res; 274 int res;
@@ -285,7 +286,7 @@ static int snd_azt2320_pnp_detect(struct pnp_card_link *card,
285 return -ENODEV; 286 return -ENODEV;
286} 287}
287 288
288static void snd_azt2320_pnp_remove(struct pnp_card_link *pcard) 289static void __devexit snd_azt2320_pnp_remove(struct pnp_card_link * pcard)
289{ 290{
290 snd_card_free(pnp_get_card_drvdata(pcard)); 291 snd_card_free(pnp_get_card_drvdata(pcard));
291 pnp_set_card_drvdata(pcard, NULL); 292 pnp_set_card_drvdata(pcard, NULL);
@@ -320,7 +321,7 @@ static struct pnp_card_driver azt2320_pnpc_driver = {
320 .name = "azt2320", 321 .name = "azt2320",
321 .id_table = snd_azt2320_pnpids, 322 .id_table = snd_azt2320_pnpids,
322 .probe = snd_azt2320_pnp_detect, 323 .probe = snd_azt2320_pnp_detect,
323 .remove = snd_azt2320_pnp_remove, 324 .remove = __devexit_p(snd_azt2320_pnp_remove),
324#ifdef CONFIG_PM 325#ifdef CONFIG_PM
325 .suspend = snd_azt2320_pnp_suspend, 326 .suspend = snd_azt2320_pnp_suspend,
326 .resume = snd_azt2320_pnp_resume, 327 .resume = snd_azt2320_pnp_resume,
diff --git a/sound/isa/cmi8328.c b/sound/isa/cmi8328.c
deleted file mode 100644
index a7369fe19a6..00000000000
--- a/sound/isa/cmi8328.c
+++ /dev/null
@@ -1,483 +0,0 @@
1/*
2 * Driver for C-Media CMI8328-based soundcards, such as AudioExcel AV500
3 * Copyright (c) 2012 Ondrej Zary
4 *
5 * AudioExcel AV500 card consists of:
6 * - CMI8328 - main chip (SB Pro emulation, gameport, OPL3, MPU401, CD-ROM)
7 * - CS4231A - WSS codec
8 * - Dream SAM9233+GMS950400+RAM+ROM: Wavetable MIDI, connected to MPU401
9 */
10
11#include <linux/init.h>
12#include <linux/isa.h>
13#include <linux/module.h>
14#include <linux/gameport.h>
15#include <asm/dma.h>
16#include <sound/core.h>
17#include <sound/wss.h>
18#include <sound/opl3.h>
19#include <sound/mpu401.h>
20#define SNDRV_LEGACY_FIND_FREE_IOPORT
21#define SNDRV_LEGACY_FIND_FREE_IRQ
22#define SNDRV_LEGACY_FIND_FREE_DMA
23#include <sound/initval.h>
24
25MODULE_AUTHOR("Ondrej Zary <linux@rainbow-software.org>");
26MODULE_DESCRIPTION("C-Media CMI8328");
27MODULE_LICENSE("GPL");
28
29#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
30#define SUPPORT_JOYSTICK 1
31#endif
32
33/* I/O port is configured by jumpers on the card to one of these */
34static int cmi8328_ports[] = { 0x530, 0xe80, 0xf40, 0x604 };
35#define CMI8328_MAX ARRAY_SIZE(cmi8328_ports)
36
37static int index[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = -1};
38static char *id[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = NULL};
39static long port[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_PORT};
40static int irq[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_IRQ};
41static int dma1[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_DMA};
42static int dma2[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_DMA};
43static long mpuport[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_PORT};
44static int mpuirq[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_IRQ};
45#ifdef SUPPORT_JOYSTICK
46static bool gameport[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = true};
47#endif
48
49module_param_array(index, int, NULL, 0444);
50MODULE_PARM_DESC(index, "Index value for CMI8328 soundcard.");
51module_param_array(id, charp, NULL, 0444);
52MODULE_PARM_DESC(id, "ID string for CMI8328 soundcard.");
53
54module_param_array(port, long, NULL, 0444);
55MODULE_PARM_DESC(port, "Port # for CMI8328 driver.");
56module_param_array(irq, int, NULL, 0444);
57MODULE_PARM_DESC(irq, "IRQ # for CMI8328 driver.");
58module_param_array(dma1, int, NULL, 0444);
59MODULE_PARM_DESC(dma1, "DMA1 for CMI8328 driver.");
60module_param_array(dma2, int, NULL, 0444);
61MODULE_PARM_DESC(dma2, "DMA2 for CMI8328 driver.");
62
63module_param_array(mpuport, long, NULL, 0444);
64MODULE_PARM_DESC(mpuport, "MPU-401 port # for CMI8328 driver.");
65module_param_array(mpuirq, int, NULL, 0444);
66MODULE_PARM_DESC(mpuirq, "IRQ # for CMI8328 MPU-401 port.");
67#ifdef SUPPORT_JOYSTICK
68module_param_array(gameport, bool, NULL, 0444);
69MODULE_PARM_DESC(gameport, "Enable gameport.");
70#endif
71
72struct snd_cmi8328 {
73 u16 port;
74 u8 cfg[3];
75 u8 wss_cfg;
76 struct snd_card *card;
77 struct snd_wss *wss;
78#ifdef SUPPORT_JOYSTICK
79 struct gameport *gameport;
80#endif
81};
82
83/* CMI8328 configuration registers */
84#define CFG1 0x61
85#define CFG1_SB_DISABLE (1 << 0)
86#define CFG1_GAMEPORT (1 << 1)
87/*
88 * bit 0: SB: 0=enabled, 1=disabled
89 * bit 1: gameport: 0=disabled, 1=enabled
90 * bits 2-4: SB IRQ: 001=3, 010=5, 011=7, 100=9, 101=10, 110=11
91 * bits 5-6: SB DMA: 00=disabled (when SB disabled), 01=DMA0, 10=DMA1, 11=DMA3
92 * bit 7: SB port: 0=0x220, 1=0x240
93 */
94#define CFG2 0x62
95#define CFG2_MPU_ENABLE (1 << 2)
96/*
97 * bits 0-1: CD-ROM mode: 00=disabled, 01=Panasonic, 10=Sony/Mitsumi/Wearnes,
98 11=IDE
99 * bit 2: MPU401: 0=disabled, 1=enabled
100 * bits 3-4: MPU401 IRQ: 00=3, 01=5, 10=7, 11=9,
101 * bits 5-7: MPU401 port: 000=0x300, 001=0x310, 010=0x320, 011=0x330, 100=0x332,
102 101=0x334, 110=0x336
103 */
104#define CFG3 0x63
105/*
106 * bits 0-2: CD-ROM IRQ: 000=disabled, 001=3, 010=5, 011=7, 100=9, 101=10,
107 110=11
108 * bits 3-4: CD-ROM DMA: 00=disabled, 01=DMA0, 10=DMA1, 11=DMA3
109 * bits 5-7: CD-ROM port: 000=0x300, 001=0x310, 010=0x320, 011=0x330, 100=0x340,
110 101=0x350, 110=0x360, 111=0x370
111 */
112
113static u8 snd_cmi8328_cfg_read(u16 port, u8 reg)
114{
115 outb(0x43, port + 3);
116 outb(0x21, port + 3);
117 outb(reg, port + 3);
118 return inb(port);
119}
120
121static void snd_cmi8328_cfg_write(u16 port, u8 reg, u8 val)
122{
123 outb(0x43, port + 3);
124 outb(0x21, port + 3);
125 outb(reg, port + 3);
126 outb(val, port + 3); /* yes, value goes to the same port as index */
127}
128
129static void snd_cmi8328_cfg_save(u16 port, u8 cfg[])
130{
131 cfg[0] = snd_cmi8328_cfg_read(port, CFG1);
132 cfg[1] = snd_cmi8328_cfg_read(port, CFG2);
133 cfg[2] = snd_cmi8328_cfg_read(port, CFG3);
134}
135
136static void snd_cmi8328_cfg_restore(u16 port, u8 cfg[])
137{
138 snd_cmi8328_cfg_write(port, CFG1, cfg[0]);
139 snd_cmi8328_cfg_write(port, CFG2, cfg[1]);
140 snd_cmi8328_cfg_write(port, CFG3, cfg[2]);
141}
142
143static int snd_cmi8328_mixer(struct snd_wss *chip)
144{
145 struct snd_card *card;
146 struct snd_ctl_elem_id id1, id2;
147 int err;
148
149 card = chip->card;
150
151 memset(&id1, 0, sizeof(id1));
152 memset(&id2, 0, sizeof(id2));
153 id1.iface = id2.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
154 /* rename AUX0 switch to CD */
155 strcpy(id1.name, "Aux Playback Switch");
156 strcpy(id2.name, "CD Playback Switch");
157 err = snd_ctl_rename_id(card, &id1, &id2);
158 if (err < 0) {
159 snd_printk(KERN_ERR "error renaming control\n");
160 return err;
161 }
162 /* rename AUX0 volume to CD */
163 strcpy(id1.name, "Aux Playback Volume");
164 strcpy(id2.name, "CD Playback Volume");
165 err = snd_ctl_rename_id(card, &id1, &id2);
166 if (err < 0) {
167 snd_printk(KERN_ERR "error renaming control\n");
168 return err;
169 }
170 /* rename AUX1 switch to Synth */
171 strcpy(id1.name, "Aux Playback Switch");
172 id1.index = 1;
173 strcpy(id2.name, "Synth Playback Switch");
174 err = snd_ctl_rename_id(card, &id1, &id2);
175 if (err < 0) {
176 snd_printk(KERN_ERR "error renaming control\n");
177 return err;
178 }
179 /* rename AUX1 volume to Synth */
180 strcpy(id1.name, "Aux Playback Volume");
181 id1.index = 1;
182 strcpy(id2.name, "Synth Playback Volume");
183 err = snd_ctl_rename_id(card, &id1, &id2);
184 if (err < 0) {
185 snd_printk(KERN_ERR "error renaming control\n");
186 return err;
187 }
188
189 return 0;
190}
191
192/* find index of an item in "-1"-ended array */
193int array_find(int array[], int item)
194{
195 int i;
196
197 for (i = 0; array[i] != -1; i++)
198 if (array[i] == item)
199 return i;
200
201 return -1;
202}
203/* the same for long */
204int array_find_l(long array[], long item)
205{
206 int i;
207
208 for (i = 0; array[i] != -1; i++)
209 if (array[i] == item)
210 return i;
211
212 return -1;
213}
214
215static int snd_cmi8328_probe(struct device *pdev, unsigned int ndev)
216{
217 struct snd_card *card;
218 struct snd_opl3 *opl3;
219 struct snd_cmi8328 *cmi;
220#ifdef SUPPORT_JOYSTICK
221 struct resource *res;
222#endif
223 int err, pos;
224 static long mpu_ports[] = { 0x330, 0x300, 0x310, 0x320, 0x332, 0x334,
225 0x336, -1 };
226 static u8 mpu_port_bits[] = { 3, 0, 1, 2, 4, 5, 6 };
227 static int mpu_irqs[] = { 9, 7, 5, 3, -1 };
228 static u8 mpu_irq_bits[] = { 3, 2, 1, 0 };
229 static int irqs[] = { 9, 10, 11, 7, -1 };
230 static u8 irq_bits[] = { 2, 3, 4, 1 };
231 static int dma1s[] = { 3, 1, 0, -1 };
232 static u8 dma_bits[] = { 3, 2, 1 };
233 static int dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1}, {0, -1} };
234 u16 port = cmi8328_ports[ndev];
235 u8 val;
236
237 /* 0xff is invalid configuration (but settable - hope it isn't set) */
238 if (snd_cmi8328_cfg_read(port, CFG1) == 0xff)
239 return -ENODEV;
240 /* the SB disable bit must NEVER EVER be cleared or the WSS dies */
241 snd_cmi8328_cfg_write(port, CFG1, CFG1_SB_DISABLE);
242 if (snd_cmi8328_cfg_read(port, CFG1) != CFG1_SB_DISABLE)
243 return -ENODEV;
244 /* disable everything first */
245 snd_cmi8328_cfg_write(port, CFG2, 0); /* disable CDROM and MPU401 */
246 snd_cmi8328_cfg_write(port, CFG3, 0); /* disable CDROM IRQ and DMA */
247
248 if (irq[ndev] == SNDRV_AUTO_IRQ) {
249 irq[ndev] = snd_legacy_find_free_irq(irqs);
250 if (irq[ndev] < 0) {
251 snd_printk(KERN_ERR "unable to find a free IRQ\n");
252 return -EBUSY;
253 }
254 }
255 if (dma1[ndev] == SNDRV_AUTO_DMA) {
256 dma1[ndev] = snd_legacy_find_free_dma(dma1s);
257 if (dma1[ndev] < 0) {
258 snd_printk(KERN_ERR "unable to find a free DMA1\n");
259 return -EBUSY;
260 }
261 }
262 if (dma2[ndev] == SNDRV_AUTO_DMA) {
263 dma2[ndev] = snd_legacy_find_free_dma(dma2s[dma1[ndev] % 4]);
264 if (dma2[ndev] < 0) {
265 snd_printk(KERN_WARNING "unable to find a free DMA2, full-duplex will not work\n");
266 dma2[ndev] = -1;
267 }
268 }
269 /* configure WSS IRQ... */
270 pos = array_find(irqs, irq[ndev]);
271 if (pos < 0) {
272 snd_printk(KERN_ERR "invalid IRQ %d\n", irq[ndev]);
273 return -EINVAL;
274 }
275 val = irq_bits[pos] << 3;
276 /* ...and DMA... */
277 pos = array_find(dma1s, dma1[ndev]);
278 if (pos < 0) {
279 snd_printk(KERN_ERR "invalid DMA1 %d\n", dma1[ndev]);
280 return -EINVAL;
281 }
282 val |= dma_bits[pos];
283 /* ...and DMA2 */
284 if (dma2[ndev] >= 0 && dma1[ndev] != dma2[ndev]) {
285 pos = array_find(dma2s[dma1[ndev]], dma2[ndev]);
286 if (pos < 0) {
287 snd_printk(KERN_ERR "invalid DMA2 %d\n", dma2[ndev]);
288 return -EINVAL;
289 }
290 val |= 0x04; /* enable separate capture DMA */
291 }
292 outb(val, port);
293
294 err = snd_card_create(index[ndev], id[ndev], THIS_MODULE,
295 sizeof(struct snd_cmi8328), &card);
296 if (err < 0)
297 return err;
298 cmi = card->private_data;
299 cmi->card = card;
300 cmi->port = port;
301 cmi->wss_cfg = val;
302 snd_card_set_dev(card, pdev);
303
304 err = snd_wss_create(card, port + 4, -1, irq[ndev], dma1[ndev],
305 dma2[ndev], WSS_HW_DETECT, 0, &cmi->wss);
306 if (err < 0)
307 goto error;
308
309 err = snd_wss_pcm(cmi->wss, 0, NULL);
310 if (err < 0)
311 goto error;
312
313 err = snd_wss_mixer(cmi->wss);
314 if (err < 0)
315 goto error;
316 err = snd_cmi8328_mixer(cmi->wss);
317 if (err < 0)
318 goto error;
319
320 if (snd_wss_timer(cmi->wss, 0, NULL) < 0)
321 snd_printk(KERN_WARNING "error initializing WSS timer\n");
322
323 if (mpuport[ndev] == SNDRV_AUTO_PORT) {
324 mpuport[ndev] = snd_legacy_find_free_ioport(mpu_ports, 2);
325 if (mpuport[ndev] < 0)
326 snd_printk(KERN_ERR "unable to find a free MPU401 port\n");
327 }
328 if (mpuirq[ndev] == SNDRV_AUTO_IRQ) {
329 mpuirq[ndev] = snd_legacy_find_free_irq(mpu_irqs);
330 if (mpuirq[ndev] < 0)
331 snd_printk(KERN_ERR "unable to find a free MPU401 IRQ\n");
332 }
333 /* enable and configure MPU401 */
334 if (mpuport[ndev] > 0 && mpuirq[ndev] > 0) {
335 val = CFG2_MPU_ENABLE;
336 pos = array_find_l(mpu_ports, mpuport[ndev]);
337 if (pos < 0)
338 snd_printk(KERN_WARNING "invalid MPU401 port 0x%lx\n",
339 mpuport[ndev]);
340 else {
341 val |= mpu_port_bits[pos] << 5;
342 pos = array_find(mpu_irqs, mpuirq[ndev]);
343 if (pos < 0)
344 snd_printk(KERN_WARNING "invalid MPU401 IRQ %d\n",
345 mpuirq[ndev]);
346 else {
347 val |= mpu_irq_bits[pos] << 3;
348 snd_cmi8328_cfg_write(port, CFG2, val);
349 if (snd_mpu401_uart_new(card, 0,
350 MPU401_HW_MPU401, mpuport[ndev],
351 0, mpuirq[ndev], NULL) < 0)
352 snd_printk(KERN_ERR "error initializing MPU401\n");
353 }
354 }
355 }
356 /* OPL3 is hardwired to 0x388 and cannot be disabled */
357 if (snd_opl3_create(card, 0x388, 0x38a, OPL3_HW_AUTO, 0, &opl3) < 0)
358 snd_printk(KERN_ERR "error initializing OPL3\n");
359 else
360 if (snd_opl3_hwdep_new(opl3, 0, 1, NULL) < 0)
361 snd_printk(KERN_WARNING "error initializing OPL3 hwdep\n");
362
363 strcpy(card->driver, "CMI8328");
364 strcpy(card->shortname, "C-Media CMI8328");
365 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d,%d",
366 card->shortname, cmi->wss->port, irq[ndev], dma1[ndev],
367 (dma2[ndev] >= 0) ? dma2[ndev] : dma1[ndev]);
368
369 dev_set_drvdata(pdev, card);
370 err = snd_card_register(card);
371 if (err < 0)
372 goto error;
373#ifdef SUPPORT_JOYSTICK
374 if (!gameport[ndev])
375 return 0;
376 /* gameport is hardwired to 0x200 */
377 res = request_region(0x200, 8, "CMI8328 gameport");
378 if (!res)
379 snd_printk(KERN_WARNING "unable to allocate gameport I/O port\n");
380 else {
381 struct gameport *gp = cmi->gameport = gameport_allocate_port();
382 if (!cmi->gameport)
383 release_and_free_resource(res);
384 else {
385 gameport_set_name(gp, "CMI8328 Gameport");
386 gameport_set_phys(gp, "%s/gameport0", dev_name(pdev));
387 gameport_set_dev_parent(gp, pdev);
388 gp->io = 0x200;
389 gameport_set_port_data(gp, res);
390 /* Enable gameport */
391 snd_cmi8328_cfg_write(port, CFG1,
392 CFG1_SB_DISABLE | CFG1_GAMEPORT);
393 gameport_register_port(gp);
394 }
395 }
396#endif
397 return 0;
398error:
399 snd_card_free(card);
400
401 return err;
402}
403
404static int snd_cmi8328_remove(struct device *pdev, unsigned int dev)
405{
406 struct snd_card *card = dev_get_drvdata(pdev);
407 struct snd_cmi8328 *cmi = card->private_data;
408
409#ifdef SUPPORT_JOYSTICK
410 if (cmi->gameport) {
411 struct resource *res = gameport_get_port_data(cmi->gameport);
412 gameport_unregister_port(cmi->gameport);
413 release_and_free_resource(res);
414 }
415#endif
416 /* disable everything */
417 snd_cmi8328_cfg_write(cmi->port, CFG1, CFG1_SB_DISABLE);
418 snd_cmi8328_cfg_write(cmi->port, CFG2, 0);
419 snd_cmi8328_cfg_write(cmi->port, CFG3, 0);
420 snd_card_free(card);
421 dev_set_drvdata(pdev, NULL);
422 return 0;
423}
424
425#ifdef CONFIG_PM
426static int snd_cmi8328_suspend(struct device *pdev, unsigned int n,
427 pm_message_t state)
428{
429 struct snd_card *card = dev_get_drvdata(pdev);
430 struct snd_cmi8328 *cmi;
431
432 if (!card) /* ignore absent devices */
433 return 0;
434 cmi = card->private_data;
435 snd_cmi8328_cfg_save(cmi->port, cmi->cfg);
436 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
437 snd_pcm_suspend_all(cmi->wss->pcm);
438 cmi->wss->suspend(cmi->wss);
439
440 return 0;
441}
442
443static int snd_cmi8328_resume(struct device *pdev, unsigned int n)
444{
445 struct snd_card *card = dev_get_drvdata(pdev);
446 struct snd_cmi8328 *cmi;
447
448 if (!card) /* ignore absent devices */
449 return 0;
450 cmi = card->private_data;
451 snd_cmi8328_cfg_restore(cmi->port, cmi->cfg);
452 outb(cmi->wss_cfg, cmi->port);
453 cmi->wss->resume(cmi->wss);
454 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
455
456 return 0;
457}
458#endif
459
460static struct isa_driver snd_cmi8328_driver = {
461 .probe = snd_cmi8328_probe,
462 .remove = snd_cmi8328_remove,
463#ifdef CONFIG_PM
464 .suspend = snd_cmi8328_suspend,
465 .resume = snd_cmi8328_resume,
466#endif
467 .driver = {
468 .name = "cmi8328"
469 },
470};
471
472static int __init alsa_card_cmi8328_init(void)
473{
474 return isa_register_driver(&snd_cmi8328_driver, CMI8328_MAX);
475}
476
477static void __exit alsa_card_cmi8328_exit(void)
478{
479 isa_unregister_driver(&snd_cmi8328_driver);
480}
481
482module_init(alsa_card_cmi8328_init)
483module_exit(alsa_card_cmi8328_exit)
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index c707c52268a..fe79a169acb 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -47,7 +47,7 @@
47#include <linux/err.h> 47#include <linux/err.h>
48#include <linux/isa.h> 48#include <linux/isa.h>
49#include <linux/pnp.h> 49#include <linux/pnp.h>
50#include <linux/module.h> 50#include <linux/moduleparam.h>
51#include <sound/core.h> 51#include <sound/core.h>
52#include <sound/wss.h> 52#include <sound/wss.h>
53#include <sound/opl3.h> 53#include <sound/opl3.h>
@@ -69,9 +69,9 @@ MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8330,isapnp:{CMI0001,@@@0001,@X@0001}}}");
69 69
70static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 70static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
71static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 71static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
72static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; 72static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
73#ifdef CONFIG_PNP 73#ifdef CONFIG_PNP
74static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 74static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
75#endif 75#endif
76static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 76static long sbport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
77static int sbirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; 77static int sbirq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
@@ -193,7 +193,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_cmi8330_pnpids);
193#endif 193#endif
194 194
195 195
196static struct snd_kcontrol_new snd_cmi8330_controls[] = { 196static struct snd_kcontrol_new snd_cmi8330_controls[] __devinitdata = {
197WSS_DOUBLE("Master Playback Volume", 0, 197WSS_DOUBLE("Master Playback Volume", 0,
198 CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0), 198 CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0),
199WSS_SINGLE("Loud Playback Switch", 0, 199WSS_SINGLE("Loud Playback Switch", 0,
@@ -249,7 +249,7 @@ WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", PLAYBACK, SWITCH), 0,
249}; 249};
250 250
251#ifdef ENABLE_SB_MIXER 251#ifdef ENABLE_SB_MIXER
252static struct sbmix_elem cmi8330_sb_mixers[] = { 252static struct sbmix_elem cmi8330_sb_mixers[] __devinitdata = {
253SB_DOUBLE("SB Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31), 253SB_DOUBLE("SB Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31),
254SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15), 254SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15),
255SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15), 255SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15),
@@ -267,7 +267,7 @@ SB_DOUBLE("SB Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6
267SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1), 267SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1),
268}; 268};
269 269
270static unsigned char cmi8330_sb_init_values[][2] = { 270static unsigned char cmi8330_sb_init_values[][2] __devinitdata = {
271 { SB_DSP4_MASTER_DEV + 0, 0 }, 271 { SB_DSP4_MASTER_DEV + 0, 0 },
272 { SB_DSP4_MASTER_DEV + 1, 0 }, 272 { SB_DSP4_MASTER_DEV + 1, 0 },
273 { SB_DSP4_PCM_DEV + 0, 0 }, 273 { SB_DSP4_PCM_DEV + 0, 0 },
@@ -281,7 +281,7 @@ static unsigned char cmi8330_sb_init_values[][2] = {
281}; 281};
282 282
283 283
284static int cmi8330_add_sb_mixers(struct snd_sb *chip) 284static int __devinit cmi8330_add_sb_mixers(struct snd_sb *chip)
285{ 285{
286 int idx, err; 286 int idx, err;
287 unsigned long flags; 287 unsigned long flags;
@@ -306,7 +306,7 @@ static int cmi8330_add_sb_mixers(struct snd_sb *chip)
306} 306}
307#endif 307#endif
308 308
309static int snd_cmi8330_mixer(struct snd_card *card, struct snd_cmi8330 *acard) 309static int __devinit snd_cmi8330_mixer(struct snd_card *card, struct snd_cmi8330 *acard)
310{ 310{
311 unsigned int idx; 311 unsigned int idx;
312 int err; 312 int err;
@@ -329,9 +329,9 @@ static int snd_cmi8330_mixer(struct snd_card *card, struct snd_cmi8330 *acard)
329} 329}
330 330
331#ifdef CONFIG_PNP 331#ifdef CONFIG_PNP
332static int snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard, 332static int __devinit snd_cmi8330_pnp(int dev, struct snd_cmi8330 *acard,
333 struct pnp_card_link *card, 333 struct pnp_card_link *card,
334 const struct pnp_card_device_id *id) 334 const struct pnp_card_device_id *id)
335{ 335{
336 struct pnp_dev *pdev; 336 struct pnp_dev *pdev;
337 int err; 337 int err;
@@ -437,7 +437,7 @@ static int snd_cmi8330_capture_open(struct snd_pcm_substream *substream)
437 return chip->streams[SNDRV_PCM_STREAM_CAPTURE].open(substream); 437 return chip->streams[SNDRV_PCM_STREAM_CAPTURE].open(substream);
438} 438}
439 439
440static int snd_cmi8330_pcm(struct snd_card *card, struct snd_cmi8330 *chip) 440static int __devinit snd_cmi8330_pcm(struct snd_card *card, struct snd_cmi8330 *chip)
441{ 441{
442 struct snd_pcm *pcm; 442 struct snd_pcm *pcm;
443 const struct snd_pcm_ops *ops; 443 const struct snd_pcm_ops *ops;
@@ -532,7 +532,7 @@ static int snd_cmi8330_card_new(int dev, struct snd_card **cardp)
532 return 0; 532 return 0;
533} 533}
534 534
535static int snd_cmi8330_probe(struct snd_card *card, int dev) 535static int __devinit snd_cmi8330_probe(struct snd_card *card, int dev)
536{ 536{
537 struct snd_cmi8330 *acard; 537 struct snd_cmi8330 *acard;
538 int i, err; 538 int i, err;
@@ -597,7 +597,7 @@ static int snd_cmi8330_probe(struct snd_card *card, int dev)
597 if (mpuport[dev] != SNDRV_AUTO_PORT) { 597 if (mpuport[dev] != SNDRV_AUTO_PORT) {
598 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 598 if (snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
599 mpuport[dev], 0, mpuirq[dev], 599 mpuport[dev], 0, mpuirq[dev],
600 NULL) < 0) 600 IRQF_DISABLED, NULL) < 0)
601 printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n", 601 printk(KERN_ERR PFX "no MPU-401 device at 0x%lx.\n",
602 mpuport[dev]); 602 mpuport[dev]);
603 } 603 }
@@ -613,8 +613,8 @@ static int snd_cmi8330_probe(struct snd_card *card, int dev)
613 return snd_card_register(card); 613 return snd_card_register(card);
614} 614}
615 615
616static int snd_cmi8330_isa_match(struct device *pdev, 616static int __devinit snd_cmi8330_isa_match(struct device *pdev,
617 unsigned int dev) 617 unsigned int dev)
618{ 618{
619 if (!enable[dev] || is_isapnp_selected(dev)) 619 if (!enable[dev] || is_isapnp_selected(dev))
620 return 0; 620 return 0;
@@ -629,8 +629,8 @@ static int snd_cmi8330_isa_match(struct device *pdev,
629 return 1; 629 return 1;
630} 630}
631 631
632static int snd_cmi8330_isa_probe(struct device *pdev, 632static int __devinit snd_cmi8330_isa_probe(struct device *pdev,
633 unsigned int dev) 633 unsigned int dev)
634{ 634{
635 struct snd_card *card; 635 struct snd_card *card;
636 int err; 636 int err;
@@ -647,8 +647,8 @@ static int snd_cmi8330_isa_probe(struct device *pdev,
647 return 0; 647 return 0;
648} 648}
649 649
650static int snd_cmi8330_isa_remove(struct device *devptr, 650static int __devexit snd_cmi8330_isa_remove(struct device *devptr,
651 unsigned int dev) 651 unsigned int dev)
652{ 652{
653 snd_card_free(dev_get_drvdata(devptr)); 653 snd_card_free(dev_get_drvdata(devptr));
654 dev_set_drvdata(devptr, NULL); 654 dev_set_drvdata(devptr, NULL);
@@ -673,7 +673,7 @@ static int snd_cmi8330_isa_resume(struct device *dev, unsigned int n)
673static struct isa_driver snd_cmi8330_driver = { 673static struct isa_driver snd_cmi8330_driver = {
674 .match = snd_cmi8330_isa_match, 674 .match = snd_cmi8330_isa_match,
675 .probe = snd_cmi8330_isa_probe, 675 .probe = snd_cmi8330_isa_probe,
676 .remove = snd_cmi8330_isa_remove, 676 .remove = __devexit_p(snd_cmi8330_isa_remove),
677#ifdef CONFIG_PM 677#ifdef CONFIG_PM
678 .suspend = snd_cmi8330_isa_suspend, 678 .suspend = snd_cmi8330_isa_suspend,
679 .resume = snd_cmi8330_isa_resume, 679 .resume = snd_cmi8330_isa_resume,
@@ -685,8 +685,8 @@ static struct isa_driver snd_cmi8330_driver = {
685 685
686 686
687#ifdef CONFIG_PNP 687#ifdef CONFIG_PNP
688static int snd_cmi8330_pnp_detect(struct pnp_card_link *pcard, 688static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
689 const struct pnp_card_device_id *pid) 689 const struct pnp_card_device_id *pid)
690{ 690{
691 static int dev; 691 static int dev;
692 struct snd_card *card; 692 struct snd_card *card;
@@ -717,7 +717,7 @@ static int snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
717 return 0; 717 return 0;
718} 718}
719 719
720static void snd_cmi8330_pnp_remove(struct pnp_card_link *pcard) 720static void __devexit snd_cmi8330_pnp_remove(struct pnp_card_link * pcard)
721{ 721{
722 snd_card_free(pnp_get_card_drvdata(pcard)); 722 snd_card_free(pnp_get_card_drvdata(pcard));
723 pnp_set_card_drvdata(pcard, NULL); 723 pnp_set_card_drvdata(pcard, NULL);
@@ -740,7 +740,7 @@ static struct pnp_card_driver cmi8330_pnpc_driver = {
740 .name = "cmi8330", 740 .name = "cmi8330",
741 .id_table = snd_cmi8330_pnpids, 741 .id_table = snd_cmi8330_pnpids,
742 .probe = snd_cmi8330_pnp_detect, 742 .probe = snd_cmi8330_pnp_detect,
743 .remove = snd_cmi8330_pnp_remove, 743 .remove = __devexit_p(snd_cmi8330_pnp_remove),
744#ifdef CONFIG_PM 744#ifdef CONFIG_PM
745 .suspend = snd_cmi8330_pnp_suspend, 745 .suspend = snd_cmi8330_pnp_suspend,
746 .resume = snd_cmi8330_pnp_resume, 746 .resume = snd_cmi8330_pnp_resume,
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index aa7a5d86e48..cb9153e75b8 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -25,7 +25,7 @@
25#include <linux/isa.h> 25#include <linux/isa.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <linux/module.h> 28#include <linux/moduleparam.h>
29#include <sound/core.h> 29#include <sound/core.h>
30#include <sound/wss.h> 30#include <sound/wss.h>
31#include <sound/mpu401.h> 31#include <sound/mpu401.h>
@@ -41,7 +41,7 @@ MODULE_SUPPORTED_DEVICE("{{Crystal Semiconductors,CS4231}}");
41 41
42static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 42static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
43static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 43static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
44static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 44static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
45static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 45static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
46static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 46static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
47static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ 47static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
@@ -68,7 +68,7 @@ MODULE_PARM_DESC(dma1, "DMA1 # for " CRD_NAME " driver.");
68module_param_array(dma2, int, NULL, 0444); 68module_param_array(dma2, int, NULL, 0444);
69MODULE_PARM_DESC(dma2, "DMA2 # for " CRD_NAME " driver."); 69MODULE_PARM_DESC(dma2, "DMA2 # for " CRD_NAME " driver.");
70 70
71static int snd_cs4231_match(struct device *dev, unsigned int n) 71static int __devinit snd_cs4231_match(struct device *dev, unsigned int n)
72{ 72{
73 if (!enable[n]) 73 if (!enable[n])
74 return 0; 74 return 0;
@@ -88,7 +88,7 @@ static int snd_cs4231_match(struct device *dev, unsigned int n)
88 return 1; 88 return 1;
89} 89}
90 90
91static int snd_cs4231_probe(struct device *dev, unsigned int n) 91static int __devinit snd_cs4231_probe(struct device *dev, unsigned int n)
92{ 92{
93 struct snd_card *card; 93 struct snd_card *card;
94 struct snd_wss *chip; 94 struct snd_wss *chip;
@@ -131,6 +131,7 @@ static int snd_cs4231_probe(struct device *dev, unsigned int n)
131 mpu_irq[n] = -1; 131 mpu_irq[n] = -1;
132 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, 132 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
133 mpu_port[n], 0, mpu_irq[n], 133 mpu_port[n], 0, mpu_irq[n],
134 mpu_irq[n] >= 0 ? IRQF_DISABLED : 0,
134 NULL) < 0) 135 NULL) < 0)
135 dev_warn(dev, "MPU401 not detected\n"); 136 dev_warn(dev, "MPU401 not detected\n");
136 } 137 }
@@ -148,7 +149,7 @@ out: snd_card_free(card);
148 return error; 149 return error;
149} 150}
150 151
151static int snd_cs4231_remove(struct device *dev, unsigned int n) 152static int __devexit snd_cs4231_remove(struct device *dev, unsigned int n)
152{ 153{
153 snd_card_free(dev_get_drvdata(dev)); 154 snd_card_free(dev_get_drvdata(dev));
154 dev_set_drvdata(dev, NULL); 155 dev_set_drvdata(dev, NULL);
@@ -180,7 +181,7 @@ static int snd_cs4231_resume(struct device *dev, unsigned int n)
180static struct isa_driver snd_cs4231_driver = { 181static struct isa_driver snd_cs4231_driver = {
181 .match = snd_cs4231_match, 182 .match = snd_cs4231_match,
182 .probe = snd_cs4231_probe, 183 .probe = snd_cs4231_probe,
183 .remove = snd_cs4231_remove, 184 .remove = __devexit_p(snd_cs4231_remove),
184#ifdef CONFIG_PM 185#ifdef CONFIG_PM
185 .suspend = snd_cs4231_suspend, 186 .suspend = snd_cs4231_suspend,
186 .resume = snd_cs4231_resume, 187 .resume = snd_cs4231_resume,
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 252e9fb37db..999dc1e0fdb 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -23,7 +23,7 @@
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/isa.h> 24#include <linux/isa.h>
25#include <linux/pnp.h> 25#include <linux/pnp.h>
26#include <linux/module.h> 26#include <linux/moduleparam.h>
27#include <sound/core.h> 27#include <sound/core.h>
28#include <sound/wss.h> 28#include <sound/wss.h>
29#include <sound/mpu401.h> 29#include <sound/mpu401.h>
@@ -74,9 +74,9 @@ MODULE_ALIAS("snd_cs4232");
74 74
75static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 75static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
76static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 76static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
77static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 77static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
78#ifdef CONFIG_PNP 78#ifdef CONFIG_PNP
79static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 79static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
80#endif 80#endif
81static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 81static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
82static long cport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 82static long cport[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
@@ -251,7 +251,7 @@ static struct pnp_card_device_id snd_cs423x_pnpids[] = {
251MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids); 251MODULE_DEVICE_TABLE(pnp_card, snd_cs423x_pnpids);
252 252
253/* WSS initialization */ 253/* WSS initialization */
254static int snd_cs423x_pnp_init_wss(int dev, struct pnp_dev *pdev) 254static int __devinit snd_cs423x_pnp_init_wss(int dev, struct pnp_dev *pdev)
255{ 255{
256 if (pnp_activate_dev(pdev) < 0) { 256 if (pnp_activate_dev(pdev) < 0) {
257 printk(KERN_ERR IDENT " WSS PnP configure failed for WSS (out of resources?)\n"); 257 printk(KERN_ERR IDENT " WSS PnP configure failed for WSS (out of resources?)\n");
@@ -272,7 +272,7 @@ static int snd_cs423x_pnp_init_wss(int dev, struct pnp_dev *pdev)
272} 272}
273 273
274/* CTRL initialization */ 274/* CTRL initialization */
275static int snd_cs423x_pnp_init_ctrl(int dev, struct pnp_dev *pdev) 275static int __devinit snd_cs423x_pnp_init_ctrl(int dev, struct pnp_dev *pdev)
276{ 276{
277 if (pnp_activate_dev(pdev) < 0) { 277 if (pnp_activate_dev(pdev) < 0) {
278 printk(KERN_ERR IDENT " CTRL PnP configure failed for WSS (out of resources?)\n"); 278 printk(KERN_ERR IDENT " CTRL PnP configure failed for WSS (out of resources?)\n");
@@ -284,7 +284,7 @@ static int snd_cs423x_pnp_init_ctrl(int dev, struct pnp_dev *pdev)
284} 284}
285 285
286/* MPU initialization */ 286/* MPU initialization */
287static int snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev) 287static int __devinit snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev)
288{ 288{
289 if (pnp_activate_dev(pdev) < 0) { 289 if (pnp_activate_dev(pdev) < 0) {
290 printk(KERN_ERR IDENT " MPU401 PnP configure failed for WSS (out of resources?)\n"); 290 printk(KERN_ERR IDENT " MPU401 PnP configure failed for WSS (out of resources?)\n");
@@ -303,9 +303,9 @@ static int snd_cs423x_pnp_init_mpu(int dev, struct pnp_dev *pdev)
303 return 0; 303 return 0;
304} 304}
305 305
306static int snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard, 306static int __devinit snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard,
307 struct pnp_dev *pdev, 307 struct pnp_dev *pdev,
308 struct pnp_dev *cdev) 308 struct pnp_dev *cdev)
309{ 309{
310 acard->wss = pdev; 310 acard->wss = pdev;
311 if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0) 311 if (snd_cs423x_pnp_init_wss(dev, acard->wss) < 0)
@@ -317,9 +317,9 @@ static int snd_card_cs423x_pnp(int dev, struct snd_card_cs4236 *acard,
317 return 0; 317 return 0;
318} 318}
319 319
320static int snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard, 320static int __devinit snd_card_cs423x_pnpc(int dev, struct snd_card_cs4236 *acard,
321 struct pnp_card_link *card, 321 struct pnp_card_link *card,
322 const struct pnp_card_device_id *id) 322 const struct pnp_card_device_id *id)
323{ 323{
324 acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL); 324 acard->wss = pnp_request_card_device(card, id->devs[0].id, NULL);
325 if (acard->wss == NULL) 325 if (acard->wss == NULL)
@@ -378,7 +378,7 @@ static int snd_cs423x_card_new(int dev, struct snd_card **cardp)
378 return 0; 378 return 0;
379} 379}
380 380
381static int snd_cs423x_probe(struct snd_card *card, int dev) 381static int __devinit snd_cs423x_probe(struct snd_card *card, int dev)
382{ 382{
383 struct snd_card_cs4236 *acard; 383 struct snd_card_cs4236 *acard;
384 struct snd_pcm *pcm; 384 struct snd_pcm *pcm;
@@ -449,15 +449,16 @@ static int snd_cs423x_probe(struct snd_card *card, int dev)
449 mpu_irq[dev] = -1; 449 mpu_irq[dev] = -1;
450 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232, 450 if (snd_mpu401_uart_new(card, 0, MPU401_HW_CS4232,
451 mpu_port[dev], 0, 451 mpu_port[dev], 0,
452 mpu_irq[dev], NULL) < 0) 452 mpu_irq[dev],
453 mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0, NULL) < 0)
453 printk(KERN_WARNING IDENT ": MPU401 not detected\n"); 454 printk(KERN_WARNING IDENT ": MPU401 not detected\n");
454 } 455 }
455 456
456 return snd_card_register(card); 457 return snd_card_register(card);
457} 458}
458 459
459static int snd_cs423x_isa_match(struct device *pdev, 460static int __devinit snd_cs423x_isa_match(struct device *pdev,
460 unsigned int dev) 461 unsigned int dev)
461{ 462{
462 if (!enable[dev] || is_isapnp_selected(dev)) 463 if (!enable[dev] || is_isapnp_selected(dev))
463 return 0; 464 return 0;
@@ -481,8 +482,8 @@ static int snd_cs423x_isa_match(struct device *pdev,
481 return 1; 482 return 1;
482} 483}
483 484
484static int snd_cs423x_isa_probe(struct device *pdev, 485static int __devinit snd_cs423x_isa_probe(struct device *pdev,
485 unsigned int dev) 486 unsigned int dev)
486{ 487{
487 struct snd_card *card; 488 struct snd_card *card;
488 int err; 489 int err;
@@ -500,8 +501,8 @@ static int snd_cs423x_isa_probe(struct device *pdev,
500 return 0; 501 return 0;
501} 502}
502 503
503static int snd_cs423x_isa_remove(struct device *pdev, 504static int __devexit snd_cs423x_isa_remove(struct device *pdev,
504 unsigned int dev) 505 unsigned int dev)
505{ 506{
506 snd_card_free(dev_get_drvdata(pdev)); 507 snd_card_free(dev_get_drvdata(pdev));
507 dev_set_drvdata(pdev, NULL); 508 dev_set_drvdata(pdev, NULL);
@@ -540,7 +541,7 @@ static int snd_cs423x_isa_resume(struct device *dev, unsigned int n)
540static struct isa_driver cs423x_isa_driver = { 541static struct isa_driver cs423x_isa_driver = {
541 .match = snd_cs423x_isa_match, 542 .match = snd_cs423x_isa_match,
542 .probe = snd_cs423x_isa_probe, 543 .probe = snd_cs423x_isa_probe,
543 .remove = snd_cs423x_isa_remove, 544 .remove = __devexit_p(snd_cs423x_isa_remove),
544#ifdef CONFIG_PM 545#ifdef CONFIG_PM
545 .suspend = snd_cs423x_isa_suspend, 546 .suspend = snd_cs423x_isa_suspend,
546 .resume = snd_cs423x_isa_resume, 547 .resume = snd_cs423x_isa_resume,
@@ -552,8 +553,8 @@ static struct isa_driver cs423x_isa_driver = {
552 553
553 554
554#ifdef CONFIG_PNP 555#ifdef CONFIG_PNP
555static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev, 556static int __devinit snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,
556 const struct pnp_device_id *id) 557 const struct pnp_device_id *id)
557{ 558{
558 static int dev; 559 static int dev;
559 int err; 560 int err;
@@ -597,7 +598,7 @@ static int snd_cs423x_pnpbios_detect(struct pnp_dev *pdev,
597 return 0; 598 return 0;
598} 599}
599 600
600static void snd_cs423x_pnp_remove(struct pnp_dev *pdev) 601static void __devexit snd_cs423x_pnp_remove(struct pnp_dev *pdev)
601{ 602{
602 snd_card_free(pnp_get_drvdata(pdev)); 603 snd_card_free(pnp_get_drvdata(pdev));
603 pnp_set_drvdata(pdev, NULL); 604 pnp_set_drvdata(pdev, NULL);
@@ -619,15 +620,15 @@ static struct pnp_driver cs423x_pnp_driver = {
619 .name = "cs423x-pnpbios", 620 .name = "cs423x-pnpbios",
620 .id_table = snd_cs423x_pnpbiosids, 621 .id_table = snd_cs423x_pnpbiosids,
621 .probe = snd_cs423x_pnpbios_detect, 622 .probe = snd_cs423x_pnpbios_detect,
622 .remove = snd_cs423x_pnp_remove, 623 .remove = __devexit_p(snd_cs423x_pnp_remove),
623#ifdef CONFIG_PM 624#ifdef CONFIG_PM
624 .suspend = snd_cs423x_pnp_suspend, 625 .suspend = snd_cs423x_pnp_suspend,
625 .resume = snd_cs423x_pnp_resume, 626 .resume = snd_cs423x_pnp_resume,
626#endif 627#endif
627}; 628};
628 629
629static int snd_cs423x_pnpc_detect(struct pnp_card_link *pcard, 630static int __devinit snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
630 const struct pnp_card_device_id *pid) 631 const struct pnp_card_device_id *pid)
631{ 632{
632 static int dev; 633 static int dev;
633 struct snd_card *card; 634 struct snd_card *card;
@@ -659,7 +660,7 @@ static int snd_cs423x_pnpc_detect(struct pnp_card_link *pcard,
659 return 0; 660 return 0;
660} 661}
661 662
662static void snd_cs423x_pnpc_remove(struct pnp_card_link *pcard) 663static void __devexit snd_cs423x_pnpc_remove(struct pnp_card_link * pcard)
663{ 664{
664 snd_card_free(pnp_get_card_drvdata(pcard)); 665 snd_card_free(pnp_get_card_drvdata(pcard));
665 pnp_set_card_drvdata(pcard, NULL); 666 pnp_set_card_drvdata(pcard, NULL);
@@ -682,7 +683,7 @@ static struct pnp_card_driver cs423x_pnpc_driver = {
682 .name = CS423X_ISAPNP_DRIVER, 683 .name = CS423X_ISAPNP_DRIVER,
683 .id_table = snd_cs423x_pnpids, 684 .id_table = snd_cs423x_pnpids,
684 .probe = snd_cs423x_pnpc_detect, 685 .probe = snd_cs423x_pnpc_detect,
685 .remove = snd_cs423x_pnpc_remove, 686 .remove = __devexit_p(snd_cs423x_pnpc_remove),
686#ifdef CONFIG_PM 687#ifdef CONFIG_PM
687 .suspend = snd_cs423x_pnpc_suspend, 688 .suspend = snd_cs423x_pnpc_suspend,
688 .resume = snd_cs423x_pnpc_resume, 689 .resume = snd_cs423x_pnpc_resume,
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 102874a703d..0cde8131a57 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -25,7 +25,7 @@
25#include <linux/isapnp.h> 25#include <linux/isapnp.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <linux/module.h> 28#include <linux/moduleparam.h>
29#include <asm/dma.h> 29#include <asm/dma.h>
30#include <sound/core.h> 30#include <sound/core.h>
31#include <sound/es1688.h> 31#include <sound/es1688.h>
@@ -51,9 +51,9 @@ MODULE_ALIAS("snd_es968");
51static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 51static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
52static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 52static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
53#ifdef CONFIG_PNP 53#ifdef CONFIG_PNP
54static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; 54static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
55#endif 55#endif
56static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 56static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
57static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 57static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
58static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */ 58static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* Usually 0x388 */
59static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; 59static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
@@ -90,13 +90,13 @@ MODULE_PARM_DESC(dma8, "8-bit DMA # for " CRD_NAME " driver.");
90#define is_isapnp_selected(dev) 0 90#define is_isapnp_selected(dev) 0
91#endif 91#endif
92 92
93static int snd_es1688_match(struct device *dev, unsigned int n) 93static int __devinit snd_es1688_match(struct device *dev, unsigned int n)
94{ 94{
95 return enable[n] && !is_isapnp_selected(n); 95 return enable[n] && !is_isapnp_selected(n);
96} 96}
97 97
98static int snd_es1688_legacy_create(struct snd_card *card, 98static int __devinit snd_es1688_legacy_create(struct snd_card *card,
99 struct device *dev, unsigned int n) 99 struct device *dev, unsigned int n)
100{ 100{
101 struct snd_es1688 *chip = card->private_data; 101 struct snd_es1688 *chip = card->private_data;
102 static long possible_ports[] = {0x220, 0x240, 0x260}; 102 static long possible_ports[] = {0x220, 0x240, 0x260};
@@ -134,7 +134,7 @@ static int snd_es1688_legacy_create(struct snd_card *card,
134 return error; 134 return error;
135} 135}
136 136
137static int snd_es1688_probe(struct snd_card *card, unsigned int n) 137static int __devinit snd_es1688_probe(struct snd_card *card, unsigned int n)
138{ 138{
139 struct snd_es1688 *chip = card->private_data; 139 struct snd_es1688 *chip = card->private_data;
140 struct snd_opl3 *opl3; 140 struct snd_opl3 *opl3;
@@ -174,7 +174,7 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
174 chip->mpu_port > 0) { 174 chip->mpu_port > 0) {
175 error = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688, 175 error = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
176 chip->mpu_port, 0, 176 chip->mpu_port, 0,
177 mpu_irq[n], NULL); 177 mpu_irq[n], IRQF_DISABLED, NULL);
178 if (error < 0) 178 if (error < 0)
179 return error; 179 return error;
180 } 180 }
@@ -182,7 +182,7 @@ static int snd_es1688_probe(struct snd_card *card, unsigned int n)
182 return snd_card_register(card); 182 return snd_card_register(card);
183} 183}
184 184
185static int snd_es1688_isa_probe(struct device *dev, unsigned int n) 185static int __devinit snd_es1688_isa_probe(struct device *dev, unsigned int n)
186{ 186{
187 struct snd_card *card; 187 struct snd_card *card;
188 int error; 188 int error;
@@ -210,7 +210,7 @@ out:
210 return error; 210 return error;
211} 211}
212 212
213static int snd_es1688_isa_remove(struct device *dev, unsigned int n) 213static int __devexit snd_es1688_isa_remove(struct device *dev, unsigned int n)
214{ 214{
215 snd_card_free(dev_get_drvdata(dev)); 215 snd_card_free(dev_get_drvdata(dev));
216 dev_set_drvdata(dev, NULL); 216 dev_set_drvdata(dev, NULL);
@@ -220,7 +220,7 @@ static int snd_es1688_isa_remove(struct device *dev, unsigned int n)
220static struct isa_driver snd_es1688_driver = { 220static struct isa_driver snd_es1688_driver = {
221 .match = snd_es1688_match, 221 .match = snd_es1688_match,
222 .probe = snd_es1688_isa_probe, 222 .probe = snd_es1688_isa_probe,
223 .remove = snd_es1688_isa_remove, 223 .remove = __devexit_p(snd_es1688_isa_remove),
224#if 0 /* FIXME */ 224#if 0 /* FIXME */
225 .suspend = snd_es1688_suspend, 225 .suspend = snd_es1688_suspend,
226 .resume = snd_es1688_resume, 226 .resume = snd_es1688_resume,
@@ -233,9 +233,9 @@ static struct isa_driver snd_es1688_driver = {
233static int snd_es968_pnp_is_probed; 233static int snd_es968_pnp_is_probed;
234 234
235#ifdef CONFIG_PNP 235#ifdef CONFIG_PNP
236static int snd_card_es968_pnp(struct snd_card *card, unsigned int n, 236static int __devinit snd_card_es968_pnp(struct snd_card *card, unsigned int n,
237 struct pnp_card_link *pcard, 237 struct pnp_card_link *pcard,
238 const struct pnp_card_device_id *pid) 238 const struct pnp_card_device_id *pid)
239{ 239{
240 struct snd_es1688 *chip = card->private_data; 240 struct snd_es1688 *chip = card->private_data;
241 struct pnp_dev *pdev; 241 struct pnp_dev *pdev;
@@ -258,8 +258,8 @@ static int snd_card_es968_pnp(struct snd_card *card, unsigned int n,
258 mpu_irq[n], dma8[n], ES1688_HW_AUTO); 258 mpu_irq[n], dma8[n], ES1688_HW_AUTO);
259} 259}
260 260
261static int snd_es968_pnp_detect(struct pnp_card_link *pcard, 261static int __devinit snd_es968_pnp_detect(struct pnp_card_link *pcard,
262 const struct pnp_card_device_id *pid) 262 const struct pnp_card_device_id *pid)
263{ 263{
264 struct snd_card *card; 264 struct snd_card *card;
265 static unsigned int dev; 265 static unsigned int dev;
@@ -295,7 +295,7 @@ static int snd_es968_pnp_detect(struct pnp_card_link *pcard,
295 return 0; 295 return 0;
296} 296}
297 297
298static void snd_es968_pnp_remove(struct pnp_card_link *pcard) 298static void __devexit snd_es968_pnp_remove(struct pnp_card_link * pcard)
299{ 299{
300 snd_card_free(pnp_get_card_drvdata(pcard)); 300 snd_card_free(pnp_get_card_drvdata(pcard));
301 pnp_set_card_drvdata(pcard, NULL); 301 pnp_set_card_drvdata(pcard, NULL);
@@ -338,7 +338,7 @@ static struct pnp_card_driver es968_pnpc_driver = {
338 .name = DEV_NAME " PnP", 338 .name = DEV_NAME " PnP",
339 .id_table = snd_es968_pnpids, 339 .id_table = snd_es968_pnpids,
340 .probe = snd_es968_pnp_detect, 340 .probe = snd_es968_pnp_detect,
341 .remove = snd_es968_pnp_remove, 341 .remove = __devexit_p(snd_es968_pnp_remove),
342#ifdef CONFIG_PM 342#ifdef CONFIG_PM
343 .suspend = snd_es968_pnp_suspend, 343 .suspend = snd_es968_pnp_suspend,
344 .resume = snd_es968_pnp_resume, 344 .resume = snd_es968_pnp_resume,
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c
index b3b4f15e45b..07676200496 100644
--- a/sound/isa/es1688/es1688_lib.c
+++ b/sound/isa/es1688/es1688_lib.c
@@ -24,7 +24,6 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/module.h>
28#include <sound/core.h> 27#include <sound/core.h>
29#include <sound/es1688.h> 28#include <sound/es1688.h>
30#include <sound/initval.h> 29#include <sound/initval.h>
@@ -612,10 +611,10 @@ static int snd_es1688_capture_close(struct snd_pcm_substream *substream)
612 611
613static int snd_es1688_free(struct snd_es1688 *chip) 612static int snd_es1688_free(struct snd_es1688 *chip)
614{ 613{
615 if (chip->hardware != ES1688_HW_UNDEF) 614 if (chip->res_port) {
616 snd_es1688_init(chip, 0); 615 snd_es1688_init(chip, 0);
617 if (chip->res_port)
618 release_and_free_resource(chip->res_port); 616 release_and_free_resource(chip->res_port);
617 }
619 if (chip->irq >= 0) 618 if (chip->irq >= 0)
620 free_irq(chip->irq, (void *) chip); 619 free_irq(chip->irq, (void *) chip);
621 if (chip->dma8 >= 0) { 620 if (chip->dma8 >= 0) {
@@ -657,27 +656,19 @@ int snd_es1688_create(struct snd_card *card,
657 return -ENOMEM; 656 return -ENOMEM;
658 chip->irq = -1; 657 chip->irq = -1;
659 chip->dma8 = -1; 658 chip->dma8 = -1;
660 chip->hardware = ES1688_HW_UNDEF;
661 659
662 chip->res_port = request_region(port + 4, 12, "ES1688"); 660 if ((chip->res_port = request_region(port + 4, 12, "ES1688")) == NULL) {
663 if (chip->res_port == NULL) {
664 snd_printk(KERN_ERR "es1688: can't grab port 0x%lx\n", port + 4); 661 snd_printk(KERN_ERR "es1688: can't grab port 0x%lx\n", port + 4);
665 err = -EBUSY; 662 return -EBUSY;
666 goto exit;
667 } 663 }
668 664 if (request_irq(irq, snd_es1688_interrupt, IRQF_DISABLED, "ES1688", (void *) chip)) {
669 err = request_irq(irq, snd_es1688_interrupt, 0, "ES1688", (void *) chip);
670 if (err < 0) {
671 snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq); 665 snd_printk(KERN_ERR "es1688: can't grab IRQ %d\n", irq);
672 goto exit; 666 return -EBUSY;
673 } 667 }
674
675 chip->irq = irq; 668 chip->irq = irq;
676 err = request_dma(dma8, "ES1688"); 669 if (request_dma(dma8, "ES1688")) {
677
678 if (err < 0) {
679 snd_printk(KERN_ERR "es1688: can't grab DMA8 %d\n", dma8); 670 snd_printk(KERN_ERR "es1688: can't grab DMA8 %d\n", dma8);
680 goto exit; 671 return -EBUSY;
681 } 672 }
682 chip->dma8 = dma8; 673 chip->dma8 = dma8;
683 674
@@ -693,18 +684,14 @@ int snd_es1688_create(struct snd_card *card,
693 684
694 err = snd_es1688_probe(chip); 685 err = snd_es1688_probe(chip);
695 if (err < 0) 686 if (err < 0)
696 goto exit; 687 return err;
697 688
698 err = snd_es1688_init(chip, 1); 689 err = snd_es1688_init(chip, 1);
699 if (err < 0) 690 if (err < 0)
700 goto exit; 691 return err;
701 692
702 /* Register device */ 693 /* Register device */
703 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); 694 return snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
704exit:
705 if (err)
706 snd_es1688_free(chip);
707 return err;
708} 695}
709 696
710static struct snd_pcm_ops snd_es1688_playback_ops = { 697static struct snd_pcm_ops snd_es1688_playback_ops = {
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 24380efe31a..fb4d6b34bbc 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -82,7 +82,7 @@
82#include <linux/isa.h> 82#include <linux/isa.h>
83#include <linux/pnp.h> 83#include <linux/pnp.h>
84#include <linux/isapnp.h> 84#include <linux/isapnp.h>
85#include <linux/module.h> 85#include <linux/moduleparam.h>
86#include <linux/delay.h> 86#include <linux/delay.h>
87 87
88#include <asm/io.h> 88#include <asm/io.h>
@@ -348,7 +348,7 @@ static inline int snd_es18xx_mixer_writable(struct snd_es18xx *chip, unsigned ch
348} 348}
349 349
350 350
351static int snd_es18xx_reset(struct snd_es18xx *chip) 351static int __devinit snd_es18xx_reset(struct snd_es18xx *chip)
352{ 352{
353 int i; 353 int i;
354 outb(0x03, chip->port + 0x06); 354 outb(0x03, chip->port + 0x06);
@@ -1363,7 +1363,7 @@ static struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = {
1363ES18XX_SINGLE("Hardware Master Volume Split", 0, 0x64, 7, 1, 0), 1363ES18XX_SINGLE("Hardware Master Volume Split", 0, 0x64, 7, 1, 0),
1364}; 1364};
1365 1365
1366static int snd_es18xx_config_read(struct snd_es18xx *chip, unsigned char reg) 1366static int __devinit snd_es18xx_config_read(struct snd_es18xx *chip, unsigned char reg)
1367{ 1367{
1368 int data; 1368 int data;
1369 1369
@@ -1372,8 +1372,8 @@ static int snd_es18xx_config_read(struct snd_es18xx *chip, unsigned char reg)
1372 return data; 1372 return data;
1373} 1373}
1374 1374
1375static void snd_es18xx_config_write(struct snd_es18xx *chip, 1375static void __devinit snd_es18xx_config_write(struct snd_es18xx *chip,
1376 unsigned char reg, unsigned char data) 1376 unsigned char reg, unsigned char data)
1377{ 1377{
1378 /* No need for spinlocks, this function is used only in 1378 /* No need for spinlocks, this function is used only in
1379 otherwise protected init code */ 1379 otherwise protected init code */
@@ -1384,9 +1384,9 @@ static void snd_es18xx_config_write(struct snd_es18xx *chip,
1384#endif 1384#endif
1385} 1385}
1386 1386
1387static int snd_es18xx_initialize(struct snd_es18xx *chip, 1387static int __devinit snd_es18xx_initialize(struct snd_es18xx *chip,
1388 unsigned long mpu_port, 1388 unsigned long mpu_port,
1389 unsigned long fm_port) 1389 unsigned long fm_port)
1390{ 1390{
1391 int mask = 0; 1391 int mask = 0;
1392 1392
@@ -1549,7 +1549,7 @@ static int snd_es18xx_initialize(struct snd_es18xx *chip,
1549 return 0; 1549 return 0;
1550} 1550}
1551 1551
1552static int snd_es18xx_identify(struct snd_es18xx *chip) 1552static int __devinit snd_es18xx_identify(struct snd_es18xx *chip)
1553{ 1553{
1554 int hi,lo; 1554 int hi,lo;
1555 1555
@@ -1618,9 +1618,9 @@ static int snd_es18xx_identify(struct snd_es18xx *chip)
1618 return 0; 1618 return 0;
1619} 1619}
1620 1620
1621static int snd_es18xx_probe(struct snd_es18xx *chip, 1621static int __devinit snd_es18xx_probe(struct snd_es18xx *chip,
1622 unsigned long mpu_port, 1622 unsigned long mpu_port,
1623 unsigned long fm_port) 1623 unsigned long fm_port)
1624{ 1624{
1625 if (snd_es18xx_identify(chip) < 0) { 1625 if (snd_es18xx_identify(chip) < 0) {
1626 snd_printk(KERN_ERR PFX "[0x%lx] ESS chip not found\n", chip->port); 1626 snd_printk(KERN_ERR PFX "[0x%lx] ESS chip not found\n", chip->port);
@@ -1680,8 +1680,8 @@ static struct snd_pcm_ops snd_es18xx_capture_ops = {
1680 .pointer = snd_es18xx_capture_pointer, 1680 .pointer = snd_es18xx_capture_pointer,
1681}; 1681};
1682 1682
1683static int snd_es18xx_pcm(struct snd_card *card, int device, 1683static int __devinit snd_es18xx_pcm(struct snd_card *card, int device,
1684 struct snd_pcm **rpcm) 1684 struct snd_pcm **rpcm)
1685{ 1685{
1686 struct snd_es18xx *chip = card->private_data; 1686 struct snd_es18xx *chip = card->private_data;
1687 struct snd_pcm *pcm; 1687 struct snd_pcm *pcm;
@@ -1777,11 +1777,11 @@ static int snd_es18xx_dev_free(struct snd_device *device)
1777 return snd_es18xx_free(device->card); 1777 return snd_es18xx_free(device->card);
1778} 1778}
1779 1779
1780static int snd_es18xx_new_device(struct snd_card *card, 1780static int __devinit snd_es18xx_new_device(struct snd_card *card,
1781 unsigned long port, 1781 unsigned long port,
1782 unsigned long mpu_port, 1782 unsigned long mpu_port,
1783 unsigned long fm_port, 1783 unsigned long fm_port,
1784 int irq, int dma1, int dma2) 1784 int irq, int dma1, int dma2)
1785{ 1785{
1786 struct snd_es18xx *chip = card->private_data; 1786 struct snd_es18xx *chip = card->private_data;
1787 static struct snd_device_ops ops = { 1787 static struct snd_device_ops ops = {
@@ -1805,7 +1805,7 @@ static int snd_es18xx_new_device(struct snd_card *card,
1805 return -EBUSY; 1805 return -EBUSY;
1806 } 1806 }
1807 1807
1808 if (request_irq(irq, snd_es18xx_interrupt, 0, "ES18xx", 1808 if (request_irq(irq, snd_es18xx_interrupt, IRQF_DISABLED, "ES18xx",
1809 (void *) card)) { 1809 (void *) card)) {
1810 snd_es18xx_free(card); 1810 snd_es18xx_free(card);
1811 snd_printk(KERN_ERR PFX "unable to grap IRQ %d\n", irq); 1811 snd_printk(KERN_ERR PFX "unable to grap IRQ %d\n", irq);
@@ -1839,7 +1839,7 @@ static int snd_es18xx_new_device(struct snd_card *card,
1839 return 0; 1839 return 0;
1840} 1840}
1841 1841
1842static int snd_es18xx_mixer(struct snd_card *card) 1842static int __devinit snd_es18xx_mixer(struct snd_card *card)
1843{ 1843{
1844 struct snd_es18xx *chip = card->private_data; 1844 struct snd_es18xx *chip = card->private_data;
1845 int err; 1845 int err;
@@ -1964,9 +1964,9 @@ MODULE_SUPPORTED_DEVICE("{{ESS,ES1868 PnP AudioDrive},"
1964 1964
1965static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 1965static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
1966static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 1966static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
1967static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 1967static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
1968#ifdef CONFIG_PNP 1968#ifdef CONFIG_PNP
1969static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; 1969static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP;
1970#endif 1970#endif
1971static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */ 1971static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */
1972#ifndef CONFIG_PNP 1972#ifndef CONFIG_PNP
@@ -2016,7 +2016,7 @@ static struct pnp_device_id snd_audiodrive_pnpbiosids[] = {
2016MODULE_DEVICE_TABLE(pnp, snd_audiodrive_pnpbiosids); 2016MODULE_DEVICE_TABLE(pnp, snd_audiodrive_pnpbiosids);
2017 2017
2018/* PnP main device initialization */ 2018/* PnP main device initialization */
2019static int snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev) 2019static int __devinit snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev)
2020{ 2020{
2021 if (pnp_activate_dev(pdev) < 0) { 2021 if (pnp_activate_dev(pdev) < 0) {
2022 snd_printk(KERN_ERR PFX "PnP configure failure (out of resources?)\n"); 2022 snd_printk(KERN_ERR PFX "PnP configure failure (out of resources?)\n");
@@ -2043,8 +2043,8 @@ static int snd_audiodrive_pnp_init_main(int dev, struct pnp_dev *pdev)
2043 return 0; 2043 return 0;
2044} 2044}
2045 2045
2046static int snd_audiodrive_pnp(int dev, struct snd_es18xx *chip, 2046static int __devinit snd_audiodrive_pnp(int dev, struct snd_es18xx *chip,
2047 struct pnp_dev *pdev) 2047 struct pnp_dev *pdev)
2048{ 2048{
2049 chip->dev = pdev; 2049 chip->dev = pdev;
2050 if (snd_audiodrive_pnp_init_main(dev, chip->dev) < 0) 2050 if (snd_audiodrive_pnp_init_main(dev, chip->dev) < 0)
@@ -2073,9 +2073,9 @@ static struct pnp_card_device_id snd_audiodrive_pnpids[] = {
2073 2073
2074MODULE_DEVICE_TABLE(pnp_card, snd_audiodrive_pnpids); 2074MODULE_DEVICE_TABLE(pnp_card, snd_audiodrive_pnpids);
2075 2075
2076static int snd_audiodrive_pnpc(int dev, struct snd_es18xx *chip, 2076static int __devinit snd_audiodrive_pnpc(int dev, struct snd_es18xx *chip,
2077 struct pnp_card_link *card, 2077 struct pnp_card_link *card,
2078 const struct pnp_card_device_id *id) 2078 const struct pnp_card_device_id *id)
2079{ 2079{
2080 chip->dev = pnp_request_card_device(card, id->devs[0].id, NULL); 2080 chip->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
2081 if (chip->dev == NULL) 2081 if (chip->dev == NULL)
@@ -2111,7 +2111,7 @@ static int snd_es18xx_card_new(int dev, struct snd_card **cardp)
2111 sizeof(struct snd_es18xx), cardp); 2111 sizeof(struct snd_es18xx), cardp);
2112} 2112}
2113 2113
2114static int snd_audiodrive_probe(struct snd_card *card, int dev) 2114static int __devinit snd_audiodrive_probe(struct snd_card *card, int dev)
2115{ 2115{
2116 struct snd_es18xx *chip = card->private_data; 2116 struct snd_es18xx *chip = card->private_data;
2117 struct snd_opl3 *opl3; 2117 struct snd_opl3 *opl3;
@@ -2160,8 +2160,8 @@ static int snd_audiodrive_probe(struct snd_card *card, int dev)
2160 2160
2161 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) { 2161 if (mpu_port[dev] > 0 && mpu_port[dev] != SNDRV_AUTO_PORT) {
2162 err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES18XX, 2162 err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES18XX,
2163 mpu_port[dev], MPU401_INFO_IRQ_HOOK, 2163 mpu_port[dev], 0,
2164 -1, &chip->rmidi); 2164 irq[dev], 0, &chip->rmidi);
2165 if (err < 0) 2165 if (err < 0)
2166 return err; 2166 return err;
2167 } 2167 }
@@ -2169,12 +2169,12 @@ static int snd_audiodrive_probe(struct snd_card *card, int dev)
2169 return snd_card_register(card); 2169 return snd_card_register(card);
2170} 2170}
2171 2171
2172static int snd_es18xx_isa_match(struct device *pdev, unsigned int dev) 2172static int __devinit snd_es18xx_isa_match(struct device *pdev, unsigned int dev)
2173{ 2173{
2174 return enable[dev] && !is_isapnp_selected(dev); 2174 return enable[dev] && !is_isapnp_selected(dev);
2175} 2175}
2176 2176
2177static int snd_es18xx_isa_probe1(int dev, struct device *devptr) 2177static int __devinit snd_es18xx_isa_probe1(int dev, struct device *devptr)
2178{ 2178{
2179 struct snd_card *card; 2179 struct snd_card *card;
2180 int err; 2180 int err;
@@ -2191,7 +2191,7 @@ static int snd_es18xx_isa_probe1(int dev, struct device *devptr)
2191 return 0; 2191 return 0;
2192} 2192}
2193 2193
2194static int snd_es18xx_isa_probe(struct device *pdev, unsigned int dev) 2194static int __devinit snd_es18xx_isa_probe(struct device *pdev, unsigned int dev)
2195{ 2195{
2196 int err; 2196 int err;
2197 static int possible_irqs[] = {5, 9, 10, 7, 11, 12, -1}; 2197 static int possible_irqs[] = {5, 9, 10, 7, 11, 12, -1};
@@ -2231,8 +2231,8 @@ static int snd_es18xx_isa_probe(struct device *pdev, unsigned int dev)
2231 } 2231 }
2232} 2232}
2233 2233
2234static int snd_es18xx_isa_remove(struct device *devptr, 2234static int __devexit snd_es18xx_isa_remove(struct device *devptr,
2235 unsigned int dev) 2235 unsigned int dev)
2236{ 2236{
2237 snd_card_free(dev_get_drvdata(devptr)); 2237 snd_card_free(dev_get_drvdata(devptr));
2238 dev_set_drvdata(devptr, NULL); 2238 dev_set_drvdata(devptr, NULL);
@@ -2257,7 +2257,7 @@ static int snd_es18xx_isa_resume(struct device *dev, unsigned int n)
2257static struct isa_driver snd_es18xx_isa_driver = { 2257static struct isa_driver snd_es18xx_isa_driver = {
2258 .match = snd_es18xx_isa_match, 2258 .match = snd_es18xx_isa_match,
2259 .probe = snd_es18xx_isa_probe, 2259 .probe = snd_es18xx_isa_probe,
2260 .remove = snd_es18xx_isa_remove, 2260 .remove = __devexit_p(snd_es18xx_isa_remove),
2261#ifdef CONFIG_PM 2261#ifdef CONFIG_PM
2262 .suspend = snd_es18xx_isa_suspend, 2262 .suspend = snd_es18xx_isa_suspend,
2263 .resume = snd_es18xx_isa_resume, 2263 .resume = snd_es18xx_isa_resume,
@@ -2269,8 +2269,8 @@ static struct isa_driver snd_es18xx_isa_driver = {
2269 2269
2270 2270
2271#ifdef CONFIG_PNP 2271#ifdef CONFIG_PNP
2272static int snd_audiodrive_pnp_detect(struct pnp_dev *pdev, 2272static int __devinit snd_audiodrive_pnp_detect(struct pnp_dev *pdev,
2273 const struct pnp_device_id *id) 2273 const struct pnp_device_id *id)
2274{ 2274{
2275 static int dev; 2275 static int dev;
2276 int err; 2276 int err;
@@ -2302,7 +2302,7 @@ static int snd_audiodrive_pnp_detect(struct pnp_dev *pdev,
2302 return 0; 2302 return 0;
2303} 2303}
2304 2304
2305static void snd_audiodrive_pnp_remove(struct pnp_dev *pdev) 2305static void __devexit snd_audiodrive_pnp_remove(struct pnp_dev * pdev)
2306{ 2306{
2307 snd_card_free(pnp_get_drvdata(pdev)); 2307 snd_card_free(pnp_get_drvdata(pdev));
2308 pnp_set_drvdata(pdev, NULL); 2308 pnp_set_drvdata(pdev, NULL);
@@ -2323,15 +2323,15 @@ static struct pnp_driver es18xx_pnp_driver = {
2323 .name = "es18xx-pnpbios", 2323 .name = "es18xx-pnpbios",
2324 .id_table = snd_audiodrive_pnpbiosids, 2324 .id_table = snd_audiodrive_pnpbiosids,
2325 .probe = snd_audiodrive_pnp_detect, 2325 .probe = snd_audiodrive_pnp_detect,
2326 .remove = snd_audiodrive_pnp_remove, 2326 .remove = __devexit_p(snd_audiodrive_pnp_remove),
2327#ifdef CONFIG_PM 2327#ifdef CONFIG_PM
2328 .suspend = snd_audiodrive_pnp_suspend, 2328 .suspend = snd_audiodrive_pnp_suspend,
2329 .resume = snd_audiodrive_pnp_resume, 2329 .resume = snd_audiodrive_pnp_resume,
2330#endif 2330#endif
2331}; 2331};
2332 2332
2333static int snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard, 2333static int __devinit snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard,
2334 const struct pnp_card_device_id *pid) 2334 const struct pnp_card_device_id *pid)
2335{ 2335{
2336 static int dev; 2336 static int dev;
2337 struct snd_card *card; 2337 struct snd_card *card;
@@ -2363,7 +2363,7 @@ static int snd_audiodrive_pnpc_detect(struct pnp_card_link *pcard,
2363 return 0; 2363 return 0;
2364} 2364}
2365 2365
2366static void snd_audiodrive_pnpc_remove(struct pnp_card_link *pcard) 2366static void __devexit snd_audiodrive_pnpc_remove(struct pnp_card_link * pcard)
2367{ 2367{
2368 snd_card_free(pnp_get_card_drvdata(pcard)); 2368 snd_card_free(pnp_get_card_drvdata(pcard));
2369 pnp_set_card_drvdata(pcard, NULL); 2369 pnp_set_card_drvdata(pcard, NULL);
@@ -2387,7 +2387,7 @@ static struct pnp_card_driver es18xx_pnpc_driver = {
2387 .name = "es18xx", 2387 .name = "es18xx",
2388 .id_table = snd_audiodrive_pnpids, 2388 .id_table = snd_audiodrive_pnpids,
2389 .probe = snd_audiodrive_pnpc_detect, 2389 .probe = snd_audiodrive_pnpc_detect,
2390 .remove = snd_audiodrive_pnpc_remove, 2390 .remove = __devexit_p(snd_audiodrive_pnpc_remove),
2391#ifdef CONFIG_PM 2391#ifdef CONFIG_PM
2392 .suspend = snd_audiodrive_pnpc_suspend, 2392 .suspend = snd_audiodrive_pnpc_suspend,
2393 .resume = snd_audiodrive_pnpc_resume, 2393 .resume = snd_audiodrive_pnpc_resume,
diff --git a/sound/isa/galaxy/galaxy.c b/sound/isa/galaxy/galaxy.c
index 672184e3221..ee54df082b9 100644
--- a/sound/isa/galaxy/galaxy.c
+++ b/sound/isa/galaxy/galaxy.c
@@ -35,7 +35,7 @@ MODULE_LICENSE("GPL");
35 35
36static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 36static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
37static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 37static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
38static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; 38static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;
39 39
40module_param_array(index, int, NULL, 0444); 40module_param_array(index, int, NULL, 0444);
41MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard."); 41MODULE_PARM_DESC(index, "Index value for " CRD_NAME " soundcard.");
@@ -84,7 +84,7 @@ MODULE_PARM_DESC(dma2, "Capture DMA # for " CRD_NAME " driver.");
84 84
85#define DSP_COMMAND_GET_VERSION 0xe1 85#define DSP_COMMAND_GET_VERSION 0xe1
86 86
87static int dsp_get_byte(void __iomem *port, u8 *val) 87static int __devinit dsp_get_byte(void __iomem *port, u8 *val)
88{ 88{
89 int loops = 1000; 89 int loops = 1000;
90 90
@@ -97,7 +97,7 @@ static int dsp_get_byte(void __iomem *port, u8 *val)
97 return 0; 97 return 0;
98} 98}
99 99
100static int dsp_reset(void __iomem *port) 100static int __devinit dsp_reset(void __iomem *port)
101{ 101{
102 u8 val; 102 u8 val;
103 103
@@ -111,7 +111,7 @@ static int dsp_reset(void __iomem *port)
111 return 0; 111 return 0;
112} 112}
113 113
114static int dsp_command(void __iomem *port, u8 cmd) 114static int __devinit dsp_command(void __iomem *port, u8 cmd)
115{ 115{
116 int loops = 1000; 116 int loops = 1000;
117 117
@@ -124,7 +124,7 @@ static int dsp_command(void __iomem *port, u8 cmd)
124 return 0; 124 return 0;
125} 125}
126 126
127static int dsp_get_version(void __iomem *port, u8 *major, u8 *minor) 127static int __devinit dsp_get_version(void __iomem *port, u8 *major, u8 *minor)
128{ 128{
129 int err; 129 int err;
130 130
@@ -161,7 +161,7 @@ static int dsp_get_version(void __iomem *port, u8 *major, u8 *minor)
161 161
162#define WSS_SIGNATURE 4 162#define WSS_SIGNATURE 4
163 163
164static int wss_detect(void __iomem *wss_port) 164static int __devinit wss_detect(void __iomem *wss_port)
165{ 165{
166 if ((ioread8(wss_port + WSS_PORT_SIGNATURE) & 0x3f) != WSS_SIGNATURE) 166 if ((ioread8(wss_port + WSS_PORT_SIGNATURE) & 0x3f) != WSS_SIGNATURE)
167 return -ENODEV; 167 return -ENODEV;
@@ -204,7 +204,7 @@ struct snd_galaxy {
204static u32 config[SNDRV_CARDS]; 204static u32 config[SNDRV_CARDS];
205static u8 wss_config[SNDRV_CARDS]; 205static u8 wss_config[SNDRV_CARDS];
206 206
207static int snd_galaxy_match(struct device *dev, unsigned int n) 207static int __devinit snd_galaxy_match(struct device *dev, unsigned int n)
208{ 208{
209 if (!enable[n]) 209 if (!enable[n])
210 return 0; 210 return 0;
@@ -379,7 +379,7 @@ fm:
379 return 1; 379 return 1;
380} 380}
381 381
382static int galaxy_init(struct snd_galaxy *galaxy, u8 *type) 382static int __devinit galaxy_init(struct snd_galaxy *galaxy, u8 *type)
383{ 383{
384 u8 major; 384 u8 major;
385 u8 minor; 385 u8 minor;
@@ -411,7 +411,7 @@ static int galaxy_init(struct snd_galaxy *galaxy, u8 *type)
411 return 0; 411 return 0;
412} 412}
413 413
414static int galaxy_set_mode(struct snd_galaxy *galaxy, u8 mode) 414static int __devinit galaxy_set_mode(struct snd_galaxy *galaxy, u8 mode)
415{ 415{
416 int err; 416 int err;
417 417
@@ -449,7 +449,7 @@ static void galaxy_set_config(struct snd_galaxy *galaxy, u32 config)
449 msleep(10); 449 msleep(10);
450} 450}
451 451
452static void galaxy_config(struct snd_galaxy *galaxy, u32 config) 452static void __devinit galaxy_config(struct snd_galaxy *galaxy, u32 config)
453{ 453{
454 int i; 454 int i;
455 455
@@ -461,7 +461,7 @@ static void galaxy_config(struct snd_galaxy *galaxy, u32 config)
461 galaxy_set_config(galaxy, config); 461 galaxy_set_config(galaxy, config);
462} 462}
463 463
464static int galaxy_wss_config(struct snd_galaxy *galaxy, u8 wss_config) 464static int __devinit galaxy_wss_config(struct snd_galaxy *galaxy, u8 wss_config)
465{ 465{
466 int err; 466 int err;
467 467
@@ -498,7 +498,7 @@ static void snd_galaxy_free(struct snd_card *card)
498 } 498 }
499} 499}
500 500
501static int snd_galaxy_probe(struct device *dev, unsigned int n) 501static int __devinit snd_galaxy_probe(struct device *dev, unsigned int n)
502{ 502{
503 struct snd_galaxy *galaxy; 503 struct snd_galaxy *galaxy;
504 struct snd_wss *chip; 504 struct snd_wss *chip;
@@ -585,7 +585,8 @@ static int snd_galaxy_probe(struct device *dev, unsigned int n)
585 585
586 if (mpu_port[n] >= 0) { 586 if (mpu_port[n] >= 0) {
587 err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 587 err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
588 mpu_port[n], 0, mpu_irq[n], NULL); 588 mpu_port[n], 0, mpu_irq[n],
589 IRQF_DISABLED, NULL);
589 if (err < 0) 590 if (err < 0)
590 goto error; 591 goto error;
591 } 592 }
@@ -620,7 +621,7 @@ error:
620 return err; 621 return err;
621} 622}
622 623
623static int snd_galaxy_remove(struct device *dev, unsigned int n) 624static int __devexit snd_galaxy_remove(struct device *dev, unsigned int n)
624{ 625{
625 snd_card_free(dev_get_drvdata(dev)); 626 snd_card_free(dev_get_drvdata(dev));
626 dev_set_drvdata(dev, NULL); 627 dev_set_drvdata(dev, NULL);
@@ -630,7 +631,7 @@ static int snd_galaxy_remove(struct device *dev, unsigned int n)
630static struct isa_driver snd_galaxy_driver = { 631static struct isa_driver snd_galaxy_driver = {
631 .match = snd_galaxy_match, 632 .match = snd_galaxy_match,
632 .probe = snd_galaxy_probe, 633 .probe = snd_galaxy_probe,
633 .remove = snd_galaxy_remove, 634 .remove = __devexit_p(snd_galaxy_remove),
634 635
635 .driver = { 636 .driver = {
636 .name = DEV_NAME 637 .name = DEV_NAME
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index 4490ee442ff..12eb98f2f93 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -24,7 +24,6 @@
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/module.h>
28#include <sound/core.h> 27#include <sound/core.h>
29#include <sound/gus.h> 28#include <sound/gus.h>
30#include <sound/control.h> 29#include <sound/control.h>
@@ -181,7 +180,7 @@ int snd_gus_create(struct snd_card *card,
181 snd_gus_free(gus); 180 snd_gus_free(gus);
182 return -EBUSY; 181 return -EBUSY;
183 } 182 }
184 if (irq >= 0 && request_irq(irq, snd_gus_interrupt, 0, "GUS GF1", (void *) gus)) { 183 if (irq >= 0 && request_irq(irq, snd_gus_interrupt, IRQF_DISABLED, "GUS GF1", (void *) gus)) {
185 snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq); 184 snd_printk(KERN_ERR "gus: can't grab irq %d\n", irq);
186 snd_gus_free(gus); 185 snd_gus_free(gus);
187 return -EBUSY; 186 return -EBUSY;
diff --git a/sound/isa/gus/gus_volume.c b/sound/isa/gus/gus_volume.c
index 3dd841ae708..c3c028a4a46 100644
--- a/sound/isa/gus/gus_volume.c
+++ b/sound/isa/gus/gus_volume.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21#include <linux/time.h> 21#include <linux/time.h>
22#include <linux/export.h>
23#include <sound/core.h> 22#include <sound/core.h>
24#include <sound/gus.h> 23#include <sound/gus.h>
25#define __GUS_TABLES_ALLOC__ 24#define __GUS_TABLES_ALLOC__
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 16bca4e96c0..086b8f0e0f9 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -24,7 +24,7 @@
24#include <linux/isa.h> 24#include <linux/isa.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/module.h> 27#include <linux/moduleparam.h>
28#include <asm/dma.h> 28#include <asm/dma.h>
29#include <sound/core.h> 29#include <sound/core.h>
30#include <sound/gus.h> 30#include <sound/gus.h>
@@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Classic}}");
42 42
43static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 43static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
44static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 44static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
45static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 45static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
46static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */ 46static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */
47static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,5,9,11,12,15 */ 47static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 3,5,9,11,12,15 */
48static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */ 48static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */
@@ -73,14 +73,13 @@ MODULE_PARM_DESC(channels, "GF1 channels for " CRD_NAME " driver.");
73module_param_array(pcm_channels, int, NULL, 0444); 73module_param_array(pcm_channels, int, NULL, 0444);
74MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for " CRD_NAME " driver."); 74MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for " CRD_NAME " driver.");
75 75
76static int snd_gusclassic_match(struct device *dev, unsigned int n) 76static int __devinit snd_gusclassic_match(struct device *dev, unsigned int n)
77{ 77{
78 return enable[n]; 78 return enable[n];
79} 79}
80 80
81static int snd_gusclassic_create(struct snd_card *card, 81static int __devinit snd_gusclassic_create(struct snd_card *card,
82 struct device *dev, unsigned int n, 82 struct device *dev, unsigned int n, struct snd_gus_card **rgus)
83 struct snd_gus_card **rgus)
84{ 83{
85 static long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260}; 84 static long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260};
86 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, 4, -1}; 85 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, 4, -1};
@@ -124,7 +123,7 @@ static int snd_gusclassic_create(struct snd_card *card,
124 return error; 123 return error;
125} 124}
126 125
127static int snd_gusclassic_detect(struct snd_gus_card *gus) 126static int __devinit snd_gusclassic_detect(struct snd_gus_card *gus)
128{ 127{
129 unsigned char d; 128 unsigned char d;
130 129
@@ -143,7 +142,7 @@ static int snd_gusclassic_detect(struct snd_gus_card *gus)
143 return 0; 142 return 0;
144} 143}
145 144
146static int snd_gusclassic_probe(struct device *dev, unsigned int n) 145static int __devinit snd_gusclassic_probe(struct device *dev, unsigned int n)
147{ 146{
148 struct snd_card *card; 147 struct snd_card *card;
149 struct snd_gus_card *gus; 148 struct snd_gus_card *gus;
@@ -212,7 +211,7 @@ out: snd_card_free(card);
212 return error; 211 return error;
213} 212}
214 213
215static int snd_gusclassic_remove(struct device *dev, unsigned int n) 214static int __devexit snd_gusclassic_remove(struct device *dev, unsigned int n)
216{ 215{
217 snd_card_free(dev_get_drvdata(dev)); 216 snd_card_free(dev_get_drvdata(dev));
218 dev_set_drvdata(dev, NULL); 217 dev_set_drvdata(dev, NULL);
@@ -222,7 +221,7 @@ static int snd_gusclassic_remove(struct device *dev, unsigned int n)
222static struct isa_driver snd_gusclassic_driver = { 221static struct isa_driver snd_gusclassic_driver = {
223 .match = snd_gusclassic_match, 222 .match = snd_gusclassic_match,
224 .probe = snd_gusclassic_probe, 223 .probe = snd_gusclassic_probe,
225 .remove = snd_gusclassic_remove, 224 .remove = __devexit_p(snd_gusclassic_remove),
226#if 0 /* FIXME */ 225#if 0 /* FIXME */
227 .suspend = snd_gusclassic_suspend, 226 .suspend = snd_gusclassic_suspend,
228 .remove = snd_gusclassic_remove, 227 .remove = snd_gusclassic_remove,
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 0b9c2426b49..008e8e5bfa3 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -24,7 +24,7 @@
24#include <linux/isa.h> 24#include <linux/isa.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/module.h> 27#include <linux/moduleparam.h>
28#include <asm/dma.h> 28#include <asm/dma.h>
29#include <sound/core.h> 29#include <sound/core.h>
30#include <sound/gus.h> 30#include <sound/gus.h>
@@ -46,7 +46,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound Extreme}}");
46 46
47static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 47static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
48static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 48static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
49static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 49static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
50static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 50static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
51static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */ 51static long gf1_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x210,0x220,0x230,0x240,0x250,0x260,0x270 */
52static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x300,0x310,0x320 */ 52static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS) - 1] = -1}; /* 0x300,0x310,0x320 */
@@ -89,14 +89,13 @@ MODULE_PARM_DESC(channels, "GF1 channels for " CRD_NAME " driver.");
89module_param_array(pcm_channels, int, NULL, 0444); 89module_param_array(pcm_channels, int, NULL, 0444);
90MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for " CRD_NAME " driver."); 90MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for " CRD_NAME " driver.");
91 91
92static int snd_gusextreme_match(struct device *dev, unsigned int n) 92static int __devinit snd_gusextreme_match(struct device *dev, unsigned int n)
93{ 93{
94 return enable[n]; 94 return enable[n];
95} 95}
96 96
97static int snd_gusextreme_es1688_create(struct snd_card *card, 97static int __devinit snd_gusextreme_es1688_create(struct snd_card *card,
98 struct snd_es1688 *chip, 98 struct snd_es1688 *chip, struct device *dev, unsigned int n)
99 struct device *dev, unsigned int n)
100{ 99{
101 static long possible_ports[] = {0x220, 0x240, 0x260}; 100 static long possible_ports[] = {0x220, 0x240, 0x260};
102 static int possible_irqs[] = {5, 9, 10, 7, -1}; 101 static int possible_irqs[] = {5, 9, 10, 7, -1};
@@ -133,9 +132,8 @@ static int snd_gusextreme_es1688_create(struct snd_card *card,
133 return error; 132 return error;
134} 133}
135 134
136static int snd_gusextreme_gus_card_create(struct snd_card *card, 135static int __devinit snd_gusextreme_gus_card_create(struct snd_card *card,
137 struct device *dev, unsigned int n, 136 struct device *dev, unsigned int n, struct snd_gus_card **rgus)
138 struct snd_gus_card **rgus)
139{ 137{
140 static int possible_irqs[] = {11, 12, 15, 9, 5, 7, 3, -1}; 138 static int possible_irqs[] = {11, 12, 15, 9, 5, 7, 3, -1};
141 static int possible_dmas[] = {5, 6, 7, 3, 1, -1}; 139 static int possible_dmas[] = {5, 6, 7, 3, 1, -1};
@@ -158,8 +156,8 @@ static int snd_gusextreme_gus_card_create(struct snd_card *card,
158 0, channels[n], pcm_channels[n], 0, rgus); 156 0, channels[n], pcm_channels[n], 0, rgus);
159} 157}
160 158
161static int snd_gusextreme_detect(struct snd_gus_card *gus, 159static int __devinit snd_gusextreme_detect(struct snd_gus_card *gus,
162 struct snd_es1688 *es1688) 160 struct snd_es1688 *es1688)
163{ 161{
164 unsigned long flags; 162 unsigned long flags;
165 unsigned char d; 163 unsigned char d;
@@ -208,7 +206,7 @@ static int snd_gusextreme_detect(struct snd_gus_card *gus,
208 return 0; 206 return 0;
209} 207}
210 208
211static int snd_gusextreme_mixer(struct snd_card *card) 209static int __devinit snd_gusextreme_mixer(struct snd_card *card)
212{ 210{
213 struct snd_ctl_elem_id id1, id2; 211 struct snd_ctl_elem_id id1, id2;
214 int error; 212 int error;
@@ -234,7 +232,7 @@ static int snd_gusextreme_mixer(struct snd_card *card)
234 return 0; 232 return 0;
235} 233}
236 234
237static int snd_gusextreme_probe(struct device *dev, unsigned int n) 235static int __devinit snd_gusextreme_probe(struct device *dev, unsigned int n)
238{ 236{
239 struct snd_card *card; 237 struct snd_card *card;
240 struct snd_gus_card *gus; 238 struct snd_gus_card *gus;
@@ -319,7 +317,8 @@ static int snd_gusextreme_probe(struct device *dev, unsigned int n)
319 317
320 if (es1688->mpu_port >= 0x300) { 318 if (es1688->mpu_port >= 0x300) {
321 error = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688, 319 error = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688,
322 es1688->mpu_port, 0, mpu_irq[n], NULL); 320 es1688->mpu_port, 0,
321 mpu_irq[n], IRQF_DISABLED, NULL);
323 if (error < 0) 322 if (error < 0)
324 goto out; 323 goto out;
325 } 324 }
@@ -341,7 +340,7 @@ out: snd_card_free(card);
341 return error; 340 return error;
342} 341}
343 342
344static int snd_gusextreme_remove(struct device *dev, unsigned int n) 343static int __devexit snd_gusextreme_remove(struct device *dev, unsigned int n)
345{ 344{
346 snd_card_free(dev_get_drvdata(dev)); 345 snd_card_free(dev_get_drvdata(dev));
347 dev_set_drvdata(dev, NULL); 346 dev_set_drvdata(dev, NULL);
@@ -351,7 +350,7 @@ static int snd_gusextreme_remove(struct device *dev, unsigned int n)
351static struct isa_driver snd_gusextreme_driver = { 350static struct isa_driver snd_gusextreme_driver = {
352 .match = snd_gusextreme_match, 351 .match = snd_gusextreme_match,
353 .probe = snd_gusextreme_probe, 352 .probe = snd_gusextreme_probe,
354 .remove = snd_gusextreme_remove, 353 .remove = __devexit_p(snd_gusextreme_remove),
355#if 0 /* FIXME */ 354#if 0 /* FIXME */
356 .suspend = snd_gusextreme_suspend, 355 .suspend = snd_gusextreme_suspend,
357 .resume = snd_gusextreme_resume, 356 .resume = snd_gusextreme_resume,
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index c309a5d0e7e..3e4a58b7291 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -24,7 +24,7 @@
24#include <linux/isa.h> 24#include <linux/isa.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/module.h> 27#include <linux/moduleparam.h>
28#include <asm/dma.h> 28#include <asm/dma.h>
29#include <sound/core.h> 29#include <sound/core.h>
30#include <sound/gus.h> 30#include <sound/gus.h>
@@ -40,7 +40,7 @@ MODULE_SUPPORTED_DEVICE("{{Gravis,UltraSound MAX}}");
40 40
41static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 41static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
42static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 42static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
43static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 43static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
44static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */ 44static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x230,0x240,0x250,0x260 */
45static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */ 45static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,3,5,9,11,12,15 */
46static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */ 46static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3,5,6,7 */
@@ -82,7 +82,7 @@ struct snd_gusmax {
82 82
83#define PFX "gusmax: " 83#define PFX "gusmax: "
84 84
85static int snd_gusmax_detect(struct snd_gus_card *gus) 85static int __devinit snd_gusmax_detect(struct snd_gus_card * gus)
86{ 86{
87 unsigned char d; 87 unsigned char d;
88 88
@@ -124,8 +124,8 @@ static irqreturn_t snd_gusmax_interrupt(int irq, void *dev_id)
124 return IRQ_RETVAL(handled); 124 return IRQ_RETVAL(handled);
125} 125}
126 126
127static void snd_gusmax_init(int dev, struct snd_card *card, 127static void __devinit snd_gusmax_init(int dev, struct snd_card *card,
128 struct snd_gus_card *gus) 128 struct snd_gus_card * gus)
129{ 129{
130 gus->equal_irq = 1; 130 gus->equal_irq = 1;
131 gus->codec_flag = 1; 131 gus->codec_flag = 1;
@@ -140,7 +140,7 @@ static void snd_gusmax_init(int dev, struct snd_card *card,
140 outb(gus->max_cntrl_val, GUSP(gus, MAXCNTRLPORT)); 140 outb(gus->max_cntrl_val, GUSP(gus, MAXCNTRLPORT));
141} 141}
142 142
143static int snd_gusmax_mixer(struct snd_wss *chip) 143static int __devinit snd_gusmax_mixer(struct snd_wss *chip)
144{ 144{
145 struct snd_card *card = chip->card; 145 struct snd_card *card = chip->card;
146 struct snd_ctl_elem_id id1, id2; 146 struct snd_ctl_elem_id id1, id2;
@@ -199,12 +199,12 @@ static void snd_gusmax_free(struct snd_card *card)
199 free_irq(maxcard->irq, (void *)maxcard); 199 free_irq(maxcard->irq, (void *)maxcard);
200} 200}
201 201
202static int snd_gusmax_match(struct device *pdev, unsigned int dev) 202static int __devinit snd_gusmax_match(struct device *pdev, unsigned int dev)
203{ 203{
204 return enable[dev]; 204 return enable[dev];
205} 205}
206 206
207static int snd_gusmax_probe(struct device *pdev, unsigned int dev) 207static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
208{ 208{
209 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; 209 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};
210 static int possible_dmas[] = {5, 6, 7, 1, 3, -1}; 210 static int possible_dmas[] = {5, 6, 7, 1, 3, -1};
@@ -291,7 +291,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
291 goto _err; 291 goto _err;
292 } 292 }
293 293
294 if (request_irq(xirq, snd_gusmax_interrupt, 0, "GUS MAX", (void *)maxcard)) { 294 if (request_irq(xirq, snd_gusmax_interrupt, IRQF_DISABLED, "GUS MAX", (void *)maxcard)) {
295 snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq); 295 snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq);
296 err = -EBUSY; 296 err = -EBUSY;
297 goto _err; 297 goto _err;
@@ -354,7 +354,7 @@ static int snd_gusmax_probe(struct device *pdev, unsigned int dev)
354 return err; 354 return err;
355} 355}
356 356
357static int snd_gusmax_remove(struct device *devptr, unsigned int dev) 357static int __devexit snd_gusmax_remove(struct device *devptr, unsigned int dev)
358{ 358{
359 snd_card_free(dev_get_drvdata(devptr)); 359 snd_card_free(dev_get_drvdata(devptr));
360 dev_set_drvdata(devptr, NULL); 360 dev_set_drvdata(devptr, NULL);
@@ -366,7 +366,7 @@ static int snd_gusmax_remove(struct device *devptr, unsigned int dev)
366static struct isa_driver snd_gusmax_driver = { 366static struct isa_driver snd_gusmax_driver = {
367 .match = snd_gusmax_match, 367 .match = snd_gusmax_match,
368 .probe = snd_gusmax_probe, 368 .probe = snd_gusmax_probe,
369 .remove = snd_gusmax_remove, 369 .remove = __devexit_p(snd_gusmax_remove),
370 /* FIXME: suspend/resume */ 370 /* FIXME: suspend/resume */
371 .driver = { 371 .driver = {
372 .name = DEV_NAME 372 .name = DEV_NAME
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 78bc5744e89..c7b80e4730f 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -27,7 +27,7 @@
27#include <linux/isa.h> 27#include <linux/isa.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/pnp.h> 29#include <linux/pnp.h>
30#include <linux/module.h> 30#include <linux/moduleparam.h>
31#include <asm/dma.h> 31#include <asm/dma.h>
32#include <sound/core.h> 32#include <sound/core.h>
33#include <sound/gus.h> 33#include <sound/gus.h>
@@ -55,9 +55,9 @@ MODULE_SUPPORTED_DEVICE("{{AMD,InterWave STB with TEA6330T}}");
55 55
56static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 56static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 57static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
58static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 58static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
59#ifdef CONFIG_PNP 59#ifdef CONFIG_PNP
60static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 60static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
61#endif 61#endif
62static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x210,0x220,0x230,0x240,0x250,0x260 */ 62static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x210,0x220,0x230,0x240,0x250,0x260 */
63#ifdef SNDRV_STB 63#ifdef SNDRV_STB
@@ -207,9 +207,9 @@ static struct snd_i2c_bit_ops snd_interwave_i2c_bit_ops = {
207 .getdata = snd_interwave_i2c_getdataline, 207 .getdata = snd_interwave_i2c_getdataline,
208}; 208};
209 209
210static int snd_interwave_detect_stb(struct snd_interwave *iwcard, 210static int __devinit snd_interwave_detect_stb(struct snd_interwave *iwcard,
211 struct snd_gus_card *gus, int dev, 211 struct snd_gus_card * gus, int dev,
212 struct snd_i2c_bus **rbus) 212 struct snd_i2c_bus **rbus)
213{ 213{
214 unsigned long port; 214 unsigned long port;
215 struct snd_i2c_bus *bus; 215 struct snd_i2c_bus *bus;
@@ -249,11 +249,11 @@ static int snd_interwave_detect_stb(struct snd_interwave *iwcard,
249} 249}
250#endif 250#endif
251 251
252static int snd_interwave_detect(struct snd_interwave *iwcard, 252static int __devinit snd_interwave_detect(struct snd_interwave *iwcard,
253 struct snd_gus_card *gus, 253 struct snd_gus_card * gus,
254 int dev 254 int dev
255#ifdef SNDRV_STB 255#ifdef SNDRV_STB
256 , struct snd_i2c_bus **rbus 256 , struct snd_i2c_bus **rbus
257#endif 257#endif
258 ) 258 )
259{ 259{
@@ -318,7 +318,7 @@ static irqreturn_t snd_interwave_interrupt(int irq, void *dev_id)
318 return IRQ_RETVAL(handled); 318 return IRQ_RETVAL(handled);
319} 319}
320 320
321static void snd_interwave_reset(struct snd_gus_card *gus) 321static void __devinit snd_interwave_reset(struct snd_gus_card * gus)
322{ 322{
323 snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x00); 323 snd_gf1_write8(gus, SNDRV_GF1_GB_RESET, 0x00);
324 udelay(160); 324 udelay(160);
@@ -326,7 +326,7 @@ static void snd_interwave_reset(struct snd_gus_card *gus)
326 udelay(160); 326 udelay(160);
327} 327}
328 328
329static void snd_interwave_bank_sizes(struct snd_gus_card *gus, int *sizes) 329static void __devinit snd_interwave_bank_sizes(struct snd_gus_card * gus, int *sizes)
330{ 330{
331 unsigned int idx; 331 unsigned int idx;
332 unsigned int local; 332 unsigned int local;
@@ -377,7 +377,7 @@ struct rom_hdr {
377 /* 511 */ unsigned char csum; 377 /* 511 */ unsigned char csum;
378}; 378};
379 379
380static void snd_interwave_detect_memory(struct snd_gus_card *gus) 380static void __devinit snd_interwave_detect_memory(struct snd_gus_card * gus)
381{ 381{
382 static unsigned int lmc[13] = 382 static unsigned int lmc[13] =
383 { 383 {
@@ -443,8 +443,9 @@ static void snd_interwave_detect_memory(struct snd_gus_card *gus)
443 for (i = 0; i < 8; ++i) 443 for (i = 0; i < 8; ++i)
444 iwave[i] = snd_gf1_peek(gus, bank_pos + i); 444 iwave[i] = snd_gf1_peek(gus, bank_pos + i);
445#ifdef CONFIG_SND_DEBUG_ROM 445#ifdef CONFIG_SND_DEBUG_ROM
446 printk(KERN_DEBUG "ROM at 0x%06x = %*phC\n", bank_pos, 446 printk(KERN_DEBUG "ROM at 0x%06x = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", bank_pos,
447 8, iwave); 447 iwave[0], iwave[1], iwave[2], iwave[3],
448 iwave[4], iwave[5], iwave[6], iwave[7]);
448#endif 449#endif
449 if (strncmp(iwave, "INTRWAVE", 8)) 450 if (strncmp(iwave, "INTRWAVE", 8))
450 continue; /* first check */ 451 continue; /* first check */
@@ -475,7 +476,7 @@ static void snd_interwave_detect_memory(struct snd_gus_card *gus)
475 snd_interwave_reset(gus); 476 snd_interwave_reset(gus);
476} 477}
477 478
478static void snd_interwave_init(int dev, struct snd_gus_card *gus) 479static void __devinit snd_interwave_init(int dev, struct snd_gus_card * gus)
479{ 480{
480 unsigned long flags; 481 unsigned long flags;
481 482
@@ -508,7 +509,7 @@ WSS_DOUBLE("Mic Playback Volume", 0,
508 CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 0, 0, 31, 1) 509 CS4231_LEFT_MIC_INPUT, CS4231_RIGHT_MIC_INPUT, 0, 0, 31, 1)
509}; 510};
510 511
511static int snd_interwave_mixer(struct snd_wss *chip) 512static int __devinit snd_interwave_mixer(struct snd_wss *chip)
512{ 513{
513 struct snd_card *card = chip->card; 514 struct snd_card *card = chip->card;
514 struct snd_ctl_elem_id id1, id2; 515 struct snd_ctl_elem_id id1, id2;
@@ -558,9 +559,9 @@ static int snd_interwave_mixer(struct snd_wss *chip)
558 559
559#ifdef CONFIG_PNP 560#ifdef CONFIG_PNP
560 561
561static int snd_interwave_pnp(int dev, struct snd_interwave *iwcard, 562static int __devinit snd_interwave_pnp(int dev, struct snd_interwave *iwcard,
562 struct pnp_card_link *card, 563 struct pnp_card_link *card,
563 const struct pnp_card_device_id *id) 564 const struct pnp_card_device_id *id)
564{ 565{
565 struct pnp_dev *pdev; 566 struct pnp_dev *pdev;
566 int err; 567 int err;
@@ -644,7 +645,7 @@ static int snd_interwave_card_new(int dev, struct snd_card **cardp)
644 return 0; 645 return 0;
645} 646}
646 647
647static int snd_interwave_probe(struct snd_card *card, int dev) 648static int __devinit snd_interwave_probe(struct snd_card *card, int dev)
648{ 649{
649 int xirq, xdma1, xdma2; 650 int xirq, xdma1, xdma2;
650 struct snd_interwave *iwcard = card->private_data; 651 struct snd_interwave *iwcard = card->private_data;
@@ -683,7 +684,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
683 if ((err = snd_gus_initialize(gus)) < 0) 684 if ((err = snd_gus_initialize(gus)) < 0)
684 return err; 685 return err;
685 686
686 if (request_irq(xirq, snd_interwave_interrupt, 0, 687 if (request_irq(xirq, snd_interwave_interrupt, IRQF_DISABLED,
687 "InterWave", iwcard)) { 688 "InterWave", iwcard)) {
688 snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq); 689 snd_printk(KERN_ERR PFX "unable to grab IRQ %d\n", xirq);
689 return -EBUSY; 690 return -EBUSY;
@@ -775,7 +776,7 @@ static int snd_interwave_probe(struct snd_card *card, int dev)
775 return 0; 776 return 0;
776} 777}
777 778
778static int snd_interwave_isa_probe1(int dev, struct device *devptr) 779static int __devinit snd_interwave_isa_probe1(int dev, struct device *devptr)
779{ 780{
780 struct snd_card *card; 781 struct snd_card *card;
781 int err; 782 int err;
@@ -793,8 +794,8 @@ static int snd_interwave_isa_probe1(int dev, struct device *devptr)
793 return 0; 794 return 0;
794} 795}
795 796
796static int snd_interwave_isa_match(struct device *pdev, 797static int __devinit snd_interwave_isa_match(struct device *pdev,
797 unsigned int dev) 798 unsigned int dev)
798{ 799{
799 if (!enable[dev]) 800 if (!enable[dev])
800 return 0; 801 return 0;
@@ -805,8 +806,8 @@ static int snd_interwave_isa_match(struct device *pdev,
805 return 1; 806 return 1;
806} 807}
807 808
808static int snd_interwave_isa_probe(struct device *pdev, 809static int __devinit snd_interwave_isa_probe(struct device *pdev,
809 unsigned int dev) 810 unsigned int dev)
810{ 811{
811 int err; 812 int err;
812 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1}; 813 static int possible_irqs[] = {5, 11, 12, 9, 7, 15, 3, -1};
@@ -846,7 +847,7 @@ static int snd_interwave_isa_probe(struct device *pdev,
846 } 847 }
847} 848}
848 849
849static int snd_interwave_isa_remove(struct device *devptr, unsigned int dev) 850static int __devexit snd_interwave_isa_remove(struct device *devptr, unsigned int dev)
850{ 851{
851 snd_card_free(dev_get_drvdata(devptr)); 852 snd_card_free(dev_get_drvdata(devptr));
852 dev_set_drvdata(devptr, NULL); 853 dev_set_drvdata(devptr, NULL);
@@ -856,7 +857,7 @@ static int snd_interwave_isa_remove(struct device *devptr, unsigned int dev)
856static struct isa_driver snd_interwave_driver = { 857static struct isa_driver snd_interwave_driver = {
857 .match = snd_interwave_isa_match, 858 .match = snd_interwave_isa_match,
858 .probe = snd_interwave_isa_probe, 859 .probe = snd_interwave_isa_probe,
859 .remove = snd_interwave_isa_remove, 860 .remove = __devexit_p(snd_interwave_isa_remove),
860 /* FIXME: suspend,resume */ 861 /* FIXME: suspend,resume */
861 .driver = { 862 .driver = {
862 .name = INTERWAVE_DRIVER 863 .name = INTERWAVE_DRIVER
@@ -864,8 +865,8 @@ static struct isa_driver snd_interwave_driver = {
864}; 865};
865 866
866#ifdef CONFIG_PNP 867#ifdef CONFIG_PNP
867static int snd_interwave_pnp_detect(struct pnp_card_link *pcard, 868static int __devinit snd_interwave_pnp_detect(struct pnp_card_link *pcard,
868 const struct pnp_card_device_id *pid) 869 const struct pnp_card_device_id *pid)
869{ 870{
870 static int dev; 871 static int dev;
871 struct snd_card *card; 872 struct snd_card *card;
@@ -896,7 +897,7 @@ static int snd_interwave_pnp_detect(struct pnp_card_link *pcard,
896 return 0; 897 return 0;
897} 898}
898 899
899static void snd_interwave_pnp_remove(struct pnp_card_link *pcard) 900static void __devexit snd_interwave_pnp_remove(struct pnp_card_link * pcard)
900{ 901{
901 snd_card_free(pnp_get_card_drvdata(pcard)); 902 snd_card_free(pnp_get_card_drvdata(pcard));
902 pnp_set_card_drvdata(pcard, NULL); 903 pnp_set_card_drvdata(pcard, NULL);
@@ -907,7 +908,7 @@ static struct pnp_card_driver interwave_pnpc_driver = {
907 .name = INTERWAVE_PNP_DRIVER, 908 .name = INTERWAVE_PNP_DRIVER,
908 .id_table = snd_interwave_pnpids, 909 .id_table = snd_interwave_pnpids,
909 .probe = snd_interwave_pnp_detect, 910 .probe = snd_interwave_pnp_detect,
910 .remove = snd_interwave_pnp_remove, 911 .remove = __devexit_p(snd_interwave_pnp_remove),
911 /* FIXME: suspend,resume */ 912 /* FIXME: suspend,resume */
912}; 913};
913 914
diff --git a/sound/isa/msnd/msnd.c b/sound/isa/msnd/msnd.c
index 1cee18fb28a..3a1526ae172 100644
--- a/sound/isa/msnd/msnd.c
+++ b/sound/isa/msnd/msnd.c
@@ -41,7 +41,6 @@
41#include <linux/io.h> 41#include <linux/io.h>
42#include <linux/fs.h> 42#include <linux/fs.h>
43#include <linux/delay.h> 43#include <linux/delay.h>
44#include <linux/module.h>
45 44
46#include <sound/core.h> 45#include <sound/core.h>
47#include <sound/initval.h> 46#include <sound/initval.h>
diff --git a/sound/isa/msnd/msnd.h b/sound/isa/msnd/msnd.h
index dbac3a42347..a168ba3313a 100644
--- a/sound/isa/msnd/msnd.h
+++ b/sound/isa/msnd/msnd.h
@@ -303,6 +303,6 @@ int snd_msndmidi_new(struct snd_card *card, int device);
303void snd_msndmidi_input_read(void *mpu); 303void snd_msndmidi_input_read(void *mpu);
304 304
305void snd_msndmix_setup(struct snd_msnd *chip); 305void snd_msndmix_setup(struct snd_msnd *chip);
306int snd_msndmix_new(struct snd_card *card); 306int __devinit snd_msndmix_new(struct snd_card *card);
307int snd_msndmix_force_recsrc(struct snd_msnd *chip, int recsrc); 307int snd_msndmix_force_recsrc(struct snd_msnd *chip, int recsrc);
308#endif /* __MSND_H */ 308#endif /* __MSND_H */
diff --git a/sound/isa/msnd/msnd_midi.c b/sound/isa/msnd/msnd_midi.c
index ffc67fd80c2..78749567423 100644
--- a/sound/isa/msnd/msnd_midi.c
+++ b/sound/isa/msnd/msnd_midi.c
@@ -29,7 +29,6 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/ioport.h> 30#include <linux/ioport.h>
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/export.h>
33#include <sound/core.h> 32#include <sound/core.h>
34#include <sound/rawmidi.h> 33#include <sound/rawmidi.h>
35 34
diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c
index ddabb406b14..91d6023a63e 100644
--- a/sound/isa/msnd/msnd_pinnacle.c
+++ b/sound/isa/msnd/msnd_pinnacle.c
@@ -78,7 +78,7 @@
78# define LOGNAME "snd_msnd_pinnacle" 78# define LOGNAME "snd_msnd_pinnacle"
79#endif 79#endif
80 80
81static void set_default_audio_parameters(struct snd_msnd *chip) 81static void __devinit set_default_audio_parameters(struct snd_msnd *chip)
82{ 82{
83 chip->play_sample_size = DEFSAMPLESIZE; 83 chip->play_sample_size = DEFSAMPLESIZE;
84 chip->play_sample_rate = DEFSAMPLERATE; 84 chip->play_sample_rate = DEFSAMPLERATE;
@@ -213,7 +213,7 @@ static int snd_msnd_reset_dsp(long io, unsigned char *info)
213 return -EIO; 213 return -EIO;
214} 214}
215 215
216static int snd_msnd_probe(struct snd_card *card) 216static int __devinit snd_msnd_probe(struct snd_card *card)
217{ 217{
218 struct snd_msnd *chip = card->private_data; 218 struct snd_msnd *chip = card->private_data;
219 unsigned char info; 219 unsigned char info;
@@ -497,7 +497,7 @@ static int snd_msnd_send_dsp_cmd_chk(struct snd_msnd *chip, u8 cmd)
497 return snd_msnd_send_dsp_cmd(chip, cmd); 497 return snd_msnd_send_dsp_cmd(chip, cmd);
498} 498}
499 499
500static int snd_msnd_calibrate_adc(struct snd_msnd *chip, u16 srate) 500static int __devinit snd_msnd_calibrate_adc(struct snd_msnd *chip, u16 srate)
501{ 501{
502 snd_printdd("snd_msnd_calibrate_adc(%i)\n", srate); 502 snd_printdd("snd_msnd_calibrate_adc(%i)\n", srate);
503 writew(srate, chip->SMA + SMA_wCalFreqAtoD); 503 writew(srate, chip->SMA + SMA_wCalFreqAtoD);
@@ -535,7 +535,7 @@ static void snd_msnd_mpu401_close(struct snd_mpu401 *mpu)
535static long mpu_io[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 535static long mpu_io[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
536static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; 536static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
537 537
538static int snd_msnd_attach(struct snd_card *card) 538static int __devinit snd_msnd_attach(struct snd_card *card)
539{ 539{
540 struct snd_msnd *chip = card->private_data; 540 struct snd_msnd *chip = card->private_data;
541 int err; 541 int err;
@@ -600,7 +600,7 @@ static int snd_msnd_attach(struct snd_card *card)
600 mpu_io[0], 600 mpu_io[0],
601 MPU401_MODE_INPUT | 601 MPU401_MODE_INPUT |
602 MPU401_MODE_OUTPUT, 602 MPU401_MODE_OUTPUT,
603 mpu_irq[0], 603 mpu_irq[0], IRQF_DISABLED,
604 &chip->rmidi); 604 &chip->rmidi);
605 if (err < 0) { 605 if (err < 0) {
606 printk(KERN_ERR LOGNAME 606 printk(KERN_ERR LOGNAME
@@ -634,7 +634,7 @@ err_release_region:
634} 634}
635 635
636 636
637static void snd_msnd_unload(struct snd_card *card) 637static void __devexit snd_msnd_unload(struct snd_card *card)
638{ 638{
639 struct snd_msnd *chip = card->private_data; 639 struct snd_msnd *chip = card->private_data;
640 640
@@ -649,7 +649,7 @@ static void snd_msnd_unload(struct snd_card *card)
649 649
650/* Pinnacle/Fiji Logical Device Configuration */ 650/* Pinnacle/Fiji Logical Device Configuration */
651 651
652static int snd_msnd_write_cfg(int cfg, int reg, int value) 652static int __devinit snd_msnd_write_cfg(int cfg, int reg, int value)
653{ 653{
654 outb(reg, cfg); 654 outb(reg, cfg);
655 outb(value, cfg + 1); 655 outb(value, cfg + 1);
@@ -660,7 +660,7 @@ static int snd_msnd_write_cfg(int cfg, int reg, int value)
660 return 0; 660 return 0;
661} 661}
662 662
663static int snd_msnd_write_cfg_io0(int cfg, int num, u16 io) 663static int __devinit snd_msnd_write_cfg_io0(int cfg, int num, u16 io)
664{ 664{
665 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num)) 665 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
666 return -EIO; 666 return -EIO;
@@ -671,7 +671,7 @@ static int snd_msnd_write_cfg_io0(int cfg, int num, u16 io)
671 return 0; 671 return 0;
672} 672}
673 673
674static int snd_msnd_write_cfg_io1(int cfg, int num, u16 io) 674static int __devinit snd_msnd_write_cfg_io1(int cfg, int num, u16 io)
675{ 675{
676 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num)) 676 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
677 return -EIO; 677 return -EIO;
@@ -682,7 +682,7 @@ static int snd_msnd_write_cfg_io1(int cfg, int num, u16 io)
682 return 0; 682 return 0;
683} 683}
684 684
685static int snd_msnd_write_cfg_irq(int cfg, int num, u16 irq) 685static int __devinit snd_msnd_write_cfg_irq(int cfg, int num, u16 irq)
686{ 686{
687 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num)) 687 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
688 return -EIO; 688 return -EIO;
@@ -693,7 +693,7 @@ static int snd_msnd_write_cfg_irq(int cfg, int num, u16 irq)
693 return 0; 693 return 0;
694} 694}
695 695
696static int snd_msnd_write_cfg_mem(int cfg, int num, int mem) 696static int __devinit snd_msnd_write_cfg_mem(int cfg, int num, int mem)
697{ 697{
698 u16 wmem; 698 u16 wmem;
699 699
@@ -711,7 +711,7 @@ static int snd_msnd_write_cfg_mem(int cfg, int num, int mem)
711 return 0; 711 return 0;
712} 712}
713 713
714static int snd_msnd_activate_logical(int cfg, int num) 714static int __devinit snd_msnd_activate_logical(int cfg, int num)
715{ 715{
716 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num)) 716 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
717 return -EIO; 717 return -EIO;
@@ -720,8 +720,8 @@ static int snd_msnd_activate_logical(int cfg, int num)
720 return 0; 720 return 0;
721} 721}
722 722
723static int snd_msnd_write_cfg_logical(int cfg, int num, u16 io0, 723static int __devinit snd_msnd_write_cfg_logical(int cfg, int num, u16 io0,
724 u16 io1, u16 irq, int mem) 724 u16 io1, u16 irq, int mem)
725{ 725{
726 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num)) 726 if (snd_msnd_write_cfg(cfg, IREG_LOGDEVICE, num))
727 return -EIO; 727 return -EIO;
@@ -738,7 +738,7 @@ static int snd_msnd_write_cfg_logical(int cfg, int num, u16 io0,
738 return 0; 738 return 0;
739} 739}
740 740
741static int snd_msnd_pinnacle_cfg_reset(int cfg) 741static int __devinit snd_msnd_pinnacle_cfg_reset(int cfg)
742{ 742{
743 int i; 743 int i;
744 744
@@ -785,7 +785,7 @@ static int write_ndelay[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 };
785static int calibrate_signal; 785static int calibrate_signal;
786 786
787#ifdef CONFIG_PNP 787#ifdef CONFIG_PNP
788static bool isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 788static int isapnp[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
789module_param_array(isapnp, bool, NULL, 0444); 789module_param_array(isapnp, bool, NULL, 0444);
790MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard."); 790MODULE_PARM_DESC(isapnp, "ISA PnP detection for specified soundcard.");
791#define has_isapnp(x) isapnp[x] 791#define has_isapnp(x) isapnp[x]
@@ -818,7 +818,7 @@ module_param_array(joystick_io, long, NULL, S_IRUGO);
818#endif 818#endif
819 819
820 820
821static int snd_msnd_isa_match(struct device *pdev, unsigned int i) 821static int __devinit snd_msnd_isa_match(struct device *pdev, unsigned int i)
822{ 822{
823 if (io[i] == SNDRV_AUTO_PORT) 823 if (io[i] == SNDRV_AUTO_PORT)
824 return 0; 824 return 0;
@@ -888,7 +888,7 @@ static int snd_msnd_isa_match(struct device *pdev, unsigned int i)
888 return 1; 888 return 1;
889} 889}
890 890
891static int snd_msnd_isa_probe(struct device *pdev, unsigned int idx) 891static int __devinit snd_msnd_isa_probe(struct device *pdev, unsigned int idx)
892{ 892{
893 int err; 893 int err;
894 struct snd_card *card; 894 struct snd_card *card;
@@ -1061,7 +1061,7 @@ cfg_error:
1061#endif 1061#endif
1062} 1062}
1063 1063
1064static int snd_msnd_isa_remove(struct device *pdev, unsigned int dev) 1064static int __devexit snd_msnd_isa_remove(struct device *pdev, unsigned int dev)
1065{ 1065{
1066 snd_msnd_unload(dev_get_drvdata(pdev)); 1066 snd_msnd_unload(dev_get_drvdata(pdev));
1067 dev_set_drvdata(pdev, NULL); 1067 dev_set_drvdata(pdev, NULL);
@@ -1073,7 +1073,7 @@ static int snd_msnd_isa_remove(struct device *pdev, unsigned int dev)
1073static struct isa_driver snd_msnd_driver = { 1073static struct isa_driver snd_msnd_driver = {
1074 .match = snd_msnd_isa_match, 1074 .match = snd_msnd_isa_match,
1075 .probe = snd_msnd_isa_probe, 1075 .probe = snd_msnd_isa_probe,
1076 .remove = snd_msnd_isa_remove, 1076 .remove = __devexit_p(snd_msnd_isa_remove),
1077 /* FIXME: suspend, resume */ 1077 /* FIXME: suspend, resume */
1078 .driver = { 1078 .driver = {
1079 .name = DEV_NAME 1079 .name = DEV_NAME
@@ -1081,8 +1081,8 @@ static struct isa_driver snd_msnd_driver = {
1081}; 1081};
1082 1082
1083#ifdef CONFIG_PNP 1083#ifdef CONFIG_PNP
1084static int snd_msnd_pnp_detect(struct pnp_card_link *pcard, 1084static int __devinit snd_msnd_pnp_detect(struct pnp_card_link *pcard,
1085 const struct pnp_card_device_id *pid) 1085 const struct pnp_card_device_id *pid)
1086{ 1086{
1087 static int idx; 1087 static int idx;
1088 struct pnp_dev *pnp_dev; 1088 struct pnp_dev *pnp_dev;
@@ -1185,7 +1185,7 @@ _release_card:
1185 return ret; 1185 return ret;
1186} 1186}
1187 1187
1188static void snd_msnd_pnp_remove(struct pnp_card_link *pcard) 1188static void __devexit snd_msnd_pnp_remove(struct pnp_card_link *pcard)
1189{ 1189{
1190 snd_msnd_unload(pnp_get_card_drvdata(pcard)); 1190 snd_msnd_unload(pnp_get_card_drvdata(pcard));
1191 pnp_set_card_drvdata(pcard, NULL); 1191 pnp_set_card_drvdata(pcard, NULL);
@@ -1207,7 +1207,7 @@ static struct pnp_card_driver msnd_pnpc_driver = {
1207 .name = "msnd_pinnacle", 1207 .name = "msnd_pinnacle",
1208 .id_table = msnd_pnpids, 1208 .id_table = msnd_pnpids,
1209 .probe = snd_msnd_pnp_detect, 1209 .probe = snd_msnd_pnp_detect,
1210 .remove = snd_msnd_pnp_remove, 1210 .remove = __devexit_p(snd_msnd_pnp_remove),
1211}; 1211};
1212#endif /* CONFIG_PNP */ 1212#endif /* CONFIG_PNP */
1213 1213
diff --git a/sound/isa/msnd/msnd_pinnacle_mixer.c b/sound/isa/msnd/msnd_pinnacle_mixer.c
index 031dc69b747..494058a1a50 100644
--- a/sound/isa/msnd/msnd_pinnacle_mixer.c
+++ b/sound/isa/msnd/msnd_pinnacle_mixer.c
@@ -16,7 +16,6 @@
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/export.h>
20 19
21#include <sound/core.h> 20#include <sound/core.h>
22#include <sound/control.h> 21#include <sound/control.h>
@@ -302,7 +301,7 @@ DUMMY_VOLUME("Monitor", 0, MSND_MIXER_IMIX),
302}; 301};
303 302
304 303
305int snd_msndmix_new(struct snd_card *card) 304int __devinit snd_msndmix_new(struct snd_card *card)
306{ 305{
307 struct snd_msnd *chip = card->private_data; 306 struct snd_msnd *chip = card->private_data;
308 unsigned int idx; 307 unsigned int idx;
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index 075777a6cf0..9b915e27b5b 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -25,7 +25,7 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/pm.h> 26#include <linux/pm.h>
27#include <linux/pnp.h> 27#include <linux/pnp.h>
28#include <linux/module.h> 28#include <linux/moduleparam.h>
29#include <sound/core.h> 29#include <sound/core.h>
30#include <sound/wss.h> 30#include <sound/wss.h>
31#include <sound/mpu401.h> 31#include <sound/mpu401.h>
@@ -46,9 +46,9 @@ MODULE_SUPPORTED_DEVICE("{{Yamaha,YMF719E-S},"
46 46
47static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 47static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
48static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 48static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
49static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 49static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
50#ifdef CONFIG_PNP 50#ifdef CONFIG_PNP
51static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 51static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
52#endif 52#endif
53static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0xf86,0x370,0x100 */ 53static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0xf86,0x370,0x100 */
54static long sb_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 54static long sb_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
@@ -221,7 +221,7 @@ static void snd_opl3sa2_write(struct snd_opl3sa2 *chip, unsigned char reg, unsig
221 spin_unlock_irqrestore(&chip->reg_lock, flags); 221 spin_unlock_irqrestore(&chip->reg_lock, flags);
222} 222}
223 223
224static int snd_opl3sa2_detect(struct snd_card *card) 224static int __devinit snd_opl3sa2_detect(struct snd_card *card)
225{ 225{
226 struct snd_opl3sa2 *chip = card->private_data; 226 struct snd_opl3sa2 *chip = card->private_data;
227 unsigned long port; 227 unsigned long port;
@@ -496,7 +496,7 @@ static void snd_opl3sa2_master_free(struct snd_kcontrol *kcontrol)
496 chip->master_volume = NULL; 496 chip->master_volume = NULL;
497} 497}
498 498
499static int snd_opl3sa2_mixer(struct snd_card *card) 499static int __devinit snd_opl3sa2_mixer(struct snd_card *card)
500{ 500{
501 struct snd_opl3sa2 *chip = card->private_data; 501 struct snd_opl3sa2 *chip = card->private_data;
502 struct snd_ctl_elem_id id1, id2; 502 struct snd_ctl_elem_id id1, id2;
@@ -596,8 +596,8 @@ static int snd_opl3sa2_resume(struct snd_card *card)
596#endif /* CONFIG_PM */ 596#endif /* CONFIG_PM */
597 597
598#ifdef CONFIG_PNP 598#ifdef CONFIG_PNP
599static int snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip, 599static int __devinit snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip,
600 struct pnp_dev *pdev) 600 struct pnp_dev *pdev)
601{ 601{
602 if (pnp_activate_dev(pdev) < 0) { 602 if (pnp_activate_dev(pdev) < 0) {
603 snd_printk(KERN_ERR "PnP configure failure (out of resources?)\n"); 603 snd_printk(KERN_ERR "PnP configure failure (out of resources?)\n");
@@ -647,7 +647,7 @@ static int snd_opl3sa2_card_new(int dev, struct snd_card **cardp)
647 return 0; 647 return 0;
648} 648}
649 649
650static int snd_opl3sa2_probe(struct snd_card *card, int dev) 650static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev)
651{ 651{
652 int xirq, xdma1, xdma2; 652 int xirq, xdma1, xdma2;
653 struct snd_opl3sa2 *chip; 653 struct snd_opl3sa2 *chip;
@@ -667,7 +667,7 @@ static int snd_opl3sa2_probe(struct snd_card *card, int dev)
667 err = snd_opl3sa2_detect(card); 667 err = snd_opl3sa2_detect(card);
668 if (err < 0) 668 if (err < 0)
669 return err; 669 return err;
670 err = request_irq(xirq, snd_opl3sa2_interrupt, 0, 670 err = request_irq(xirq, snd_opl3sa2_interrupt, IRQF_DISABLED,
671 "OPL3-SA2", card); 671 "OPL3-SA2", card);
672 if (err) { 672 if (err) {
673 snd_printk(KERN_ERR PFX "can't grab IRQ %d\n", xirq); 673 snd_printk(KERN_ERR PFX "can't grab IRQ %d\n", xirq);
@@ -707,9 +707,8 @@ static int snd_opl3sa2_probe(struct snd_card *card, int dev)
707 } 707 }
708 if (midi_port[dev] >= 0x300 && midi_port[dev] < 0x340) { 708 if (midi_port[dev] >= 0x300 && midi_port[dev] < 0x340) {
709 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_OPL3SA2, 709 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_OPL3SA2,
710 midi_port[dev], 710 midi_port[dev], 0,
711 MPU401_INFO_IRQ_HOOK, -1, 711 xirq, 0, &chip->rmidi)) < 0)
712 &chip->rmidi)) < 0)
713 return err; 712 return err;
714 } 713 }
715 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d", 714 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
@@ -721,8 +720,8 @@ static int snd_opl3sa2_probe(struct snd_card *card, int dev)
721} 720}
722 721
723#ifdef CONFIG_PNP 722#ifdef CONFIG_PNP
724static int snd_opl3sa2_pnp_detect(struct pnp_dev *pdev, 723static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
725 const struct pnp_device_id *id) 724 const struct pnp_device_id *id)
726{ 725{
727 static int dev; 726 static int dev;
728 int err; 727 int err;
@@ -754,7 +753,7 @@ static int snd_opl3sa2_pnp_detect(struct pnp_dev *pdev,
754 return 0; 753 return 0;
755} 754}
756 755
757static void snd_opl3sa2_pnp_remove(struct pnp_dev *pdev) 756static void __devexit snd_opl3sa2_pnp_remove(struct pnp_dev * pdev)
758{ 757{
759 snd_card_free(pnp_get_drvdata(pdev)); 758 snd_card_free(pnp_get_drvdata(pdev));
760 pnp_set_drvdata(pdev, NULL); 759 pnp_set_drvdata(pdev, NULL);
@@ -775,15 +774,15 @@ static struct pnp_driver opl3sa2_pnp_driver = {
775 .name = "snd-opl3sa2-pnpbios", 774 .name = "snd-opl3sa2-pnpbios",
776 .id_table = snd_opl3sa2_pnpbiosids, 775 .id_table = snd_opl3sa2_pnpbiosids,
777 .probe = snd_opl3sa2_pnp_detect, 776 .probe = snd_opl3sa2_pnp_detect,
778 .remove = snd_opl3sa2_pnp_remove, 777 .remove = __devexit_p(snd_opl3sa2_pnp_remove),
779#ifdef CONFIG_PM 778#ifdef CONFIG_PM
780 .suspend = snd_opl3sa2_pnp_suspend, 779 .suspend = snd_opl3sa2_pnp_suspend,
781 .resume = snd_opl3sa2_pnp_resume, 780 .resume = snd_opl3sa2_pnp_resume,
782#endif 781#endif
783}; 782};
784 783
785static int snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard, 784static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
786 const struct pnp_card_device_id *id) 785 const struct pnp_card_device_id *id)
787{ 786{
788 static int dev; 787 static int dev;
789 struct pnp_dev *pdev; 788 struct pnp_dev *pdev;
@@ -820,7 +819,7 @@ static int snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard,
820 return 0; 819 return 0;
821} 820}
822 821
823static void snd_opl3sa2_pnp_cremove(struct pnp_card_link *pcard) 822static void __devexit snd_opl3sa2_pnp_cremove(struct pnp_card_link * pcard)
824{ 823{
825 snd_card_free(pnp_get_card_drvdata(pcard)); 824 snd_card_free(pnp_get_card_drvdata(pcard));
826 pnp_set_card_drvdata(pcard, NULL); 825 pnp_set_card_drvdata(pcard, NULL);
@@ -842,7 +841,7 @@ static struct pnp_card_driver opl3sa2_pnpc_driver = {
842 .name = "snd-opl3sa2-cpnp", 841 .name = "snd-opl3sa2-cpnp",
843 .id_table = snd_opl3sa2_pnpids, 842 .id_table = snd_opl3sa2_pnpids,
844 .probe = snd_opl3sa2_pnp_cdetect, 843 .probe = snd_opl3sa2_pnp_cdetect,
845 .remove = snd_opl3sa2_pnp_cremove, 844 .remove = __devexit_p(snd_opl3sa2_pnp_cremove),
846#ifdef CONFIG_PM 845#ifdef CONFIG_PM
847 .suspend = snd_opl3sa2_pnp_csuspend, 846 .suspend = snd_opl3sa2_pnp_csuspend,
848 .resume = snd_opl3sa2_pnp_cresume, 847 .resume = snd_opl3sa2_pnp_cresume,
@@ -850,8 +849,8 @@ static struct pnp_card_driver opl3sa2_pnpc_driver = {
850}; 849};
851#endif /* CONFIG_PNP */ 850#endif /* CONFIG_PNP */
852 851
853static int snd_opl3sa2_isa_match(struct device *pdev, 852static int __devinit snd_opl3sa2_isa_match(struct device *pdev,
854 unsigned int dev) 853 unsigned int dev)
855{ 854{
856 if (!enable[dev]) 855 if (!enable[dev])
857 return 0; 856 return 0;
@@ -878,8 +877,8 @@ static int snd_opl3sa2_isa_match(struct device *pdev,
878 return 1; 877 return 1;
879} 878}
880 879
881static int snd_opl3sa2_isa_probe(struct device *pdev, 880static int __devinit snd_opl3sa2_isa_probe(struct device *pdev,
882 unsigned int dev) 881 unsigned int dev)
883{ 882{
884 struct snd_card *card; 883 struct snd_card *card;
885 int err; 884 int err;
@@ -896,8 +895,8 @@ static int snd_opl3sa2_isa_probe(struct device *pdev,
896 return 0; 895 return 0;
897} 896}
898 897
899static int snd_opl3sa2_isa_remove(struct device *devptr, 898static int __devexit snd_opl3sa2_isa_remove(struct device *devptr,
900 unsigned int dev) 899 unsigned int dev)
901{ 900{
902 snd_card_free(dev_get_drvdata(devptr)); 901 snd_card_free(dev_get_drvdata(devptr));
903 dev_set_drvdata(devptr, NULL); 902 dev_set_drvdata(devptr, NULL);
@@ -922,7 +921,7 @@ static int snd_opl3sa2_isa_resume(struct device *dev, unsigned int n)
922static struct isa_driver snd_opl3sa2_isa_driver = { 921static struct isa_driver snd_opl3sa2_isa_driver = {
923 .match = snd_opl3sa2_isa_match, 922 .match = snd_opl3sa2_isa_match,
924 .probe = snd_opl3sa2_isa_probe, 923 .probe = snd_opl3sa2_isa_probe,
925 .remove = snd_opl3sa2_isa_remove, 924 .remove = __devexit_p(snd_opl3sa2_isa_remove),
926#ifdef CONFIG_PM 925#ifdef CONFIG_PM
927 .suspend = snd_opl3sa2_isa_suspend, 926 .suspend = snd_opl3sa2_isa_suspend,
928 .resume = snd_opl3sa2_isa_resume, 927 .resume = snd_opl3sa2_isa_resume,
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index c3da1df9371..8c24102d0d9 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -28,7 +28,7 @@
28#include <linux/pnp.h> 28#include <linux/pnp.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/ioport.h> 30#include <linux/ioport.h>
31#include <linux/module.h> 31#include <linux/moduleparam.h>
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/dma.h> 33#include <asm/dma.h>
34#include <sound/core.h> 34#include <sound/core.h>
@@ -37,7 +37,6 @@
37#include <sound/opl4.h> 37#include <sound/opl4.h>
38#include <sound/control.h> 38#include <sound/control.h>
39#include <sound/info.h> 39#include <sound/info.h>
40#define SNDRV_LEGACY_FIND_FREE_IOPORT
41#define SNDRV_LEGACY_FIND_FREE_IRQ 40#define SNDRV_LEGACY_FIND_FREE_IRQ
42#define SNDRV_LEGACY_FIND_FREE_DMA 41#define SNDRV_LEGACY_FIND_FREE_DMA
43#include <sound/initval.h> 42#include <sound/initval.h>
@@ -62,7 +61,7 @@ static int dma2 = SNDRV_DEFAULT_DMA1; /* 0,1,3 */
62static int wss; 61static int wss;
63static int ide; 62static int ide;
64#ifdef CONFIG_PNP 63#ifdef CONFIG_PNP
65static bool isapnp = 1; /* Enable ISA PnP detection */ 64static int isapnp = 1; /* Enable ISA PnP detection */
66#endif 65#endif
67 66
68module_param(index, int, 0444); 67module_param(index, int, 0444);
@@ -587,7 +586,7 @@ static int snd_miro_put_double(struct snd_kcontrol *kcontrol,
587 return change; 586 return change;
588} 587}
589 588
590static struct snd_kcontrol_new snd_miro_controls[] = { 589static struct snd_kcontrol_new snd_miro_controls[] __devinitdata = {
591MIRO_DOUBLE("Master Playback Volume", 0, ACI_GET_MASTER, ACI_SET_MASTER), 590MIRO_DOUBLE("Master Playback Volume", 0, ACI_GET_MASTER, ACI_SET_MASTER),
592MIRO_DOUBLE("Mic Playback Volume", 1, ACI_GET_MIC, ACI_SET_MIC), 591MIRO_DOUBLE("Mic Playback Volume", 1, ACI_GET_MIC, ACI_SET_MIC),
593MIRO_DOUBLE("Line Playback Volume", 1, ACI_GET_LINE, ACI_SET_LINE), 592MIRO_DOUBLE("Line Playback Volume", 1, ACI_GET_LINE, ACI_SET_LINE),
@@ -599,7 +598,7 @@ MIRO_DOUBLE("Aux Playback Volume", 2, ACI_GET_LINE2, ACI_SET_LINE2),
599 598
600/* Equalizer with seven bands (only PCM20) 599/* Equalizer with seven bands (only PCM20)
601 from -12dB up to +12dB on each band */ 600 from -12dB up to +12dB on each band */
602static struct snd_kcontrol_new snd_miro_eq_controls[] = { 601static struct snd_kcontrol_new snd_miro_eq_controls[] __devinitdata = {
603MIRO_DOUBLE("Tone Control - 28 Hz", 0, ACI_GET_EQ1, ACI_SET_EQ1), 602MIRO_DOUBLE("Tone Control - 28 Hz", 0, ACI_GET_EQ1, ACI_SET_EQ1),
604MIRO_DOUBLE("Tone Control - 160 Hz", 0, ACI_GET_EQ2, ACI_SET_EQ2), 603MIRO_DOUBLE("Tone Control - 160 Hz", 0, ACI_GET_EQ2, ACI_SET_EQ2),
605MIRO_DOUBLE("Tone Control - 400 Hz", 0, ACI_GET_EQ3, ACI_SET_EQ3), 604MIRO_DOUBLE("Tone Control - 400 Hz", 0, ACI_GET_EQ3, ACI_SET_EQ3),
@@ -609,15 +608,15 @@ MIRO_DOUBLE("Tone Control - 6.3 kHz", 0, ACI_GET_EQ6, ACI_SET_EQ6),
609MIRO_DOUBLE("Tone Control - 16 kHz", 0, ACI_GET_EQ7, ACI_SET_EQ7), 608MIRO_DOUBLE("Tone Control - 16 kHz", 0, ACI_GET_EQ7, ACI_SET_EQ7),
610}; 609};
611 610
612static struct snd_kcontrol_new snd_miro_radio_control[] = { 611static struct snd_kcontrol_new snd_miro_radio_control[] __devinitdata = {
613MIRO_DOUBLE("Radio Playback Volume", 0, ACI_GET_LINE1, ACI_SET_LINE1), 612MIRO_DOUBLE("Radio Playback Volume", 0, ACI_GET_LINE1, ACI_SET_LINE1),
614}; 613};
615 614
616static struct snd_kcontrol_new snd_miro_line_control[] = { 615static struct snd_kcontrol_new snd_miro_line_control[] __devinitdata = {
617MIRO_DOUBLE("Line Playback Volume", 2, ACI_GET_LINE1, ACI_SET_LINE1), 616MIRO_DOUBLE("Line Playback Volume", 2, ACI_GET_LINE1, ACI_SET_LINE1),
618}; 617};
619 618
620static struct snd_kcontrol_new snd_miro_preamp_control[] = { 619static struct snd_kcontrol_new snd_miro_preamp_control[] __devinitdata = {
621{ 620{
622 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 621 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
623 .name = "Mic Boost", 622 .name = "Mic Boost",
@@ -627,7 +626,7 @@ static struct snd_kcontrol_new snd_miro_preamp_control[] = {
627 .put = snd_miro_put_preamp, 626 .put = snd_miro_put_preamp,
628}}; 627}};
629 628
630static struct snd_kcontrol_new snd_miro_amp_control[] = { 629static struct snd_kcontrol_new snd_miro_amp_control[] __devinitdata = {
631{ 630{
632 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 631 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
633 .name = "Line Boost", 632 .name = "Line Boost",
@@ -637,7 +636,7 @@ static struct snd_kcontrol_new snd_miro_amp_control[] = {
637 .put = snd_miro_put_amp, 636 .put = snd_miro_put_amp,
638}}; 637}};
639 638
640static struct snd_kcontrol_new snd_miro_capture_control[] = { 639static struct snd_kcontrol_new snd_miro_capture_control[] __devinitdata = {
641{ 640{
642 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 641 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
643 .name = "PCM Capture Switch", 642 .name = "PCM Capture Switch",
@@ -647,7 +646,7 @@ static struct snd_kcontrol_new snd_miro_capture_control[] = {
647 .put = snd_miro_put_capture, 646 .put = snd_miro_put_capture,
648}}; 647}};
649 648
650static unsigned char aci_init_values[][2] = { 649static unsigned char aci_init_values[][2] __devinitdata = {
651 { ACI_SET_MUTE, 0x00 }, 650 { ACI_SET_MUTE, 0x00 },
652 { ACI_SET_POWERAMP, 0x00 }, 651 { ACI_SET_POWERAMP, 0x00 },
653 { ACI_SET_PREAMP, 0x00 }, 652 { ACI_SET_PREAMP, 0x00 },
@@ -670,7 +669,7 @@ static unsigned char aci_init_values[][2] = {
670 { ACI_SET_MASTER + 1, 0x20 }, 669 { ACI_SET_MASTER + 1, 0x20 },
671}; 670};
672 671
673static int snd_set_aci_init_values(struct snd_miro *miro) 672static int __devinit snd_set_aci_init_values(struct snd_miro *miro)
674{ 673{
675 int idx, error; 674 int idx, error;
676 struct snd_miro_aci *aci = miro->aci; 675 struct snd_miro_aci *aci = miro->aci;
@@ -713,8 +712,8 @@ static int snd_set_aci_init_values(struct snd_miro *miro)
713 return 0; 712 return 0;
714} 713}
715 714
716static int snd_miro_mixer(struct snd_card *card, 715static int __devinit snd_miro_mixer(struct snd_card *card,
717 struct snd_miro *miro) 716 struct snd_miro *miro)
718{ 717{
719 unsigned int idx; 718 unsigned int idx;
720 int err; 719 int err;
@@ -771,8 +770,22 @@ static int snd_miro_mixer(struct snd_card *card,
771 return 0; 770 return 0;
772} 771}
773 772
774static int snd_miro_init(struct snd_miro *chip, 773static long snd_legacy_find_free_ioport(long *port_table, long size)
775 unsigned short hardware) 774{
775 while (*port_table != -1) {
776 struct resource *res;
777 if ((res = request_region(*port_table, size,
778 "ALSA test")) != NULL) {
779 release_and_free_resource(res);
780 return *port_table;
781 }
782 port_table++;
783 }
784 return -1;
785}
786
787static int __devinit snd_miro_init(struct snd_miro *chip,
788 unsigned short hardware)
776{ 789{
777 static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; 790 static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
778 791
@@ -989,8 +1002,8 @@ static void snd_miro_proc_read(struct snd_info_entry * entry,
989 snd_iprintf(buffer, " preamp : 0x%x\n", aci->aci_preamp); 1002 snd_iprintf(buffer, " preamp : 0x%x\n", aci->aci_preamp);
990} 1003}
991 1004
992static void snd_miro_proc_init(struct snd_card *card, 1005static void __devinit snd_miro_proc_init(struct snd_card *card,
993 struct snd_miro *miro) 1006 struct snd_miro *miro)
994{ 1007{
995 struct snd_info_entry *entry; 1008 struct snd_info_entry *entry;
996 1009
@@ -1002,7 +1015,7 @@ static void snd_miro_proc_init(struct snd_card *card,
1002 * Init 1015 * Init
1003 */ 1016 */
1004 1017
1005static int snd_miro_configure(struct snd_miro *chip) 1018static int __devinit snd_miro_configure(struct snd_miro *chip)
1006{ 1019{
1007 unsigned char wss_base_bits; 1020 unsigned char wss_base_bits;
1008 unsigned char irq_bits; 1021 unsigned char irq_bits;
@@ -1162,7 +1175,7 @@ __skip_mpu:
1162 return 0; 1175 return 0;
1163} 1176}
1164 1177
1165static int snd_miro_opti_check(struct snd_miro *chip) 1178static int __devinit snd_miro_opti_check(struct snd_miro *chip)
1166{ 1179{
1167 unsigned char value; 1180 unsigned char value;
1168 1181
@@ -1182,8 +1195,8 @@ static int snd_miro_opti_check(struct snd_miro *chip)
1182 return -ENODEV; 1195 return -ENODEV;
1183} 1196}
1184 1197
1185static int snd_card_miro_detect(struct snd_card *card, 1198static int __devinit snd_card_miro_detect(struct snd_card *card,
1186 struct snd_miro *chip) 1199 struct snd_miro *chip)
1187{ 1200{
1188 int i, err; 1201 int i, err;
1189 1202
@@ -1200,8 +1213,8 @@ static int snd_card_miro_detect(struct snd_card *card,
1200 return -ENODEV; 1213 return -ENODEV;
1201} 1214}
1202 1215
1203static int snd_card_miro_aci_detect(struct snd_card *card, 1216static int __devinit snd_card_miro_aci_detect(struct snd_card *card,
1204 struct snd_miro *miro) 1217 struct snd_miro *miro)
1205{ 1218{
1206 unsigned char regval; 1219 unsigned char regval;
1207 int i; 1220 int i;
@@ -1265,7 +1278,7 @@ static void snd_card_miro_free(struct snd_card *card)
1265 release_and_free_resource(miro->res_mc_base); 1278 release_and_free_resource(miro->res_mc_base);
1266} 1279}
1267 1280
1268static int snd_miro_probe(struct snd_card *card) 1281static int __devinit snd_miro_probe(struct snd_card *card)
1269{ 1282{
1270 int error; 1283 int error;
1271 struct snd_miro *miro = card->private_data; 1284 struct snd_miro *miro = card->private_data;
@@ -1286,6 +1299,7 @@ static int snd_miro_probe(struct snd_card *card)
1286 1299
1287 error = snd_card_miro_aci_detect(card, miro); 1300 error = snd_card_miro_aci_detect(card, miro);
1288 if (error < 0) { 1301 if (error < 0) {
1302 snd_card_free(card);
1289 snd_printk(KERN_ERR "unable to detect aci chip\n"); 1303 snd_printk(KERN_ERR "unable to detect aci chip\n");
1290 return -ENODEV; 1304 return -ENODEV;
1291 } 1305 }
@@ -1363,7 +1377,8 @@ static int snd_miro_probe(struct snd_card *card)
1363 rmidi = NULL; 1377 rmidi = NULL;
1364 else { 1378 else {
1365 error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 1379 error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
1366 mpu_port, 0, miro->mpu_irq, &rmidi); 1380 mpu_port, 0, miro->mpu_irq, IRQF_DISABLED,
1381 &rmidi);
1367 if (error < 0) 1382 if (error < 0)
1368 snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n", 1383 snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n",
1369 mpu_port); 1384 mpu_port);
@@ -1386,7 +1401,7 @@ static int snd_miro_probe(struct snd_card *card)
1386 return snd_card_register(card); 1401 return snd_card_register(card);
1387} 1402}
1388 1403
1389static int snd_miro_isa_match(struct device *devptr, unsigned int n) 1404static int __devinit snd_miro_isa_match(struct device *devptr, unsigned int n)
1390{ 1405{
1391#ifdef CONFIG_PNP 1406#ifdef CONFIG_PNP
1392 if (snd_miro_pnp_is_probed) 1407 if (snd_miro_pnp_is_probed)
@@ -1397,7 +1412,7 @@ static int snd_miro_isa_match(struct device *devptr, unsigned int n)
1397 return 1; 1412 return 1;
1398} 1413}
1399 1414
1400static int snd_miro_isa_probe(struct device *devptr, unsigned int n) 1415static int __devinit snd_miro_isa_probe(struct device *devptr, unsigned int n)
1401{ 1416{
1402 static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; 1417 static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
1403 static long possible_mpu_ports[] = {0x330, 0x300, 0x310, 0x320, -1}; 1418 static long possible_mpu_ports[] = {0x330, 0x300, 0x310, 0x320, -1};
@@ -1491,8 +1506,8 @@ static int snd_miro_isa_probe(struct device *devptr, unsigned int n)
1491 return 0; 1506 return 0;
1492} 1507}
1493 1508
1494static int snd_miro_isa_remove(struct device *devptr, 1509static int __devexit snd_miro_isa_remove(struct device *devptr,
1495 unsigned int dev) 1510 unsigned int dev)
1496{ 1511{
1497 snd_card_free(dev_get_drvdata(devptr)); 1512 snd_card_free(dev_get_drvdata(devptr));
1498 dev_set_drvdata(devptr, NULL); 1513 dev_set_drvdata(devptr, NULL);
@@ -1504,7 +1519,7 @@ static int snd_miro_isa_remove(struct device *devptr,
1504static struct isa_driver snd_miro_driver = { 1519static struct isa_driver snd_miro_driver = {
1505 .match = snd_miro_isa_match, 1520 .match = snd_miro_isa_match,
1506 .probe = snd_miro_isa_probe, 1521 .probe = snd_miro_isa_probe,
1507 .remove = snd_miro_isa_remove, 1522 .remove = __devexit_p(snd_miro_isa_remove),
1508 /* FIXME: suspend/resume */ 1523 /* FIXME: suspend/resume */
1509 .driver = { 1524 .driver = {
1510 .name = DEV_NAME 1525 .name = DEV_NAME
@@ -1513,9 +1528,9 @@ static struct isa_driver snd_miro_driver = {
1513 1528
1514#ifdef CONFIG_PNP 1529#ifdef CONFIG_PNP
1515 1530
1516static int snd_card_miro_pnp(struct snd_miro *chip, 1531static int __devinit snd_card_miro_pnp(struct snd_miro *chip,
1517 struct pnp_card_link *card, 1532 struct pnp_card_link *card,
1518 const struct pnp_card_device_id *pid) 1533 const struct pnp_card_device_id *pid)
1519{ 1534{
1520 struct pnp_dev *pdev; 1535 struct pnp_dev *pdev;
1521 int err; 1536 int err;
@@ -1574,8 +1589,8 @@ static int snd_card_miro_pnp(struct snd_miro *chip,
1574 return 0; 1589 return 0;
1575} 1590}
1576 1591
1577static int snd_miro_pnp_probe(struct pnp_card_link *pcard, 1592static int __devinit snd_miro_pnp_probe(struct pnp_card_link *pcard,
1578 const struct pnp_card_device_id *pid) 1593 const struct pnp_card_device_id *pid)
1579{ 1594{
1580 struct snd_card *card; 1595 struct snd_card *card;
1581 int err; 1596 int err;
@@ -1624,7 +1639,7 @@ static int snd_miro_pnp_probe(struct pnp_card_link *pcard,
1624 return 0; 1639 return 0;
1625} 1640}
1626 1641
1627static void snd_miro_pnp_remove(struct pnp_card_link *pcard) 1642static void __devexit snd_miro_pnp_remove(struct pnp_card_link * pcard)
1628{ 1643{
1629 snd_card_free(pnp_get_card_drvdata(pcard)); 1644 snd_card_free(pnp_get_card_drvdata(pcard));
1630 pnp_set_card_drvdata(pcard, NULL); 1645 pnp_set_card_drvdata(pcard, NULL);
@@ -1636,7 +1651,7 @@ static struct pnp_card_driver miro_pnpc_driver = {
1636 .name = "miro", 1651 .name = "miro",
1637 .id_table = snd_miro_pnpids, 1652 .id_table = snd_miro_pnpids,
1638 .probe = snd_miro_pnp_probe, 1653 .probe = snd_miro_pnp_probe,
1639 .remove = snd_miro_pnp_remove, 1654 .remove = __devexit_p(snd_miro_pnp_remove),
1640}; 1655};
1641#endif 1656#endif
1642 1657
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index b41ed8661b2..c35dc68930d 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -28,7 +28,7 @@
28#include <linux/isa.h> 28#include <linux/isa.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/pnp.h> 30#include <linux/pnp.h>
31#include <linux/module.h> 31#include <linux/moduleparam.h>
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/dma.h> 33#include <asm/dma.h>
34#include <sound/core.h> 34#include <sound/core.h>
@@ -39,7 +39,6 @@
39#ifndef OPTi93X 39#ifndef OPTi93X
40#include <sound/opl4.h> 40#include <sound/opl4.h>
41#endif 41#endif
42#define SNDRV_LEGACY_FIND_FREE_IOPORT
43#define SNDRV_LEGACY_FIND_FREE_IRQ 42#define SNDRV_LEGACY_FIND_FREE_IRQ
44#define SNDRV_LEGACY_FIND_FREE_DMA 43#define SNDRV_LEGACY_FIND_FREE_DMA
45#include <sound/initval.h> 44#include <sound/initval.h>
@@ -64,9 +63,9 @@ MODULE_SUPPORTED_DEVICE("{{OPTi,82C924 (AD1848)},"
64 63
65static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */ 64static int index = SNDRV_DEFAULT_IDX1; /* Index 0-MAX */
66static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */ 65static char *id = SNDRV_DEFAULT_STR1; /* ID for this card */
67//static bool enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */ 66//static int enable = SNDRV_DEFAULT_ENABLE1; /* Enable this card */
68#ifdef CONFIG_PNP 67#ifdef CONFIG_PNP
69static bool isapnp = true; /* Enable ISA PnP detection */ 68static int isapnp = 1; /* Enable ISA PnP detection */
70#endif 69#endif
71static long port = SNDRV_DEFAULT_PORT1; /* 0x530,0xe80,0xf40,0x604 */ 70static long port = SNDRV_DEFAULT_PORT1; /* 0x530,0xe80,0xf40,0x604 */
72static long mpu_port = SNDRV_DEFAULT_PORT1; /* 0x300,0x310,0x320,0x330 */ 71static long mpu_port = SNDRV_DEFAULT_PORT1; /* 0x300,0x310,0x320,0x330 */
@@ -136,9 +135,10 @@ struct snd_opti9xx {
136 unsigned long mc_base_size; 135 unsigned long mc_base_size;
137#ifdef OPTi93X 136#ifdef OPTi93X
138 unsigned long mc_indir_index; 137 unsigned long mc_indir_index;
138 unsigned long mc_indir_size;
139 struct resource *res_mc_indir; 139 struct resource *res_mc_indir;
140#endif /* OPTi93X */
141 struct snd_wss *codec; 140 struct snd_wss *codec;
141#endif /* OPTi93X */
142 unsigned long pwd_reg; 142 unsigned long pwd_reg;
143 143
144 spinlock_t lock; 144 spinlock_t lock;
@@ -186,8 +186,21 @@ static char * snd_opti9xx_names[] = {
186 "82C930", "82C931", "82C933" 186 "82C930", "82C931", "82C933"
187}; 187};
188 188
189static int snd_opti9xx_init(struct snd_opti9xx *chip, 189
190 unsigned short hardware) 190static long __devinit snd_legacy_find_free_ioport(long *port_table, long size)
191{
192 while (*port_table != -1) {
193 if (request_region(*port_table, size, "ALSA test")) {
194 release_region(*port_table, size);
195 return *port_table;
196 }
197 port_table++;
198 }
199 return -1;
200}
201
202static int __devinit snd_opti9xx_init(struct snd_opti9xx *chip,
203 unsigned short hardware)
191{ 204{
192 static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; 205 static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2};
193 206
@@ -232,8 +245,10 @@ static int snd_opti9xx_init(struct snd_opti9xx *chip,
232 case OPTi9XX_HW_82C931: 245 case OPTi9XX_HW_82C931:
233 case OPTi9XX_HW_82C933: 246 case OPTi9XX_HW_82C933:
234 chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d; 247 chip->mc_base = (hardware == OPTi9XX_HW_82C930) ? 0xf8f : 0xf8d;
235 if (!chip->mc_indir_index) 248 if (!chip->mc_indir_index) {
236 chip->mc_indir_index = 0xe0e; 249 chip->mc_indir_index = 0xe0e;
250 chip->mc_indir_size = 2;
251 }
237 chip->password = 0xe4; 252 chip->password = 0xe4;
238 chip->pwd_reg = 0; 253 chip->pwd_reg = 0;
239 break; 254 break;
@@ -336,7 +351,7 @@ static void snd_opti9xx_write(struct snd_opti9xx *chip, unsigned char reg,
336 (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask))) 351 (snd_opti9xx_read(chip, reg) & ~(mask)) | ((value) & (mask)))
337 352
338 353
339static int snd_opti9xx_configure(struct snd_opti9xx *chip, 354static int __devinit snd_opti9xx_configure(struct snd_opti9xx *chip,
340 long port, 355 long port,
341 int irq, int dma1, int dma2, 356 int irq, int dma1, int dma2,
342 long mpu_port, int mpu_irq) 357 long mpu_port, int mpu_irq)
@@ -388,9 +403,7 @@ static int snd_opti9xx_configure(struct snd_opti9xx *chip,
388 403
389#else /* OPTi93X */ 404#else /* OPTi93X */
390 case OPTi9XX_HW_82C931: 405 case OPTi9XX_HW_82C931:
391 /* disable 3D sound (set GPIO1 as output, low) */ 406 case OPTi9XX_HW_82C933:
392 snd_opti9xx_write_mask(chip, OPTi9XX_MC_REG(20), 0x04, 0x0c);
393 case OPTi9XX_HW_82C933: /* FALL THROUGH */
394 /* 407 /*
395 * The BTC 1817DW has QS1000 wavetable which is connected 408 * The BTC 1817DW has QS1000 wavetable which is connected
396 * to the serial digital input of the OPTI931. 409 * to the serial digital input of the OPTI931.
@@ -593,7 +606,7 @@ WSS_DOUBLE_TLV("Aux Playback Volume", 0,
593 db_scale_4bit_12db_max), 606 db_scale_4bit_12db_max),
594}; 607};
595 608
596static int snd_opti93x_mixer(struct snd_wss *chip) 609static int __devinit snd_opti93x_mixer(struct snd_wss *chip)
597{ 610{
598 struct snd_card *card; 611 struct snd_card *card;
599 unsigned int idx; 612 unsigned int idx;
@@ -666,7 +679,7 @@ static irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id)
666 679
667#endif /* OPTi93X */ 680#endif /* OPTi93X */
668 681
669static int snd_opti9xx_read_check(struct snd_opti9xx *chip) 682static int __devinit snd_opti9xx_read_check(struct snd_opti9xx *chip)
670{ 683{
671 unsigned char value; 684 unsigned char value;
672#ifdef OPTi93X 685#ifdef OPTi93X
@@ -683,7 +696,8 @@ static int snd_opti9xx_read_check(struct snd_opti9xx *chip)
683 if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) 696 if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1)))
684 return 0; 697 return 0;
685#else /* OPTi93X */ 698#else /* OPTi93X */
686 chip->res_mc_indir = request_region(chip->mc_indir_index, 2, 699 chip->res_mc_indir = request_region(chip->mc_indir_index,
700 chip->mc_indir_size,
687 "OPTi93x MC"); 701 "OPTi93x MC");
688 if (chip->res_mc_indir == NULL) 702 if (chip->res_mc_indir == NULL)
689 return -EBUSY; 703 return -EBUSY;
@@ -707,8 +721,8 @@ static int snd_opti9xx_read_check(struct snd_opti9xx *chip)
707 return -ENODEV; 721 return -ENODEV;
708} 722}
709 723
710static int snd_card_opti9xx_detect(struct snd_card *card, 724static int __devinit snd_card_opti9xx_detect(struct snd_card *card,
711 struct snd_opti9xx *chip) 725 struct snd_opti9xx *chip)
712{ 726{
713 int i, err; 727 int i, err;
714 728
@@ -732,9 +746,9 @@ static int snd_card_opti9xx_detect(struct snd_card *card,
732} 746}
733 747
734#ifdef CONFIG_PNP 748#ifdef CONFIG_PNP
735static int snd_card_opti9xx_pnp(struct snd_opti9xx *chip, 749static int __devinit snd_card_opti9xx_pnp(struct snd_opti9xx *chip,
736 struct pnp_card_link *card, 750 struct pnp_card_link *card,
737 const struct pnp_card_device_id *pid) 751 const struct pnp_card_device_id *pid)
738{ 752{
739 struct pnp_dev *pdev; 753 struct pnp_dev *pdev;
740 int err; 754 int err;
@@ -756,9 +770,8 @@ static int snd_card_opti9xx_pnp(struct snd_opti9xx *chip,
756#ifdef OPTi93X 770#ifdef OPTi93X
757 port = pnp_port_start(pdev, 0) - 4; 771 port = pnp_port_start(pdev, 0) - 4;
758 fm_port = pnp_port_start(pdev, 1) + 8; 772 fm_port = pnp_port_start(pdev, 1) + 8;
759 /* adjust mc_indir_index - some cards report it at 0xe?d, 773 chip->mc_indir_index = pnp_port_start(pdev, 3) + 2;
760 other at 0xe?c but it really is always at 0xe?e */ 774 chip->mc_indir_size = pnp_port_len(pdev, 3) - 2;
761 chip->mc_indir_index = (pnp_port_start(pdev, 3) & ~0xf) | 0xe;
762#else 775#else
763 devmc = pnp_request_card_device(card, pid->devs[2].id, NULL); 776 devmc = pnp_request_card_device(card, pid->devs[2].id, NULL);
764 if (devmc == NULL) 777 if (devmc == NULL)
@@ -817,7 +830,7 @@ static void snd_card_opti9xx_free(struct snd_card *card)
817 } 830 }
818} 831}
819 832
820static int snd_opti9xx_probe(struct snd_card *card) 833static int __devinit snd_opti9xx_probe(struct snd_card *card)
821{ 834{
822 static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; 835 static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1};
823 int error; 836 int error;
@@ -858,7 +871,9 @@ static int snd_opti9xx_probe(struct snd_card *card)
858 &codec); 871 &codec);
859 if (error < 0) 872 if (error < 0)
860 return error; 873 return error;
874#ifdef OPTi93X
861 chip->codec = codec; 875 chip->codec = codec;
876#endif
862 error = snd_wss_pcm(codec, 0, &pcm); 877 error = snd_wss_pcm(codec, 0, &pcm);
863 if (error < 0) 878 if (error < 0)
864 return error; 879 return error;
@@ -877,7 +892,7 @@ static int snd_opti9xx_probe(struct snd_card *card)
877#endif 892#endif
878#ifdef OPTi93X 893#ifdef OPTi93X
879 error = request_irq(irq, snd_opti93x_interrupt, 894 error = request_irq(irq, snd_opti93x_interrupt,
880 0, DEV_NAME" - WSS", chip); 895 IRQF_DISABLED, DEV_NAME" - WSS", chip);
881 if (error < 0) { 896 if (error < 0) {
882 snd_printk(KERN_ERR "opti9xx: can't grab IRQ %d\n", irq); 897 snd_printk(KERN_ERR "opti9xx: can't grab IRQ %d\n", irq);
883 return error; 898 return error;
@@ -899,7 +914,7 @@ static int snd_opti9xx_probe(struct snd_card *card)
899 rmidi = NULL; 914 rmidi = NULL;
900 else { 915 else {
901 error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, 916 error = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
902 mpu_port, 0, mpu_irq, &rmidi); 917 mpu_port, 0, mpu_irq, IRQF_DISABLED, &rmidi);
903 if (error) 918 if (error)
904 snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n", 919 snd_printk(KERN_WARNING "no MPU-401 device at 0x%lx?\n",
905 mpu_port); 920 mpu_port);
@@ -952,8 +967,8 @@ static int snd_opti9xx_card_new(struct snd_card **cardp)
952 return 0; 967 return 0;
953} 968}
954 969
955static int snd_opti9xx_isa_match(struct device *devptr, 970static int __devinit snd_opti9xx_isa_match(struct device *devptr,
956 unsigned int dev) 971 unsigned int dev)
957{ 972{
958#ifdef CONFIG_PNP 973#ifdef CONFIG_PNP
959 if (snd_opti9xx_pnp_is_probed) 974 if (snd_opti9xx_pnp_is_probed)
@@ -964,8 +979,8 @@ static int snd_opti9xx_isa_match(struct device *devptr,
964 return 1; 979 return 1;
965} 980}
966 981
967static int snd_opti9xx_isa_probe(struct device *devptr, 982static int __devinit snd_opti9xx_isa_probe(struct device *devptr,
968 unsigned int dev) 983 unsigned int dev)
969{ 984{
970 struct snd_card *card; 985 struct snd_card *card;
971 int error; 986 int error;
@@ -1031,71 +1046,27 @@ static int snd_opti9xx_isa_probe(struct device *devptr,
1031 return 0; 1046 return 0;
1032} 1047}
1033 1048
1034static int snd_opti9xx_isa_remove(struct device *devptr, 1049static int __devexit snd_opti9xx_isa_remove(struct device *devptr,
1035 unsigned int dev) 1050 unsigned int dev)
1036{ 1051{
1037 snd_card_free(dev_get_drvdata(devptr)); 1052 snd_card_free(dev_get_drvdata(devptr));
1038 dev_set_drvdata(devptr, NULL); 1053 dev_set_drvdata(devptr, NULL);
1039 return 0; 1054 return 0;
1040} 1055}
1041 1056
1042#ifdef CONFIG_PM
1043static int snd_opti9xx_suspend(struct snd_card *card)
1044{
1045 struct snd_opti9xx *chip = card->private_data;
1046
1047 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
1048 chip->codec->suspend(chip->codec);
1049 return 0;
1050}
1051
1052static int snd_opti9xx_resume(struct snd_card *card)
1053{
1054 struct snd_opti9xx *chip = card->private_data;
1055 int error, xdma2;
1056#if defined(CS4231) || defined(OPTi93X)
1057 xdma2 = dma2;
1058#else
1059 xdma2 = -1;
1060#endif
1061
1062 error = snd_opti9xx_configure(chip, port, irq, dma1, xdma2,
1063 mpu_port, mpu_irq);
1064 if (error)
1065 return error;
1066 chip->codec->resume(chip->codec);
1067 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
1068 return 0;
1069}
1070
1071static int snd_opti9xx_isa_suspend(struct device *dev, unsigned int n,
1072 pm_message_t state)
1073{
1074 return snd_opti9xx_suspend(dev_get_drvdata(dev));
1075}
1076
1077static int snd_opti9xx_isa_resume(struct device *dev, unsigned int n)
1078{
1079 return snd_opti9xx_resume(dev_get_drvdata(dev));
1080}
1081#endif
1082
1083static struct isa_driver snd_opti9xx_driver = { 1057static struct isa_driver snd_opti9xx_driver = {
1084 .match = snd_opti9xx_isa_match, 1058 .match = snd_opti9xx_isa_match,
1085 .probe = snd_opti9xx_isa_probe, 1059 .probe = snd_opti9xx_isa_probe,
1086 .remove = snd_opti9xx_isa_remove, 1060 .remove = __devexit_p(snd_opti9xx_isa_remove),
1087#ifdef CONFIG_PM 1061 /* FIXME: suspend/resume */
1088 .suspend = snd_opti9xx_isa_suspend,
1089 .resume = snd_opti9xx_isa_resume,
1090#endif
1091 .driver = { 1062 .driver = {
1092 .name = DEV_NAME 1063 .name = DEV_NAME
1093 }, 1064 },
1094}; 1065};
1095 1066
1096#ifdef CONFIG_PNP 1067#ifdef CONFIG_PNP
1097static int snd_opti9xx_pnp_probe(struct pnp_card_link *pcard, 1068static int __devinit snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
1098 const struct pnp_card_device_id *pid) 1069 const struct pnp_card_device_id *pid)
1099{ 1070{
1100 struct snd_card *card; 1071 struct snd_card *card;
1101 int error, hw; 1072 int error, hw;
@@ -1146,36 +1117,19 @@ static int snd_opti9xx_pnp_probe(struct pnp_card_link *pcard,
1146 return 0; 1117 return 0;
1147} 1118}
1148 1119
1149static void snd_opti9xx_pnp_remove(struct pnp_card_link *pcard) 1120static void __devexit snd_opti9xx_pnp_remove(struct pnp_card_link * pcard)
1150{ 1121{
1151 snd_card_free(pnp_get_card_drvdata(pcard)); 1122 snd_card_free(pnp_get_card_drvdata(pcard));
1152 pnp_set_card_drvdata(pcard, NULL); 1123 pnp_set_card_drvdata(pcard, NULL);
1153 snd_opti9xx_pnp_is_probed = 0; 1124 snd_opti9xx_pnp_is_probed = 0;
1154} 1125}
1155 1126
1156#ifdef CONFIG_PM
1157static int snd_opti9xx_pnp_suspend(struct pnp_card_link *pcard,
1158 pm_message_t state)
1159{
1160 return snd_opti9xx_suspend(pnp_get_card_drvdata(pcard));
1161}
1162
1163static int snd_opti9xx_pnp_resume(struct pnp_card_link *pcard)
1164{
1165 return snd_opti9xx_resume(pnp_get_card_drvdata(pcard));
1166}
1167#endif
1168
1169static struct pnp_card_driver opti9xx_pnpc_driver = { 1127static struct pnp_card_driver opti9xx_pnpc_driver = {
1170 .flags = PNP_DRIVER_RES_DISABLE, 1128 .flags = PNP_DRIVER_RES_DISABLE,
1171 .name = "opti9xx", 1129 .name = "opti9xx",
1172 .id_table = snd_opti9xx_pnpids, 1130 .id_table = snd_opti9xx_pnpids,
1173 .probe = snd_opti9xx_pnp_probe, 1131 .probe = snd_opti9xx_pnp_probe,
1174 .remove = snd_opti9xx_pnp_remove, 1132 .remove = __devexit_p(snd_opti9xx_pnp_remove),
1175#ifdef CONFIG_PM
1176 .suspend = snd_opti9xx_pnp_suspend,
1177 .resume = snd_opti9xx_pnp_resume,
1178#endif
1179}; 1133};
1180#endif 1134#endif
1181 1135
diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c
index 45fcdff611f..5d61f5a2913 100644
--- a/sound/isa/sb/emu8000.c
+++ b/sound/isa/sb/emu8000.c
@@ -24,7 +24,6 @@
24#include <linux/sched.h> 24#include <linux/sched.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/export.h>
28#include <linux/delay.h> 27#include <linux/delay.h>
29#include <sound/core.h> 28#include <sound/core.h>
30#include <sound/emu8000.h> 29#include <sound/emu8000.h>
@@ -131,7 +130,7 @@ snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode)
131 130
132/* 131/*
133 */ 132 */
134static void 133static void __devinit
135snd_emu8000_read_wait(struct snd_emu8000 *emu) 134snd_emu8000_read_wait(struct snd_emu8000 *emu)
136{ 135{
137 while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) { 136 while ((EMU8000_SMALR_READ(emu) & 0x80000000) != 0) {
@@ -143,7 +142,7 @@ snd_emu8000_read_wait(struct snd_emu8000 *emu)
143 142
144/* 143/*
145 */ 144 */
146static void 145static void __devinit
147snd_emu8000_write_wait(struct snd_emu8000 *emu) 146snd_emu8000_write_wait(struct snd_emu8000 *emu)
148{ 147{
149 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) { 148 while ((EMU8000_SMALW_READ(emu) & 0x80000000) != 0) {
@@ -156,7 +155,7 @@ snd_emu8000_write_wait(struct snd_emu8000 *emu)
156/* 155/*
157 * detect a card at the given port 156 * detect a card at the given port
158 */ 157 */
159static int 158static int __devinit
160snd_emu8000_detect(struct snd_emu8000 *emu) 159snd_emu8000_detect(struct snd_emu8000 *emu)
161{ 160{
162 /* Initialise */ 161 /* Initialise */
@@ -182,7 +181,7 @@ snd_emu8000_detect(struct snd_emu8000 *emu)
182/* 181/*
183 * intiailize audio channels 182 * intiailize audio channels
184 */ 183 */
185static void 184static void __devinit
186init_audio(struct snd_emu8000 *emu) 185init_audio(struct snd_emu8000 *emu)
187{ 186{
188 int ch; 187 int ch;
@@ -223,7 +222,7 @@ init_audio(struct snd_emu8000 *emu)
223/* 222/*
224 * initialize DMA address 223 * initialize DMA address
225 */ 224 */
226static void 225static void __devinit
227init_dma(struct snd_emu8000 *emu) 226init_dma(struct snd_emu8000 *emu)
228{ 227{
229 EMU8000_SMALR_WRITE(emu, 0); 228 EMU8000_SMALR_WRITE(emu, 0);
@@ -235,7 +234,7 @@ init_dma(struct snd_emu8000 *emu)
235/* 234/*
236 * initialization arrays; from ADIP 235 * initialization arrays; from ADIP
237 */ 236 */
238static unsigned short init1[128] = { 237static unsigned short init1[128] /*__devinitdata*/ = {
239 0x03ff, 0x0030, 0x07ff, 0x0130, 0x0bff, 0x0230, 0x0fff, 0x0330, 238 0x03ff, 0x0030, 0x07ff, 0x0130, 0x0bff, 0x0230, 0x0fff, 0x0330,
240 0x13ff, 0x0430, 0x17ff, 0x0530, 0x1bff, 0x0630, 0x1fff, 0x0730, 239 0x13ff, 0x0430, 0x17ff, 0x0530, 0x1bff, 0x0630, 0x1fff, 0x0730,
241 0x23ff, 0x0830, 0x27ff, 0x0930, 0x2bff, 0x0a30, 0x2fff, 0x0b30, 240 0x23ff, 0x0830, 0x27ff, 0x0930, 0x2bff, 0x0a30, 0x2fff, 0x0b30,
@@ -257,7 +256,7 @@ static unsigned short init1[128] = {
257 0xf3ff, 0x0c30, 0xf7ff, 0x0d30, 0xfbff, 0x0e30, 0xffff, 0x0f30, 256 0xf3ff, 0x0c30, 0xf7ff, 0x0d30, 0xfbff, 0x0e30, 0xffff, 0x0f30,
258}; 257};
259 258
260static unsigned short init2[128] = { 259static unsigned short init2[128] /*__devinitdata*/ = {
261 0x03ff, 0x8030, 0x07ff, 0x8130, 0x0bff, 0x8230, 0x0fff, 0x8330, 260 0x03ff, 0x8030, 0x07ff, 0x8130, 0x0bff, 0x8230, 0x0fff, 0x8330,
262 0x13ff, 0x8430, 0x17ff, 0x8530, 0x1bff, 0x8630, 0x1fff, 0x8730, 261 0x13ff, 0x8430, 0x17ff, 0x8530, 0x1bff, 0x8630, 0x1fff, 0x8730,
263 0x23ff, 0x8830, 0x27ff, 0x8930, 0x2bff, 0x8a30, 0x2fff, 0x8b30, 262 0x23ff, 0x8830, 0x27ff, 0x8930, 0x2bff, 0x8a30, 0x2fff, 0x8b30,
@@ -279,7 +278,7 @@ static unsigned short init2[128] = {
279 0xf3ff, 0x8c30, 0xf7ff, 0x8d30, 0xfbff, 0x8e30, 0xffff, 0x8f30, 278 0xf3ff, 0x8c30, 0xf7ff, 0x8d30, 0xfbff, 0x8e30, 0xffff, 0x8f30,
280}; 279};
281 280
282static unsigned short init3[128] = { 281static unsigned short init3[128] /*__devinitdata*/ = {
283 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5, 282 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5,
284 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x8F7C, 0x167E, 0xF254, 283 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x8F7C, 0x167E, 0xF254,
285 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x8BAA, 0x1B6D, 0xF234, 284 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x8BAA, 0x1B6D, 0xF234,
@@ -301,7 +300,7 @@ static unsigned short init3[128] = {
301 0x1342, 0xD36E, 0x3EC7, 0xB3FF, 0x0000, 0x8365, 0x1420, 0x9570, 300 0x1342, 0xD36E, 0x3EC7, 0xB3FF, 0x0000, 0x8365, 0x1420, 0x9570,
302}; 301};
303 302
304static unsigned short init4[128] = { 303static unsigned short init4[128] /*__devinitdata*/ = {
305 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5, 304 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5,
306 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x0F7C, 0x167E, 0x7254, 305 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x0F7C, 0x167E, 0x7254,
307 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x0BAA, 0x1B6D, 0x7234, 306 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x0BAA, 0x1B6D, 0x7234,
@@ -327,7 +326,7 @@ static unsigned short init4[128] = {
327 * Taken from the oss driver, not obvious from the doc how this 326 * Taken from the oss driver, not obvious from the doc how this
328 * is meant to work 327 * is meant to work
329 */ 328 */
330static void 329static void __devinit
331send_array(struct snd_emu8000 *emu, unsigned short *data, int size) 330send_array(struct snd_emu8000 *emu, unsigned short *data, int size)
332{ 331{
333 int i; 332 int i;
@@ -349,7 +348,7 @@ send_array(struct snd_emu8000 *emu, unsigned short *data, int size)
349 * Send initialization arrays to start up, this just follows the 348 * Send initialization arrays to start up, this just follows the
350 * initialisation sequence in the adip. 349 * initialisation sequence in the adip.
351 */ 350 */
352static void 351static void __devinit
353init_arrays(struct snd_emu8000 *emu) 352init_arrays(struct snd_emu8000 *emu)
354{ 353{
355 send_array(emu, init1, ARRAY_SIZE(init1)/4); 354 send_array(emu, init1, ARRAY_SIZE(init1)/4);
@@ -375,7 +374,7 @@ init_arrays(struct snd_emu8000 *emu)
375 * seems that the only way to do this is to use the one channel and keep 374 * seems that the only way to do this is to use the one channel and keep
376 * reallocating between read and write. 375 * reallocating between read and write.
377 */ 376 */
378static void 377static void __devinit
379size_dram(struct snd_emu8000 *emu) 378size_dram(struct snd_emu8000 *emu)
380{ 379{
381 int i, size, detected_size; 380 int i, size, detected_size;
@@ -417,6 +416,9 @@ size_dram(struct snd_emu8000 *emu)
417 EMU8000_SMLD_READ(emu); /* discard stale data */ 416 EMU8000_SMLD_READ(emu); /* discard stale data */
418 if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2) 417 if (EMU8000_SMLD_READ(emu) != UNIQUE_ID2)
419 break; /* no memory at this address */ 418 break; /* no memory at this address */
419
420 detected_size = size;
421
420 snd_emu8000_read_wait(emu); 422 snd_emu8000_read_wait(emu);
421 423
422 /* 424 /*
@@ -429,18 +431,6 @@ size_dram(struct snd_emu8000 *emu)
429 if (EMU8000_SMLD_READ(emu) != UNIQUE_ID1) 431 if (EMU8000_SMLD_READ(emu) != UNIQUE_ID1)
430 break; /* we must have wrapped around */ 432 break; /* we must have wrapped around */
431 snd_emu8000_read_wait(emu); 433 snd_emu8000_read_wait(emu);
432
433 /* Otherwise, it's valid memory. */
434 detected_size = size + 512 * 1024;
435 }
436
437 /* Distinguish 512 KiB from 0. */
438 if (detected_size == 0) {
439 snd_emu8000_read_wait(emu);
440 EMU8000_SMALR_WRITE(emu, EMU8000_DRAM_OFFSET);
441 EMU8000_SMLD_READ(emu); /* discard stale data */
442 if (EMU8000_SMLD_READ(emu) == UNIQUE_ID1)
443 detected_size = 512 * 1024;
444 } 434 }
445 435
446 /* wait until FULL bit in SMAxW register is false */ 436 /* wait until FULL bit in SMAxW register is false */
@@ -512,7 +502,7 @@ snd_emu8000_init_fm(struct snd_emu8000 *emu)
512/* 502/*
513 * The main initialization routine. 503 * The main initialization routine.
514 */ 504 */
515static void 505static void __devinit
516snd_emu8000_init_hw(struct snd_emu8000 *emu) 506snd_emu8000_init_hw(struct snd_emu8000 *emu)
517{ 507{
518 int i; 508 int i;
@@ -1031,7 +1021,7 @@ static struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = {
1031/* 1021/*
1032 * create and attach mixer elements for WaveTable treble/bass controls 1022 * create and attach mixer elements for WaveTable treble/bass controls
1033 */ 1023 */
1034static int 1024static int __devinit
1035snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu) 1025snd_emu8000_create_mixer(struct snd_card *card, struct snd_emu8000 *emu)
1036{ 1026{
1037 int i, err = 0; 1027 int i, err = 0;
@@ -1082,7 +1072,7 @@ static int snd_emu8000_dev_free(struct snd_device *device)
1082/* 1072/*
1083 * initialize and register emu8000 synth device. 1073 * initialize and register emu8000 synth device.
1084 */ 1074 */
1085int 1075int __devinit
1086snd_emu8000_new(struct snd_card *card, int index, long port, int seq_ports, 1076snd_emu8000_new(struct snd_card *card, int index, long port, int seq_ports,
1087 struct snd_seq_device **awe_ret) 1077 struct snd_seq_device **awe_ret)
1088{ 1078{
diff --git a/sound/isa/sb/emu8000_callback.c b/sound/isa/sb/emu8000_callback.c
index 72a9ac5efb4..9a3c71cc2e0 100644
--- a/sound/isa/sb/emu8000_callback.c
+++ b/sound/isa/sb/emu8000_callback.c
@@ -20,7 +20,6 @@
20 */ 20 */
21 21
22#include "emu8000_local.h" 22#include "emu8000_local.h"
23#include <linux/export.h>
24#include <sound/asoundef.h> 23#include <sound/asoundef.h>
25 24
26/* 25/*
@@ -175,7 +174,7 @@ get_voice(struct snd_emux *emu, struct snd_emux_port *port)
175 hw = emu->hw; 174 hw = emu->hw;
176 175
177 for (i = 0; i < END; i++) { 176 for (i = 0; i < END; i++) {
178 best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */ 177 best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */;
179 best[i].voice = -1; 178 best[i].voice = -1;
180 } 179 }
181 180
diff --git a/sound/isa/sb/emu8000_synth.c b/sound/isa/sb/emu8000_synth.c
index 4e3fcfb15ad..0c7905c85b7 100644
--- a/sound/isa/sb/emu8000_synth.c
+++ b/sound/isa/sb/emu8000_synth.c
@@ -22,7 +22,6 @@
22 22
23#include "emu8000_local.h" 23#include "emu8000_local.h"
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/module.h>
26#include <sound/initval.h> 25#include <sound/initval.h>
27 26
28MODULE_AUTHOR("Takashi Iwai, Steve Ratcliffe"); 27MODULE_AUTHOR("Takashi Iwai, Steve Ratcliffe");
diff --git a/sound/isa/sb/jazz16.c b/sound/isa/sb/jazz16.c
index 4961da4e627..8ccbcddf08e 100644
--- a/sound/isa/sb/jazz16.c
+++ b/sound/isa/sb/jazz16.c
@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");
36 36
37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
38static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 38static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
39static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 39static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
40static unsigned long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 40static unsigned long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
41static unsigned long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; 41static unsigned long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
42static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; 42static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
@@ -78,8 +78,8 @@ static irqreturn_t jazz16_interrupt(int irq, void *chip)
78 return snd_sb8dsp_interrupt(chip); 78 return snd_sb8dsp_interrupt(chip);
79} 79}
80 80
81static int jazz16_configure_ports(unsigned long port, 81static int __devinit jazz16_configure_ports(unsigned long port,
82 unsigned long mpu_port, int idx) 82 unsigned long mpu_port, int idx)
83{ 83{
84 unsigned char val; 84 unsigned char val;
85 85
@@ -99,8 +99,8 @@ static int jazz16_configure_ports(unsigned long port,
99 return 0; 99 return 0;
100} 100}
101 101
102static int jazz16_detect_board(unsigned long port, 102static int __devinit jazz16_detect_board(unsigned long port,
103 unsigned long mpu_port) 103 unsigned long mpu_port)
104{ 104{
105 int err; 105 int err;
106 int val; 106 int val;
@@ -156,7 +156,7 @@ err_unmap:
156 return err; 156 return err;
157} 157}
158 158
159static int jazz16_configure_board(struct snd_sb *chip, int mpu_irq) 159static int __devinit jazz16_configure_board(struct snd_sb *chip, int mpu_irq)
160{ 160{
161 static unsigned char jazz_irq_bits[] = { 0, 0, 2, 3, 0, 1, 0, 4, 161 static unsigned char jazz_irq_bits[] = { 0, 0, 2, 3, 0, 1, 0, 4,
162 0, 2, 5, 0, 0, 0, 0, 6 }; 162 0, 2, 5, 0, 0, 0, 0, 6 };
@@ -183,7 +183,7 @@ static int jazz16_configure_board(struct snd_sb *chip, int mpu_irq)
183 return 0; 183 return 0;
184} 184}
185 185
186static int snd_jazz16_match(struct device *devptr, unsigned int dev) 186static int __devinit snd_jazz16_match(struct device *devptr, unsigned int dev)
187{ 187{
188 if (!enable[dev]) 188 if (!enable[dev])
189 return 0; 189 return 0;
@@ -218,7 +218,7 @@ static int snd_jazz16_match(struct device *devptr, unsigned int dev)
218 return 1; 218 return 1;
219} 219}
220 220
221static int snd_jazz16_probe(struct device *devptr, unsigned int dev) 221static int __devinit snd_jazz16_probe(struct device *devptr, unsigned int dev)
222{ 222{
223 struct snd_card *card; 223 struct snd_card *card;
224 struct snd_card_jazz16 *jazz16; 224 struct snd_card_jazz16 *jazz16;
@@ -322,6 +322,7 @@ static int snd_jazz16_probe(struct device *devptr, unsigned int dev)
322 MPU401_HW_MPU401, 322 MPU401_HW_MPU401,
323 mpu_port[dev], 0, 323 mpu_port[dev], 0,
324 mpu_irq[dev], 324 mpu_irq[dev],
325 mpu_irq[dev] >= 0 ? IRQF_DISABLED : 0,
325 NULL) < 0) 326 NULL) < 0)
326 snd_printk(KERN_ERR "no MPU-401 device at 0x%lx\n", 327 snd_printk(KERN_ERR "no MPU-401 device at 0x%lx\n",
327 mpu_port[dev]); 328 mpu_port[dev]);
@@ -341,7 +342,7 @@ err_free:
341 return err; 342 return err;
342} 343}
343 344
344static int snd_jazz16_remove(struct device *devptr, unsigned int dev) 345static int __devexit snd_jazz16_remove(struct device *devptr, unsigned int dev)
345{ 346{
346 struct snd_card *card = dev_get_drvdata(devptr); 347 struct snd_card *card = dev_get_drvdata(devptr);
347 348
@@ -380,7 +381,7 @@ static int snd_jazz16_resume(struct device *pdev, unsigned int n)
380static struct isa_driver snd_jazz16_driver = { 381static struct isa_driver snd_jazz16_driver = {
381 .match = snd_jazz16_match, 382 .match = snd_jazz16_match,
382 .probe = snd_jazz16_probe, 383 .probe = snd_jazz16_probe,
383 .remove = snd_jazz16_remove, 384 .remove = __devexit_p(snd_jazz16_remove),
384#ifdef CONFIG_PM 385#ifdef CONFIG_PM
385 .suspend = snd_jazz16_suspend, 386 .suspend = snd_jazz16_suspend,
386 .resume = snd_jazz16_resume, 387 .resume = snd_jazz16_resume,
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c
index 50dbec454f9..4d1c5a300ff 100644
--- a/sound/isa/sb/sb16.c
+++ b/sound/isa/sb/sb16.c
@@ -24,7 +24,7 @@
24#include <linux/pnp.h> 24#include <linux/pnp.h>
25#include <linux/err.h> 25#include <linux/err.h>
26#include <linux/isa.h> 26#include <linux/isa.h>
27#include <linux/module.h> 27#include <linux/moduleparam.h>
28#include <sound/core.h> 28#include <sound/core.h>
29#include <sound/sb.h> 29#include <sound/sb.h>
30#include <sound/sb16_csp.h> 30#include <sound/sb16_csp.h>
@@ -68,9 +68,9 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB AWE 32},"
68 68
69static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 69static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
70static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 70static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
71static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */ 71static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_ISAPNP; /* Enable this card */
72#ifdef CONFIG_PNP 72#ifdef CONFIG_PNP
73static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 73static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
74#endif 74#endif
75static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */ 75static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260,0x280 */
76static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */ 76static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x330,0x300 */
@@ -250,9 +250,9 @@ MODULE_DEVICE_TABLE(pnp_card, snd_sb16_pnpids);
250 250
251#ifdef CONFIG_PNP 251#ifdef CONFIG_PNP
252 252
253static int snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard, 253static int __devinit snd_card_sb16_pnp(int dev, struct snd_card_sb16 *acard,
254 struct pnp_card_link *card, 254 struct pnp_card_link *card,
255 const struct pnp_card_device_id *id) 255 const struct pnp_card_device_id *id)
256{ 256{
257 struct pnp_dev *pdev; 257 struct pnp_dev *pdev;
258 int err; 258 int err;
@@ -337,7 +337,7 @@ static int snd_sb16_card_new(int dev, struct snd_card **cardp)
337 return 0; 337 return 0;
338} 338}
339 339
340static int snd_sb16_probe(struct snd_card *card, int dev) 340static int __devinit snd_sb16_probe(struct snd_card *card, int dev)
341{ 341{
342 int xirq, xdma8, xdma16; 342 int xirq, xdma8, xdma16;
343 struct snd_sb *chip; 343 struct snd_sb *chip;
@@ -394,9 +394,8 @@ static int snd_sb16_probe(struct snd_card *card, int dev)
394 394
395 if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) { 395 if (chip->mpu_port > 0 && chip->mpu_port != SNDRV_AUTO_PORT) {
396 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SB, 396 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_SB,
397 chip->mpu_port, 397 chip->mpu_port, 0,
398 MPU401_INFO_IRQ_HOOK, -1, 398 xirq, 0, &chip->rmidi)) < 0)
399 &chip->rmidi)) < 0)
400 return err; 399 return err;
401 chip->rmidi_callback = snd_mpu401_uart_interrupt; 400 chip->rmidi_callback = snd_mpu401_uart_interrupt;
402 } 401 }
@@ -487,7 +486,7 @@ static int snd_sb16_resume(struct snd_card *card)
487} 486}
488#endif 487#endif
489 488
490static int snd_sb16_isa_probe1(int dev, struct device *pdev) 489static int __devinit snd_sb16_isa_probe1(int dev, struct device *pdev)
491{ 490{
492 struct snd_card_sb16 *acard; 491 struct snd_card_sb16 *acard;
493 struct snd_card *card; 492 struct snd_card *card;
@@ -517,12 +516,12 @@ static int snd_sb16_isa_probe1(int dev, struct device *pdev)
517} 516}
518 517
519 518
520static int snd_sb16_isa_match(struct device *pdev, unsigned int dev) 519static int __devinit snd_sb16_isa_match(struct device *pdev, unsigned int dev)
521{ 520{
522 return enable[dev] && !is_isapnp_selected(dev); 521 return enable[dev] && !is_isapnp_selected(dev);
523} 522}
524 523
525static int snd_sb16_isa_probe(struct device *pdev, unsigned int dev) 524static int __devinit snd_sb16_isa_probe(struct device *pdev, unsigned int dev)
526{ 525{
527 int err; 526 int err;
528 static int possible_irqs[] = {5, 9, 10, 7, -1}; 527 static int possible_irqs[] = {5, 9, 10, 7, -1};
@@ -563,7 +562,7 @@ static int snd_sb16_isa_probe(struct device *pdev, unsigned int dev)
563 } 562 }
564} 563}
565 564
566static int snd_sb16_isa_remove(struct device *pdev, unsigned int dev) 565static int __devexit snd_sb16_isa_remove(struct device *pdev, unsigned int dev)
567{ 566{
568 snd_card_free(dev_get_drvdata(pdev)); 567 snd_card_free(dev_get_drvdata(pdev));
569 dev_set_drvdata(pdev, NULL); 568 dev_set_drvdata(pdev, NULL);
@@ -592,7 +591,7 @@ static int snd_sb16_isa_resume(struct device *dev, unsigned int n)
592static struct isa_driver snd_sb16_isa_driver = { 591static struct isa_driver snd_sb16_isa_driver = {
593 .match = snd_sb16_isa_match, 592 .match = snd_sb16_isa_match,
594 .probe = snd_sb16_isa_probe, 593 .probe = snd_sb16_isa_probe,
595 .remove = snd_sb16_isa_remove, 594 .remove = __devexit_p(snd_sb16_isa_remove),
596#ifdef CONFIG_PM 595#ifdef CONFIG_PM
597 .suspend = snd_sb16_isa_suspend, 596 .suspend = snd_sb16_isa_suspend,
598 .resume = snd_sb16_isa_resume, 597 .resume = snd_sb16_isa_resume,
@@ -604,8 +603,8 @@ static struct isa_driver snd_sb16_isa_driver = {
604 603
605 604
606#ifdef CONFIG_PNP 605#ifdef CONFIG_PNP
607static int snd_sb16_pnp_detect(struct pnp_card_link *pcard, 606static int __devinit snd_sb16_pnp_detect(struct pnp_card_link *pcard,
608 const struct pnp_card_device_id *pid) 607 const struct pnp_card_device_id *pid)
609{ 608{
610 static int dev; 609 static int dev;
611 struct snd_card *card; 610 struct snd_card *card;
@@ -631,7 +630,7 @@ static int snd_sb16_pnp_detect(struct pnp_card_link *pcard,
631 return -ENODEV; 630 return -ENODEV;
632} 631}
633 632
634static void snd_sb16_pnp_remove(struct pnp_card_link *pcard) 633static void __devexit snd_sb16_pnp_remove(struct pnp_card_link * pcard)
635{ 634{
636 snd_card_free(pnp_get_card_drvdata(pcard)); 635 snd_card_free(pnp_get_card_drvdata(pcard));
637 pnp_set_card_drvdata(pcard, NULL); 636 pnp_set_card_drvdata(pcard, NULL);
@@ -657,7 +656,7 @@ static struct pnp_card_driver sb16_pnpc_driver = {
657#endif 656#endif
658 .id_table = snd_sb16_pnpids, 657 .id_table = snd_sb16_pnpids,
659 .probe = snd_sb16_pnp_detect, 658 .probe = snd_sb16_pnp_detect,
660 .remove = snd_sb16_pnp_remove, 659 .remove = __devexit_p(snd_sb16_pnp_remove),
661#ifdef CONFIG_PM 660#ifdef CONFIG_PM
662 .suspend = snd_sb16_pnp_suspend, 661 .suspend = snd_sb16_pnp_suspend,
663 .resume = snd_sb16_pnp_resume, 662 .resume = snd_sb16_pnp_resume,
diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
index c1aa21edcb6..bdc8dde4e4a 100644
--- a/sound/isa/sb/sb16_csp.c
+++ b/sound/isa/sb/sb16_csp.c
@@ -26,7 +26,6 @@
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/module.h>
30#include <sound/core.h> 29#include <sound/core.h>
31#include <sound/control.h> 30#include <sound/control.h>
32#include <sound/info.h> 31#include <sound/info.h>
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index 0bbcd4714d2..2a6cc1cfe94 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -37,7 +37,6 @@
37#include <asm/dma.h> 37#include <asm/dma.h>
38#include <linux/init.h> 38#include <linux/init.h>
39#include <linux/time.h> 39#include <linux/time.h>
40#include <linux/module.h>
41#include <sound/core.h> 40#include <sound/core.h>
42#include <sound/sb.h> 41#include <sound/sb.h>
43#include <sound/sb16_csp.h> 42#include <sound/sb16_csp.h>
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 237d964ff8a..2259e3f726a 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -23,7 +23,7 @@
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/isa.h> 24#include <linux/isa.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/module.h> 26#include <linux/moduleparam.h>
27#include <sound/core.h> 27#include <sound/core.h>
28#include <sound/sb.h> 28#include <sound/sb.h>
29#include <sound/opl3.h> 29#include <sound/opl3.h>
@@ -36,7 +36,7 @@ MODULE_SUPPORTED_DEVICE("{{Creative Labs,SB 1.0/SB 2.0/SB Pro}}");
36 36
37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 37static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
38static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 38static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
39static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 39static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
40static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */ 40static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220,0x240,0x260 */
41static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */ 41static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,10 */
42static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3 */ 42static int dma8[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 1,3 */
@@ -79,7 +79,7 @@ static void snd_sb8_free(struct snd_card *card)
79 release_and_free_resource(acard->fm_res); 79 release_and_free_resource(acard->fm_res);
80} 80}
81 81
82static int snd_sb8_match(struct device *pdev, unsigned int dev) 82static int __devinit snd_sb8_match(struct device *pdev, unsigned int dev)
83{ 83{
84 if (!enable[dev]) 84 if (!enable[dev])
85 return 0; 85 return 0;
@@ -94,7 +94,7 @@ static int snd_sb8_match(struct device *pdev, unsigned int dev)
94 return 1; 94 return 1;
95} 95}
96 96
97static int snd_sb8_probe(struct device *pdev, unsigned int dev) 97static int __devinit snd_sb8_probe(struct device *pdev, unsigned int dev)
98{ 98{
99 struct snd_sb *chip; 99 struct snd_sb *chip;
100 struct snd_card *card; 100 struct snd_card *card;
@@ -205,7 +205,7 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
205 return err; 205 return err;
206} 206}
207 207
208static int snd_sb8_remove(struct device *pdev, unsigned int dev) 208static int __devexit snd_sb8_remove(struct device *pdev, unsigned int dev)
209{ 209{
210 snd_card_free(dev_get_drvdata(pdev)); 210 snd_card_free(dev_get_drvdata(pdev));
211 dev_set_drvdata(pdev, NULL); 211 dev_set_drvdata(pdev, NULL);
@@ -244,7 +244,7 @@ static int snd_sb8_resume(struct device *dev, unsigned int n)
244static struct isa_driver snd_sb8_driver = { 244static struct isa_driver snd_sb8_driver = {
245 .match = snd_sb8_match, 245 .match = snd_sb8_match,
246 .probe = snd_sb8_probe, 246 .probe = snd_sb8_probe,
247 .remove = snd_sb8_remove, 247 .remove = __devexit_p(snd_sb8_remove),
248#ifdef CONFIG_PM 248#ifdef CONFIG_PM
249 .suspend = snd_sb8_suspend, 249 .suspend = snd_sb8_suspend,
250 .resume = snd_sb8_resume, 250 .resume = snd_sb8_resume,
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index 24d4121ab0e..7d84c9f34dc 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -34,7 +34,6 @@
34#include <asm/dma.h> 34#include <asm/dma.h>
35#include <linux/init.h> 35#include <linux/init.h>
36#include <linux/time.h> 36#include <linux/time.h>
37#include <linux/module.h>
38#include <sound/core.h> 37#include <sound/core.h>
39#include <sound/sb.h> 38#include <sound/sb.h>
40 39
diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c
index 3ef990602cd..eae6c1c0eff 100644
--- a/sound/isa/sb/sb_common.c
+++ b/sound/isa/sb/sb_common.c
@@ -25,7 +25,6 @@
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/ioport.h> 27#include <linux/ioport.h>
28#include <linux/module.h>
29#include <sound/core.h> 28#include <sound/core.h>
30#include <sound/sb.h> 29#include <sound/sb.h>
31#include <sound/initval.h> 30#include <sound/initval.h>
@@ -241,7 +240,7 @@ int snd_sbdsp_create(struct snd_card *card,
241 if (request_irq(irq, irq_handler, 240 if (request_irq(irq, irq_handler,
242 (hardware == SB_HW_ALS4000 || 241 (hardware == SB_HW_ALS4000 ||
243 hardware == SB_HW_CS5530) ? 242 hardware == SB_HW_CS5530) ?
244 IRQF_SHARED : 0, 243 IRQF_SHARED : IRQF_DISABLED,
245 "SoundBlaster", (void *) chip)) { 244 "SoundBlaster", (void *) chip)) {
246 snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq); 245 snd_printk(KERN_ERR "sb: can't grab irq %d\n", irq);
247 snd_sbdsp_free(chip); 246 snd_sbdsp_free(chip);
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c
index 5376ebff845..9a8bbf6dd62 100644
--- a/sound/isa/sc6000.c
+++ b/sound/isa/sc6000.c
@@ -48,7 +48,7 @@ MODULE_SUPPORTED_DEVICE("{{Gallant, SC-6000},"
48 48
49static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 49static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
50static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 50static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
51static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 51static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
52static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */ 52static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x220, 0x240 */
53static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 11 */ 53static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5, 7, 9, 10, 11 */
54static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */ 54static long mss_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* 0x530, 0xe80 */
@@ -121,7 +121,7 @@ MODULE_PARM_DESC(joystick, "Enable gameport.");
121/* 121/*
122 * sc6000_irq_to_softcfg - Decode irq number into cfg code. 122 * sc6000_irq_to_softcfg - Decode irq number into cfg code.
123 */ 123 */
124static unsigned char sc6000_irq_to_softcfg(int irq) 124static __devinit unsigned char sc6000_irq_to_softcfg(int irq)
125{ 125{
126 unsigned char val = 0; 126 unsigned char val = 0;
127 127
@@ -150,7 +150,7 @@ static unsigned char sc6000_irq_to_softcfg(int irq)
150/* 150/*
151 * sc6000_dma_to_softcfg - Decode dma number into cfg code. 151 * sc6000_dma_to_softcfg - Decode dma number into cfg code.
152 */ 152 */
153static unsigned char sc6000_dma_to_softcfg(int dma) 153static __devinit unsigned char sc6000_dma_to_softcfg(int dma)
154{ 154{
155 unsigned char val = 0; 155 unsigned char val = 0;
156 156
@@ -173,7 +173,7 @@ static unsigned char sc6000_dma_to_softcfg(int dma)
173/* 173/*
174 * sc6000_mpu_irq_to_softcfg - Decode MPU-401 irq number into cfg code. 174 * sc6000_mpu_irq_to_softcfg - Decode MPU-401 irq number into cfg code.
175 */ 175 */
176static unsigned char sc6000_mpu_irq_to_softcfg(int mpu_irq) 176static __devinit unsigned char sc6000_mpu_irq_to_softcfg(int mpu_irq)
177{ 177{
178 unsigned char val = 0; 178 unsigned char val = 0;
179 179
@@ -242,8 +242,8 @@ static int sc6000_write(char __iomem *vport, int cmd)
242 return -EIO; 242 return -EIO;
243} 243}
244 244
245static int sc6000_dsp_get_answer(char __iomem *vport, int command, 245static int __devinit sc6000_dsp_get_answer(char __iomem *vport, int command,
246 char *data, int data_len) 246 char *data, int data_len)
247{ 247{
248 int len = 0; 248 int len = 0;
249 249
@@ -269,7 +269,7 @@ static int sc6000_dsp_get_answer(char __iomem *vport, int command,
269 return len ? len : -EIO; 269 return len ? len : -EIO;
270} 270}
271 271
272static int sc6000_dsp_reset(char __iomem *vport) 272static int __devinit sc6000_dsp_reset(char __iomem *vport)
273{ 273{
274 iowrite8(1, vport + DSP_RESET); 274 iowrite8(1, vport + DSP_RESET);
275 udelay(10); 275 udelay(10);
@@ -281,7 +281,7 @@ static int sc6000_dsp_reset(char __iomem *vport)
281} 281}
282 282
283/* detection and initialization */ 283/* detection and initialization */
284static int sc6000_hw_cfg_write(char __iomem *vport, const int *cfg) 284static int __devinit sc6000_hw_cfg_write(char __iomem *vport, const int *cfg)
285{ 285{
286 if (sc6000_write(vport, COMMAND_6C) < 0) { 286 if (sc6000_write(vport, COMMAND_6C) < 0) {
287 snd_printk(KERN_WARNING "CMD 0x%x: failed!\n", COMMAND_6C); 287 snd_printk(KERN_WARNING "CMD 0x%x: failed!\n", COMMAND_6C);
@@ -345,8 +345,8 @@ static int sc6000_setup_board(char __iomem *vport, int config)
345 return 0; 345 return 0;
346} 346}
347 347
348static int sc6000_init_mss(char __iomem *vport, int config, 348static int __devinit sc6000_init_mss(char __iomem *vport, int config,
349 char __iomem *vmss_port, int mss_config) 349 char __iomem *vmss_port, int mss_config)
350{ 350{
351 if (sc6000_write(vport, DSP_INIT_MSS)) { 351 if (sc6000_write(vport, DSP_INIT_MSS)) {
352 snd_printk(KERN_ERR "sc6000_init_mss [0x%x]: failed!\n", 352 snd_printk(KERN_ERR "sc6000_init_mss [0x%x]: failed!\n",
@@ -364,9 +364,9 @@ static int sc6000_init_mss(char __iomem *vport, int config,
364 return 0; 364 return 0;
365} 365}
366 366
367static void sc6000_hw_cfg_encode(char __iomem *vport, int *cfg, 367static void __devinit sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
368 long xport, long xmpu, 368 long xport, long xmpu,
369 long xmss_port, int joystick) 369 long xmss_port, int joystick)
370{ 370{
371 cfg[0] = 0; 371 cfg[0] = 0;
372 cfg[1] = 0; 372 cfg[1] = 0;
@@ -386,8 +386,8 @@ static void sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
386 snd_printd("hw cfg %x, %x\n", cfg[0], cfg[1]); 386 snd_printd("hw cfg %x, %x\n", cfg[0], cfg[1]);
387} 387}
388 388
389static int sc6000_init_board(char __iomem *vport, 389static int __devinit sc6000_init_board(char __iomem *vport,
390 char __iomem *vmss_port, int dev) 390 char __iomem *vmss_port, int dev)
391{ 391{
392 char answer[15]; 392 char answer[15];
393 char version[2]; 393 char version[2];
@@ -467,7 +467,7 @@ static int sc6000_init_board(char __iomem *vport,
467 return 0; 467 return 0;
468} 468}
469 469
470static int snd_sc6000_mixer(struct snd_wss *chip) 470static int __devinit snd_sc6000_mixer(struct snd_wss *chip)
471{ 471{
472 struct snd_card *card = chip->card; 472 struct snd_card *card = chip->card;
473 struct snd_ctl_elem_id id1, id2; 473 struct snd_ctl_elem_id id1, id2;
@@ -502,7 +502,7 @@ static int snd_sc6000_mixer(struct snd_wss *chip)
502 return 0; 502 return 0;
503} 503}
504 504
505static int snd_sc6000_match(struct device *devptr, unsigned int dev) 505static int __devinit snd_sc6000_match(struct device *devptr, unsigned int dev)
506{ 506{
507 if (!enable[dev]) 507 if (!enable[dev])
508 return 0; 508 return 0;
@@ -545,7 +545,7 @@ static int snd_sc6000_match(struct device *devptr, unsigned int dev)
545 return 1; 545 return 1;
546} 546}
547 547
548static int snd_sc6000_probe(struct device *devptr, unsigned int dev) 548static int __devinit snd_sc6000_probe(struct device *devptr, unsigned int dev)
549{ 549{
550 static int possible_irqs[] = { 5, 7, 9, 10, 11, -1 }; 550 static int possible_irqs[] = { 5, 7, 9, 10, 11, -1 };
551 static int possible_dmas[] = { 1, 3, 0, -1 }; 551 static int possible_dmas[] = { 1, 3, 0, -1 };
@@ -658,7 +658,8 @@ static int snd_sc6000_probe(struct device *devptr, unsigned int dev)
658 if (snd_mpu401_uart_new(card, 0, 658 if (snd_mpu401_uart_new(card, 0,
659 MPU401_HW_MPU401, 659 MPU401_HW_MPU401,
660 mpu_port[dev], 0, 660 mpu_port[dev], 0,
661 mpu_irq[dev], NULL) < 0) 661 mpu_irq[dev], IRQF_DISABLED,
662 NULL) < 0)
662 snd_printk(KERN_ERR "no MPU-401 device at 0x%lx ?\n", 663 snd_printk(KERN_ERR "no MPU-401 device at 0x%lx ?\n",
663 mpu_port[dev]); 664 mpu_port[dev]);
664 } 665 }
@@ -687,7 +688,7 @@ err_exit:
687 return err; 688 return err;
688} 689}
689 690
690static int snd_sc6000_remove(struct device *devptr, unsigned int dev) 691static int __devexit snd_sc6000_remove(struct device *devptr, unsigned int dev)
691{ 692{
692 struct snd_card *card = dev_get_drvdata(devptr); 693 struct snd_card *card = dev_get_drvdata(devptr);
693 char __iomem **vport = card->private_data; 694 char __iomem **vport = card->private_data;
@@ -706,7 +707,7 @@ static int snd_sc6000_remove(struct device *devptr, unsigned int dev)
706static struct isa_driver snd_sc6000_driver = { 707static struct isa_driver snd_sc6000_driver = {
707 .match = snd_sc6000_match, 708 .match = snd_sc6000_match,
708 .probe = snd_sc6000_probe, 709 .probe = snd_sc6000_probe,
709 .remove = snd_sc6000_remove, 710 .remove = __devexit_p(snd_sc6000_remove),
710 /* FIXME: suspend/resume */ 711 /* FIXME: suspend/resume */
711 .driver = { 712 .driver = {
712 .name = DRV_NAME, 713 .name = DRV_NAME,
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 42a009720b2..e2d5d2d3ed9 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -28,7 +28,7 @@
28#include <linux/firmware.h> 28#include <linux/firmware.h>
29#include <linux/pnp.h> 29#include <linux/pnp.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/module.h> 31#include <linux/moduleparam.h>
32#include <asm/dma.h> 32#include <asm/dma.h>
33#include <sound/core.h> 33#include <sound/core.h>
34#include <sound/wss.h> 34#include <sound/wss.h>
@@ -683,7 +683,7 @@ static struct snd_kcontrol_new midi_mixer_ctl = {
683 * These IRQs are encoded as bit patterns so that they can be 683 * These IRQs are encoded as bit patterns so that they can be
684 * written to the control registers. 684 * written to the control registers.
685 */ 685 */
686static unsigned get_irq_config(int sscape_type, int irq) 686static unsigned __devinit get_irq_config(int sscape_type, int irq)
687{ 687{
688 static const int valid_irq[] = { 9, 5, 7, 10 }; 688 static const int valid_irq[] = { 9, 5, 7, 10 };
689 static const int old_irq[] = { 9, 7, 5, 15 }; 689 static const int old_irq[] = { 9, 7, 5, 15 };
@@ -706,7 +706,7 @@ static unsigned get_irq_config(int sscape_type, int irq)
706 * Perform certain arcane port-checks to see whether there 706 * Perform certain arcane port-checks to see whether there
707 * is a SoundScape board lurking behind the given ports. 707 * is a SoundScape board lurking behind the given ports.
708 */ 708 */
709static int detect_sscape(struct soundscape *s, long wss_io) 709static int __devinit detect_sscape(struct soundscape *s, long wss_io)
710{ 710{
711 unsigned long flags; 711 unsigned long flags;
712 unsigned d; 712 unsigned d;
@@ -817,15 +817,16 @@ static int mpu401_open(struct snd_mpu401 *mpu)
817/* 817/*
818 * Initialse an MPU-401 subdevice for MIDI support on the SoundScape. 818 * Initialse an MPU-401 subdevice for MIDI support on the SoundScape.
819 */ 819 */
820static int create_mpu401(struct snd_card *card, int devnum, 820static int __devinit create_mpu401(struct snd_card *card, int devnum,
821 unsigned long port, int irq) 821 unsigned long port, int irq)
822{ 822{
823 struct soundscape *sscape = get_card_soundscape(card); 823 struct soundscape *sscape = get_card_soundscape(card);
824 struct snd_rawmidi *rawmidi; 824 struct snd_rawmidi *rawmidi;
825 int err; 825 int err;
826 826
827 err = snd_mpu401_uart_new(card, devnum, MPU401_HW_MPU401, port, 827 err = snd_mpu401_uart_new(card, devnum, MPU401_HW_MPU401, port,
828 MPU401_INFO_INTEGRATED, irq, &rawmidi); 828 MPU401_INFO_INTEGRATED, irq, IRQF_DISABLED,
829 &rawmidi);
829 if (err == 0) { 830 if (err == 0) {
830 struct snd_mpu401 *mpu = rawmidi->private_data; 831 struct snd_mpu401 *mpu = rawmidi->private_data;
831 mpu->open_input = mpu401_open; 832 mpu->open_input = mpu401_open;
@@ -845,8 +846,8 @@ static int create_mpu401(struct snd_card *card, int devnum,
845 * try to support at least some of the extra bits by overriding 846 * try to support at least some of the extra bits by overriding
846 * some of the CS4231 callback. 847 * some of the CS4231 callback.
847 */ 848 */
848static int create_ad1845(struct snd_card *card, unsigned port, 849static int __devinit create_ad1845(struct snd_card *card, unsigned port,
849 int irq, int dma1, int dma2) 850 int irq, int dma1, int dma2)
850{ 851{
851 register struct soundscape *sscape = get_card_soundscape(card); 852 register struct soundscape *sscape = get_card_soundscape(card);
852 struct snd_wss *chip; 853 struct snd_wss *chip;
@@ -937,7 +938,7 @@ _error:
937 * Create an ALSA soundcard entry for the SoundScape, using 938 * Create an ALSA soundcard entry for the SoundScape, using
938 * the given list of port, IRQ and DMA resources. 939 * the given list of port, IRQ and DMA resources.
939 */ 940 */
940static int create_sscape(int dev, struct snd_card *card) 941static int __devinit create_sscape(int dev, struct snd_card *card)
941{ 942{
942 struct soundscape *sscape = get_card_soundscape(card); 943 struct soundscape *sscape = get_card_soundscape(card);
943 unsigned dma_cfg; 944 unsigned dma_cfg;
@@ -1019,15 +1020,13 @@ static int create_sscape(int dev, struct snd_card *card)
1019 irq_cfg = get_irq_config(sscape->type, irq[dev]); 1020 irq_cfg = get_irq_config(sscape->type, irq[dev]);
1020 if (irq_cfg == INVALID_IRQ) { 1021 if (irq_cfg == INVALID_IRQ) {
1021 snd_printk(KERN_ERR "sscape: Invalid IRQ %d\n", irq[dev]); 1022 snd_printk(KERN_ERR "sscape: Invalid IRQ %d\n", irq[dev]);
1022 err = -ENXIO; 1023 return -ENXIO;
1023 goto _release_dma;
1024 } 1024 }
1025 1025
1026 mpu_irq_cfg = get_irq_config(sscape->type, mpu_irq[dev]); 1026 mpu_irq_cfg = get_irq_config(sscape->type, mpu_irq[dev]);
1027 if (mpu_irq_cfg == INVALID_IRQ) { 1027 if (mpu_irq_cfg == INVALID_IRQ) {
1028 snd_printk(KERN_ERR "sscape: Invalid IRQ %d\n", mpu_irq[dev]); 1028 snd_printk(KERN_ERR "sscape: Invalid IRQ %d\n", mpu_irq[dev]);
1029 err = -ENXIO; 1029 return -ENXIO;
1030 goto _release_dma;
1031 } 1030 }
1032 1031
1033 /* 1032 /*
@@ -1143,7 +1142,7 @@ _release_region:
1143} 1142}
1144 1143
1145 1144
1146static int snd_sscape_match(struct device *pdev, unsigned int i) 1145static int __devinit snd_sscape_match(struct device *pdev, unsigned int i)
1147{ 1146{
1148 /* 1147 /*
1149 * Make sure we were given ALL of the other parameters. 1148 * Make sure we were given ALL of the other parameters.
@@ -1163,7 +1162,7 @@ static int snd_sscape_match(struct device *pdev, unsigned int i)
1163 return 1; 1162 return 1;
1164} 1163}
1165 1164
1166static int snd_sscape_probe(struct device *pdev, unsigned int dev) 1165static int __devinit snd_sscape_probe(struct device *pdev, unsigned int dev)
1167{ 1166{
1168 struct snd_card *card; 1167 struct snd_card *card;
1169 struct soundscape *sscape; 1168 struct soundscape *sscape;
@@ -1197,7 +1196,7 @@ _release_card:
1197 return ret; 1196 return ret;
1198} 1197}
1199 1198
1200static int snd_sscape_remove(struct device *devptr, unsigned int dev) 1199static int __devexit snd_sscape_remove(struct device *devptr, unsigned int dev)
1201{ 1200{
1202 snd_card_free(dev_get_drvdata(devptr)); 1201 snd_card_free(dev_get_drvdata(devptr));
1203 dev_set_drvdata(devptr, NULL); 1202 dev_set_drvdata(devptr, NULL);
@@ -1209,7 +1208,7 @@ static int snd_sscape_remove(struct device *devptr, unsigned int dev)
1209static struct isa_driver snd_sscape_driver = { 1208static struct isa_driver snd_sscape_driver = {
1210 .match = snd_sscape_match, 1209 .match = snd_sscape_match,
1211 .probe = snd_sscape_probe, 1210 .probe = snd_sscape_probe,
1212 .remove = snd_sscape_remove, 1211 .remove = __devexit_p(snd_sscape_remove),
1213 /* FIXME: suspend/resume */ 1212 /* FIXME: suspend/resume */
1214 .driver = { 1213 .driver = {
1215 .name = DEV_NAME 1214 .name = DEV_NAME
@@ -1217,7 +1216,7 @@ static struct isa_driver snd_sscape_driver = {
1217}; 1216};
1218 1217
1219#ifdef CONFIG_PNP 1218#ifdef CONFIG_PNP
1220static inline int get_next_autoindex(int i) 1219static inline int __devinit get_next_autoindex(int i)
1221{ 1220{
1222 while (i < SNDRV_CARDS && port[i] != SNDRV_AUTO_PORT) 1221 while (i < SNDRV_CARDS && port[i] != SNDRV_AUTO_PORT)
1223 ++i; 1222 ++i;
@@ -1225,8 +1224,8 @@ static inline int get_next_autoindex(int i)
1225} 1224}
1226 1225
1227 1226
1228static int sscape_pnp_detect(struct pnp_card_link *pcard, 1227static int __devinit sscape_pnp_detect(struct pnp_card_link *pcard,
1229 const struct pnp_card_device_id *pid) 1228 const struct pnp_card_device_id *pid)
1230{ 1229{
1231 static int idx = 0; 1230 static int idx = 0;
1232 struct pnp_dev *dev; 1231 struct pnp_dev *dev;
@@ -1310,7 +1309,7 @@ _release_card:
1310 return ret; 1309 return ret;
1311} 1310}
1312 1311
1313static void sscape_pnp_remove(struct pnp_card_link *pcard) 1312static void __devexit sscape_pnp_remove(struct pnp_card_link * pcard)
1314{ 1313{
1315 snd_card_free(pnp_get_card_drvdata(pcard)); 1314 snd_card_free(pnp_get_card_drvdata(pcard));
1316 pnp_set_card_drvdata(pcard, NULL); 1315 pnp_set_card_drvdata(pcard, NULL);
@@ -1321,7 +1320,7 @@ static struct pnp_card_driver sscape_pnpc_driver = {
1321 .name = "sscape", 1320 .name = "sscape",
1322 .id_table = sscape_pnpids, 1321 .id_table = sscape_pnpids,
1323 .probe = sscape_pnp_detect, 1322 .probe = sscape_pnp_detect,
1324 .remove = sscape_pnp_remove, 1323 .remove = __devexit_p(sscape_pnp_remove),
1325}; 1324};
1326 1325
1327#endif /* CONFIG_PNP */ 1326#endif /* CONFIG_PNP */
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c
index fe5dd982bd2..711670e4a42 100644
--- a/sound/isa/wavefront/wavefront.c
+++ b/sound/isa/wavefront/wavefront.c
@@ -24,7 +24,7 @@
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/isa.h> 25#include <linux/isa.h>
26#include <linux/pnp.h> 26#include <linux/pnp.h>
27#include <linux/module.h> 27#include <linux/moduleparam.h>
28#include <sound/core.h> 28#include <sound/core.h>
29#include <sound/initval.h> 29#include <sound/initval.h>
30#include <sound/opl3.h> 30#include <sound/opl3.h>
@@ -38,9 +38,9 @@ MODULE_SUPPORTED_DEVICE("{{Turtle Beach,Maui/Tropez/Tropez+}}");
38 38
39static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 39static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
40static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 40static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
41static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 41static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
42#ifdef CONFIG_PNP 42#ifdef CONFIG_PNP
43static bool isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; 43static int isapnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
44#endif 44#endif
45static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 45static long cs4232_pcm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
46static int cs4232_pcm_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */ 46static int cs4232_pcm_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 5,7,9,11,12,15 */
@@ -51,7 +51,7 @@ static int ics2115_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* 2,9,11,12,15 */
51static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */ 51static long fm_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* PnP setup */
52static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ 52static int dma1[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
53static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */ 53static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA; /* 0,1,3,5,6,7 */
54static bool use_cs4232_midi[SNDRV_CARDS]; 54static int use_cs4232_midi[SNDRV_CARDS];
55 55
56module_param_array(index, int, NULL, 0444); 56module_param_array(index, int, NULL, 0444);
57MODULE_PARM_DESC(index, "Index value for WaveFront soundcard."); 57MODULE_PARM_DESC(index, "Index value for WaveFront soundcard.");
@@ -98,7 +98,7 @@ static struct pnp_card_device_id snd_wavefront_pnpids[] = {
98 98
99MODULE_DEVICE_TABLE(pnp_card, snd_wavefront_pnpids); 99MODULE_DEVICE_TABLE(pnp_card, snd_wavefront_pnpids);
100 100
101static int 101static int __devinit
102snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *card, 102snd_wavefront_pnp (int dev, snd_wavefront_card_t *acard, struct pnp_card_link *card,
103 const struct pnp_card_device_id *id) 103 const struct pnp_card_device_id *id)
104{ 104{
@@ -231,9 +231,10 @@ static irqreturn_t snd_wavefront_ics2115_interrupt(int irq, void *dev_id)
231 return IRQ_HANDLED; 231 return IRQ_HANDLED;
232} 232}
233 233
234static struct snd_hwdep *snd_wavefront_new_synth(struct snd_card *card, 234static struct snd_hwdep * __devinit
235 int hw_dev, 235snd_wavefront_new_synth (struct snd_card *card,
236 snd_wavefront_card_t *acard) 236 int hw_dev,
237 snd_wavefront_card_t *acard)
237{ 238{
238 struct snd_hwdep *wavefront_synth; 239 struct snd_hwdep *wavefront_synth;
239 240
@@ -256,10 +257,11 @@ static struct snd_hwdep *snd_wavefront_new_synth(struct snd_card *card,
256 return wavefront_synth; 257 return wavefront_synth;
257} 258}
258 259
259static struct snd_hwdep *snd_wavefront_new_fx(struct snd_card *card, 260static struct snd_hwdep * __devinit
260 int hw_dev, 261snd_wavefront_new_fx (struct snd_card *card,
261 snd_wavefront_card_t *acard, 262 int hw_dev,
262 unsigned long port) 263 snd_wavefront_card_t *acard,
264 unsigned long port)
263 265
264{ 266{
265 struct snd_hwdep *fx_processor; 267 struct snd_hwdep *fx_processor;
@@ -282,11 +284,12 @@ static struct snd_hwdep *snd_wavefront_new_fx(struct snd_card *card,
282static snd_wavefront_mpu_id internal_id = internal_mpu; 284static snd_wavefront_mpu_id internal_id = internal_mpu;
283static snd_wavefront_mpu_id external_id = external_mpu; 285static snd_wavefront_mpu_id external_id = external_mpu;
284 286
285static struct snd_rawmidi *snd_wavefront_new_midi(struct snd_card *card, 287static struct snd_rawmidi *__devinit
286 int midi_dev, 288snd_wavefront_new_midi (struct snd_card *card,
287 snd_wavefront_card_t *acard, 289 int midi_dev,
288 unsigned long port, 290 snd_wavefront_card_t *acard,
289 snd_wavefront_mpu_id mpu) 291 unsigned long port,
292 snd_wavefront_mpu_id mpu)
290 293
291{ 294{
292 struct snd_rawmidi *rmidi; 295 struct snd_rawmidi *rmidi;
@@ -358,7 +361,7 @@ static int snd_wavefront_card_new(int dev, struct snd_card **cardp)
358 return 0; 361 return 0;
359} 362}
360 363
361static int 364static int __devinit
362snd_wavefront_probe (struct snd_card *card, int dev) 365snd_wavefront_probe (struct snd_card *card, int dev)
363{ 366{
364 snd_wavefront_card_t *acard = card->private_data; 367 snd_wavefront_card_t *acard = card->private_data;
@@ -415,7 +418,7 @@ snd_wavefront_probe (struct snd_card *card, int dev)
415 return -EBUSY; 418 return -EBUSY;
416 } 419 }
417 if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt, 420 if (request_irq(ics2115_irq[dev], snd_wavefront_ics2115_interrupt,
418 0, "ICS2115", acard)) { 421 IRQF_DISABLED, "ICS2115", acard)) {
419 snd_printk(KERN_ERR "unable to use ICS2115 IRQ %d\n", ics2115_irq[dev]); 422 snd_printk(KERN_ERR "unable to use ICS2115 IRQ %d\n", ics2115_irq[dev]);
420 return -EBUSY; 423 return -EBUSY;
421 } 424 }
@@ -446,7 +449,8 @@ snd_wavefront_probe (struct snd_card *card, int dev)
446 if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) { 449 if (cs4232_mpu_port[dev] > 0 && cs4232_mpu_port[dev] != SNDRV_AUTO_PORT) {
447 err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232, 450 err = snd_mpu401_uart_new(card, midi_dev, MPU401_HW_CS4232,
448 cs4232_mpu_port[dev], 0, 451 cs4232_mpu_port[dev], 0,
449 cs4232_mpu_irq[dev], NULL); 452 cs4232_mpu_irq[dev], IRQF_DISABLED,
453 NULL);
450 if (err < 0) { 454 if (err < 0) {
451 snd_printk (KERN_ERR "can't allocate CS4232 MPU-401 device\n"); 455 snd_printk (KERN_ERR "can't allocate CS4232 MPU-401 device\n");
452 return err; 456 return err;
@@ -538,8 +542,8 @@ snd_wavefront_probe (struct snd_card *card, int dev)
538 return snd_card_register(card); 542 return snd_card_register(card);
539} 543}
540 544
541static int snd_wavefront_isa_match(struct device *pdev, 545static int __devinit snd_wavefront_isa_match(struct device *pdev,
542 unsigned int dev) 546 unsigned int dev)
543{ 547{
544 if (!enable[dev]) 548 if (!enable[dev])
545 return 0; 549 return 0;
@@ -558,8 +562,8 @@ static int snd_wavefront_isa_match(struct device *pdev,
558 return 1; 562 return 1;
559} 563}
560 564
561static int snd_wavefront_isa_probe(struct device *pdev, 565static int __devinit snd_wavefront_isa_probe(struct device *pdev,
562 unsigned int dev) 566 unsigned int dev)
563{ 567{
564 struct snd_card *card; 568 struct snd_card *card;
565 int err; 569 int err;
@@ -577,8 +581,8 @@ static int snd_wavefront_isa_probe(struct device *pdev,
577 return 0; 581 return 0;
578} 582}
579 583
580static int snd_wavefront_isa_remove(struct device *devptr, 584static int __devexit snd_wavefront_isa_remove(struct device *devptr,
581 unsigned int dev) 585 unsigned int dev)
582{ 586{
583 snd_card_free(dev_get_drvdata(devptr)); 587 snd_card_free(dev_get_drvdata(devptr));
584 dev_set_drvdata(devptr, NULL); 588 dev_set_drvdata(devptr, NULL);
@@ -590,7 +594,7 @@ static int snd_wavefront_isa_remove(struct device *devptr,
590static struct isa_driver snd_wavefront_driver = { 594static struct isa_driver snd_wavefront_driver = {
591 .match = snd_wavefront_isa_match, 595 .match = snd_wavefront_isa_match,
592 .probe = snd_wavefront_isa_probe, 596 .probe = snd_wavefront_isa_probe,
593 .remove = snd_wavefront_isa_remove, 597 .remove = __devexit_p(snd_wavefront_isa_remove),
594 /* FIXME: suspend, resume */ 598 /* FIXME: suspend, resume */
595 .driver = { 599 .driver = {
596 .name = DEV_NAME 600 .name = DEV_NAME
@@ -599,8 +603,8 @@ static struct isa_driver snd_wavefront_driver = {
599 603
600 604
601#ifdef CONFIG_PNP 605#ifdef CONFIG_PNP
602static int snd_wavefront_pnp_detect(struct pnp_card_link *pcard, 606static int __devinit snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
603 const struct pnp_card_device_id *pid) 607 const struct pnp_card_device_id *pid)
604{ 608{
605 static int dev; 609 static int dev;
606 struct snd_card *card; 610 struct snd_card *card;
@@ -634,7 +638,7 @@ static int snd_wavefront_pnp_detect(struct pnp_card_link *pcard,
634 return 0; 638 return 0;
635} 639}
636 640
637static void snd_wavefront_pnp_remove(struct pnp_card_link *pcard) 641static void __devexit snd_wavefront_pnp_remove(struct pnp_card_link * pcard)
638{ 642{
639 snd_card_free(pnp_get_card_drvdata(pcard)); 643 snd_card_free(pnp_get_card_drvdata(pcard));
640 pnp_set_card_drvdata(pcard, NULL); 644 pnp_set_card_drvdata(pcard, NULL);
@@ -645,7 +649,7 @@ static struct pnp_card_driver wavefront_pnpc_driver = {
645 .name = "wavefront", 649 .name = "wavefront",
646 .id_table = snd_wavefront_pnpids, 650 .id_table = snd_wavefront_pnpids,
647 .probe = snd_wavefront_pnp_detect, 651 .probe = snd_wavefront_pnp_detect,
648 .remove = snd_wavefront_pnp_remove, 652 .remove = __devexit_p(snd_wavefront_pnp_remove),
649 /* FIXME: suspend,resume */ 653 /* FIXME: suspend,resume */
650}; 654};
651 655
diff --git a/sound/isa/wavefront/wavefront_fx.c b/sound/isa/wavefront/wavefront_fx.c
index b77883c7ee7..657e2d6c01a 100644
--- a/sound/isa/wavefront/wavefront_fx.c
+++ b/sound/isa/wavefront/wavefront_fx.c
@@ -21,7 +21,6 @@
21#include <linux/time.h> 21#include <linux/time.h>
22#include <linux/wait.h> 22#include <linux/wait.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/module.h>
25#include <linux/firmware.h> 24#include <linux/firmware.h>
26#include <sound/core.h> 25#include <sound/core.h>
27#include <sound/snd_wavefront.h> 26#include <sound/snd_wavefront.h>
@@ -240,7 +239,7 @@ snd_wavefront_fx_ioctl (struct snd_hwdep *sdev, struct file *file,
240 that outputs it. 239 that outputs it.
241*/ 240*/
242 241
243int 242int __devinit
244snd_wavefront_fx_start (snd_wavefront_t *dev) 243snd_wavefront_fx_start (snd_wavefront_t *dev)
245{ 244{
246 unsigned int i; 245 unsigned int i;
diff --git a/sound/isa/wavefront/wavefront_midi.c b/sound/isa/wavefront/wavefront_midi.c
index 7dc99168229..65329f3abc3 100644
--- a/sound/isa/wavefront/wavefront_midi.c
+++ b/sound/isa/wavefront/wavefront_midi.c
@@ -481,7 +481,7 @@ snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *card)
481 spin_unlock_irqrestore (&card->wavefront.midi.virtual, flags); 481 spin_unlock_irqrestore (&card->wavefront.midi.virtual, flags);
482} 482}
483 483
484int 484int __devinit
485snd_wavefront_midi_start (snd_wavefront_card_t *card) 485snd_wavefront_midi_start (snd_wavefront_card_t *card)
486 486
487{ 487{
diff --git a/sound/isa/wavefront/wavefront_synth.c b/sound/isa/wavefront/wavefront_synth.c
index a2f87f9488e..4fb7b19ff39 100644
--- a/sound/isa/wavefront/wavefront_synth.c
+++ b/sound/isa/wavefront/wavefront_synth.c
@@ -29,7 +29,6 @@
29#include <linux/firmware.h> 29#include <linux/firmware.h>
30#include <linux/moduleparam.h> 30#include <linux/moduleparam.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/module.h>
33#include <sound/core.h> 32#include <sound/core.h>
34#include <sound/snd_wavefront.h> 33#include <sound/snd_wavefront.h>
35#include <sound/initval.h> 34#include <sound/initval.h>
@@ -538,7 +537,7 @@ munge_int32 (unsigned int src,
538 /* Note: we leave the upper bits in place */ 537 /* Note: we leave the upper bits in place */
539 538
540 dst++; 539 dst++;
541 } 540 };
542 return dst; 541 return dst;
543}; 542};
544 543
@@ -1739,7 +1738,7 @@ snd_wavefront_internal_interrupt (snd_wavefront_card_t *card)
17397 Unused 17387 Unused
1740*/ 1739*/
1741 1740
1742static int 1741static int __devinit
1743snd_wavefront_interrupt_bits (int irq) 1742snd_wavefront_interrupt_bits (int irq)
1744 1743
1745{ 1744{
@@ -1767,7 +1766,7 @@ snd_wavefront_interrupt_bits (int irq)
1767 return bits; 1766 return bits;
1768} 1767}
1769 1768
1770static void 1769static void __devinit
1771wavefront_should_cause_interrupt (snd_wavefront_t *dev, 1770wavefront_should_cause_interrupt (snd_wavefront_t *dev,
1772 int val, int port, unsigned long timeout) 1771 int val, int port, unsigned long timeout)
1773 1772
@@ -1786,7 +1785,7 @@ wavefront_should_cause_interrupt (snd_wavefront_t *dev,
1786 } 1785 }
1787} 1786}
1788 1787
1789static int 1788static int __devinit
1790wavefront_reset_to_cleanliness (snd_wavefront_t *dev) 1789wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
1791 1790
1792{ 1791{
@@ -1937,7 +1936,7 @@ wavefront_reset_to_cleanliness (snd_wavefront_t *dev)
1937 return (1); 1936 return (1);
1938} 1937}
1939 1938
1940static int 1939static int __devinit
1941wavefront_download_firmware (snd_wavefront_t *dev, char *path) 1940wavefront_download_firmware (snd_wavefront_t *dev, char *path)
1942 1941
1943{ 1942{
@@ -2010,7 +2009,7 @@ wavefront_download_firmware (snd_wavefront_t *dev, char *path)
2010} 2009}
2011 2010
2012 2011
2013static int 2012static int __devinit
2014wavefront_do_reset (snd_wavefront_t *dev) 2013wavefront_do_reset (snd_wavefront_t *dev)
2015 2014
2016{ 2015{
@@ -2099,7 +2098,7 @@ wavefront_do_reset (snd_wavefront_t *dev)
2099 return 1; 2098 return 1;
2100} 2099}
2101 2100
2102int 2101int __devinit
2103snd_wavefront_start (snd_wavefront_t *dev) 2102snd_wavefront_start (snd_wavefront_t *dev)
2104 2103
2105{ 2104{
@@ -2141,7 +2140,7 @@ snd_wavefront_start (snd_wavefront_t *dev)
2141 return (0); 2140 return (0);
2142} 2141}
2143 2142
2144int 2143int __devinit
2145snd_wavefront_detect (snd_wavefront_card_t *card) 2144snd_wavefront_detect (snd_wavefront_card_t *card)
2146 2145
2147{ 2146{
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 360b08b03e1..2a42cc37795 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -30,7 +30,6 @@
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/ioport.h> 32#include <linux/ioport.h>
33#include <linux/module.h>
34#include <sound/core.h> 33#include <sound/core.h>
35#include <sound/wss.h> 34#include <sound/wss.h>
36#include <sound/pcm_params.h> 35#include <sound/pcm_params.h>
@@ -1456,6 +1455,7 @@ static struct snd_pcm_hardware snd_wss_playback =
1456{ 1455{
1457 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1456 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1458 SNDRV_PCM_INFO_MMAP_VALID | 1457 SNDRV_PCM_INFO_MMAP_VALID |
1458 SNDRV_PCM_INFO_RESUME |
1459 SNDRV_PCM_INFO_SYNC_START), 1459 SNDRV_PCM_INFO_SYNC_START),
1460 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM | 1460 .formats = (SNDRV_PCM_FMTBIT_MU_LAW | SNDRV_PCM_FMTBIT_A_LAW | SNDRV_PCM_FMTBIT_IMA_ADPCM |
1461 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE), 1461 SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE),
@@ -1656,10 +1656,6 @@ static void snd_wss_resume(struct snd_wss *chip)
1656 break; 1656 break;
1657 } 1657 }
1658 } 1658 }
1659 /* Yamaha needs this to resume properly */
1660 if (chip->hardware == WSS_HW_OPL3SA2)
1661 snd_wss_out(chip, CS4231_PLAYBK_FORMAT,
1662 chip->image[CS4231_PLAYBK_FORMAT]);
1663 spin_unlock_irqrestore(&chip->reg_lock, flags); 1659 spin_unlock_irqrestore(&chip->reg_lock, flags);
1664#if 1 1660#if 1
1665 snd_wss_mce_down(chip); 1661 snd_wss_mce_down(chip);
@@ -1837,7 +1833,7 @@ int snd_wss_create(struct snd_card *card,
1837 } 1833 }
1838 chip->cport = cport; 1834 chip->cport = cport;
1839 if (!(hwshare & WSS_HWSHARE_IRQ)) 1835 if (!(hwshare & WSS_HWSHARE_IRQ))
1840 if (request_irq(irq, snd_wss_interrupt, 0, 1836 if (request_irq(irq, snd_wss_interrupt, IRQF_DISABLED,
1841 "WSS", (void *) chip)) { 1837 "WSS", (void *) chip)) {
1842 snd_printk(KERN_ERR "wss: can't grab IRQ %d\n", irq); 1838 snd_printk(KERN_ERR "wss: can't grab IRQ %d\n", irq);
1843 snd_wss_free(chip); 1839 snd_wss_free(chip);