27 #include <linux/module.h>
64 static int pnp_registered;
65 static unsigned int snd_mpu401_devices;
67 static int snd_mpu401_create(
int dev,
struct snd_card **rcard)
105 int dev = devptr->
id;
117 err = snd_mpu401_create(dev, &card);
125 platform_set_drvdata(devptr, card);
132 platform_set_drvdata(devptr,
NULL);
136 #define SND_MPU401_DRIVER "snd_mpu401"
139 .probe = snd_mpu401_probe,
162 if (!pnp_port_valid(device, 0) ||
167 if (pnp_port_len(device, 0) < IO_EXTENT) {
169 (
unsigned long long)pnp_port_len(device, 0),
173 port[
dev] = pnp_port_start(device, 0);
175 if (!pnp_irq_valid(device, 0) ||
193 if (!enable[dev] || !pnp[dev])
195 err = snd_mpu401_pnp(dev, pnp_dev,
id);
198 err = snd_mpu401_create(dev, &card);
206 pnp_set_drvdata(pnp_dev, card);
207 snd_mpu401_devices++;
214 static void __devexit snd_mpu401_pnp_remove(
struct pnp_dev *dev)
222 static struct pnp_driver snd_mpu401_pnp_driver = {
224 .id_table = snd_mpu401_pnpids,
225 .probe = snd_mpu401_pnp_probe,
229 static struct pnp_driver snd_mpu401_pnp_driver;
232 static void snd_mpu401_unregister_all(
void)
243 static int __init alsa_card_mpu401_init(
void)
262 if (!platform_get_drvdata(device)) {
266 platform_devices[
i] = device;
267 snd_mpu401_devices++;
273 if (!snd_mpu401_devices) {
277 snd_mpu401_unregister_all();
283 static void __exit alsa_card_mpu401_exit(
void)
285 snd_mpu401_unregister_all();