Ignore:
Timestamp:
Dec 11, 2005, 5:57:39 PM (20 years ago)
Author:
vladest
Message:

Latest update from ALSA. some intial > 15 interrupts support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/pci/cs46xx/cs46xx.c

    r33 r34  
    3030#include <linux/time.h>
    3131#include <linux/init.h>
     32#include <linux/moduleparam.h>
    3233#include <sound/core.h>
    3334#include <sound/cs46xx.h>
    34 #define SNDRV_GET_ID
    3535#include <sound/initval.h>
    3636
     
    3838MODULE_DESCRIPTION("Cirrus Logic Sound Fusion CS46XX");
    3939MODULE_LICENSE("GPL");
    40 MODULE_CLASSES("{sound}");
    41 MODULE_DEVICES("{{Cirrus Logic,Sound Fusion (CS4280)},"
     40MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,Sound Fusion (CS4280)},"
    4241                "{Cirrus Logic,Sound Fusion (CS4610)},"
    4342                "{Cirrus Logic,Sound Fusion (CS4612)},"
     
    5049static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;       /* ID for this card */
    5150static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;      /* Enable this card */
    52 #ifdef TARGET_OS2
    5351static int external_amp[SNDRV_CARDS] = {0};
    5452static int thinkpad[SNDRV_CARDS] = {1,0,0,0,0,0,0,0};
    5553static int mmap_valid[SNDRV_CARDS] = {0};
    56 #else
    57 static int external_amp[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
    58 static int thinkpad[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
    59 static int mmap_valid[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
    60 #endif
    6154
    62 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     55//module_param_array(index, int, NULL, 0444);
    6356MODULE_PARM_DESC(index, "Index value for the CS46xx soundcard.");
    64 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
    65 MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
     57//module_param_array(id, charp, NULL, 0444);
    6658MODULE_PARM_DESC(id, "ID string for the CS46xx soundcard.");
    67 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
    68 MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     59//module_param_array(enable, bool, NULL, 0444);
    6960MODULE_PARM_DESC(enable, "Enable CS46xx soundcard.");
    70 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
    71 MODULE_PARM(external_amp, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     61//module_param_array(external_amp, bool, NULL, 0444);
    7262MODULE_PARM_DESC(external_amp, "Force to enable external amplifer.");
    73 MODULE_PARM_SYNTAX(external_amp, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
    74 MODULE_PARM(thinkpad, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     63//module_param_array(thinkpad, bool, NULL, 0444);
    7564MODULE_PARM_DESC(thinkpad, "Force to enable Thinkpad's CLKRUN control.");
    76 MODULE_PARM_SYNTAX(thinkpad, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
    77 MODULE_PARM(mmap_valid, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     65//module_param_array(mmap_valid, bool, NULL, 0444);
    7866MODULE_PARM_DESC(mmap_valid, "Support OSS mmap.");
    79 MODULE_PARM_SYNTAX(mmap_valid, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
    8067
    8168static struct pci_device_id snd_cs46xx_ids[] = {
     
    9279{
    9380        static int dev;
    94         snd_card_t *card;
    95         cs46xx_t *chip;
     81        struct snd_card *card;
     82        struct snd_cs46xx *chip;
    9683        int err;
    9784
     
    11299                return err;
    113100        }
     101        card->private_data = chip;
    114102        chip->accept_valid = mmap_valid[dev];
    115103        if ((err = snd_cs46xx_pcm(chip, 0, NULL)) < 0) {
     
    127115        }
    128116#endif
    129         if ((err = snd_cs46xx_mixer(chip)) < 0) {
     117        if ((err = snd_cs46xx_mixer(chip, 2)) < 0) {
    130118                snd_card_free(card);
    131119                return err;
     
    164152        }
    165153
    166         pci_set_drvdata(pci, card);
     154        pci_set_drvdata(pci, card);
    167155        dev++;
    168156        return 0;
    169157}
    170158
    171 
    172159static void __devexit snd_card_cs46xx_remove(struct pci_dev *pci)
    173160{
    174     snd_card_free(pci_get_drvdata(pci));
    175     pci_set_drvdata(pci, NULL);
     161        snd_card_free(pci_get_drvdata(pci));
     162        pci_set_drvdata(pci, NULL);
    176163}
    177164
    178165static struct pci_driver driver = {
    179         0, 0, 0,
    180         "Sound Fusion CS46xx",
    181         snd_cs46xx_ids,
    182         snd_card_cs46xx_probe,
    183         snd_card_cs46xx_remove,
    184         SND_PCI_PM_CALLBACKS
     166        .name = "Sound Fusion CS46xx",
     167        .id_table = snd_cs46xx_ids,
     168        .probe = snd_card_cs46xx_probe,
     169        .remove = snd_card_cs46xx_remove,
     170#ifdef CONFIG_PM
     171        .suspend = snd_cs46xx_suspend,
     172        .resume = snd_cs46xx_resume,
     173#endif
    185174};
    186  
     175
    187176static int __init alsa_card_cs46xx_init(void)
    188177{
    189         int err;
    190 
    191         if ((err = pci_module_init(&driver)) < 0) {
    192 #ifdef MODULE
    193 //              printk(KERN_ERR "Sound Fusion CS46xx soundcard not found or device busy\n");
    194 #endif
    195                 return err;
    196         }
    197         return 0;
     178        return pci_register_driver(&driver);
    198179}
    199180
     
    205186module_init(alsa_card_cs46xx_init)
    206187module_exit(alsa_card_cs46xx_exit)
    207 
    208 #ifndef MODULE
    209 
    210 /* format is: snd-cs46xx=snd_enable,snd_index,snd_id */
    211 
    212 static int __init alsa_card_cs46xx_setup(char *str)
    213 {
    214         static unsigned __initdata nr_dev = 0;
    215 
    216         if (nr_dev >= SNDRV_CARDS)
    217                 return 0;
    218         (void)(get_option(&str,&enable[nr_dev]) == 2 &&
    219                get_option(&str,&index[nr_dev]) == 2 &&
    220                get_id(&str,&id[nr_dev]) == 2);
    221         nr_dev++;
    222         return 1;
    223 }
    224 
    225 __setup("snd-cs46xx=", alsa_card_cs46xx_setup);
    226 
    227 #endif /* ifndef MODULE */
Note: See TracChangeset for help on using the changeset viewer.