patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / sound / pci / rme9652 / rme9652.c
index fadb0db..e1abd98 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/info.h>
 #include <sound/asoundef.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/current.h>
@@ -42,17 +42,18 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;  /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;      /* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;     /* Enable this card */
 static int precise_ptr[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 0 }; /* Enable precise pointer */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for RME Digi9652 (Hammerfall) soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for RME Digi9652 (Hammerfall) soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable/disable specific RME96{52,36} soundcards.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
-MODULE_PARM(precise_ptr, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(precise_ptr, bool, boot_devs, 0444);
 MODULE_PARM_DESC(precise_ptr, "Enable precise pointer (doesn't work reliably).");
 MODULE_PARM_SYNTAX(precise_ptr, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
 MODULE_AUTHOR("Paul Davis <pbd@op.net>, Winfried Ritsch");
@@ -2010,7 +2011,7 @@ static char *rme9652_channel_buffer_location(rme9652_t *rme9652,
 }
 
 static int snd_rme9652_playback_copy(snd_pcm_substream_t *substream, int channel,
-                                    snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count)
+                                    snd_pcm_uframes_t pos, void __user *src, snd_pcm_uframes_t count)
 {
        rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
        char *channel_buf;
@@ -2027,7 +2028,7 @@ static int snd_rme9652_playback_copy(snd_pcm_substream_t *substream, int channel
 }
 
 static int snd_rme9652_capture_copy(snd_pcm_substream_t *substream, int channel,
-                                   snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count)
+                                   snd_pcm_uframes_t pos, void __user *dst, snd_pcm_uframes_t count)
 {
        rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
        char *channel_buf;
@@ -2262,10 +2263,10 @@ static int snd_rme9652_prepare(snd_pcm_substream_t *substream)
        rme9652_t *rme9652 = _snd_pcm_substream_chip(substream);
        int result = 0;
 
-       spin_lock_irq(&rme9652->lock);
+       spin_lock(&rme9652->lock);
        if (!rme9652->running)
                rme9652_reset_hw_pointer(rme9652);
-       spin_unlock_irq(&rme9652->lock);
+       spin_unlock(&rme9652->lock);
        return result;
 }
 
@@ -2748,14 +2749,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_hammerfall_init(void)
 {
-       if (pci_module_init(&driver) < 0) {
-#ifdef MODULE
-               printk(KERN_ERR "RME Digi9652/Digi9636: no cards found\n");
-#endif
-               return -ENODEV;
-       }
-
-       return 0;
+       return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_hammerfall_exit(void)
@@ -2765,24 +2759,3 @@ static void __exit alsa_card_hammerfall_exit(void)
 
 module_init(alsa_card_hammerfall_init)
 module_exit(alsa_card_hammerfall_exit)
-
-#ifndef MODULE
-
-/* format is: snd-rme9652=enable,index,id */
-
-static int __init alsa_card_rme9652_setup(char *str)
-{
-       static unsigned __initdata nr_dev = 0;
-
-       if (nr_dev >= SNDRV_CARDS)
-               return 0;
-       (void)(get_option(&str,&enable[nr_dev]) == 2 &&
-              get_option(&str,&index[nr_dev]) == 2 &&
-              get_id(&str,&id[nr_dev]) == 2);
-       nr_dev++;
-       return 1;
-}
-
-__setup("snd-rme9652=", alsa_card_rme9652_setup);
-
-#endif /* ifndef MODULE */