Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[sfrench/cifs-2.6.git] / sound / drivers / mpu401 / mpu401.c
index d3cbbb04758231940d21f2d43a2caa7bddf164cd..67c6e9745418b53748a9d67c21efdf7f603c54cf 100644 (file)
@@ -42,6 +42,7 @@ static int pnp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
 #endif
 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;    /* MPU-401 port number */
 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;       /* MPU-401 IRQ */
+static int uart_enter[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1};
 
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for MPU-401 device.");
@@ -57,6 +58,8 @@ module_param_array(port, long, NULL, 0444);
 MODULE_PARM_DESC(port, "Port # for MPU-401 device.");
 module_param_array(irq, int, NULL, 0444);
 MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device.");
+module_param_array(uart_enter, bool, NULL, 0444);
+MODULE_PARM_DESC(uart_enter, "Issue UART_ENTER command at open.");
 
 static struct platform_device *platform_devices[SNDRV_CARDS];
 static int pnp_registered;
@@ -80,10 +83,11 @@ static int snd_mpu401_create(int dev, struct snd_card **rcard)
                strcat(card->longname, "polled");
        }
 
-       if ((err = snd_mpu401_uart_new(card, 0,
-                                      MPU401_HW_MPU401,
-                                      port[dev], 0,
-                                      irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL)) < 0) {
+       err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port[dev],
+                                 uart_enter[dev] ? 0 : MPU401_INFO_UART_ONLY,
+                                 irq[dev], irq[dev] >= 0 ? IRQF_DISABLED : 0,
+                                 NULL);
+       if (err < 0) {
                printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]);
                goto _err;
        }
@@ -160,8 +164,9 @@ static int __devinit snd_mpu401_pnp(int dev, struct pnp_dev *device,
                return -ENODEV;
        }
        if (pnp_port_len(device, 0) < IO_EXTENT) {
-               snd_printk(KERN_ERR "PnP port length is %ld, expected %d\n",
-                          pnp_port_len(device, 0), IO_EXTENT);
+               snd_printk(KERN_ERR "PnP port length is %llu, expected %d\n",
+                          (unsigned long long)pnp_port_len(device, 0),
+                          IO_EXTENT);
                return -ENODEV;
        }
        port[dev] = pnp_port_start(device, 0);
@@ -210,7 +215,7 @@ static void __devexit snd_mpu401_pnp_remove(struct pnp_dev *dev)
        struct snd_card *card = (struct snd_card *) pnp_get_drvdata(dev);
 
        snd_card_disconnect(card);
-       snd_card_free_in_thread(card);
+       snd_card_free_when_closed(card);
 }
 
 static struct pnp_driver snd_mpu401_pnp_driver = {
@@ -223,7 +228,7 @@ static struct pnp_driver snd_mpu401_pnp_driver = {
 static struct pnp_driver snd_mpu401_pnp_driver;
 #endif
 
-static void __init_or_module snd_mpu401_unregister_all(void)
+static void snd_mpu401_unregister_all(void)
 {
        int i;