Changeset 34 for GPL/trunk/alsa-kernel/pci/cs46xx/cs46xx.c
- Timestamp:
- Dec 11, 2005, 5:57:39 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/pci/cs46xx/cs46xx.c
r33 r34 30 30 #include <linux/time.h> 31 31 #include <linux/init.h> 32 #include <linux/moduleparam.h> 32 33 #include <sound/core.h> 33 34 #include <sound/cs46xx.h> 34 #define SNDRV_GET_ID35 35 #include <sound/initval.h> 36 36 … … 38 38 MODULE_DESCRIPTION("Cirrus Logic Sound Fusion CS46XX"); 39 39 MODULE_LICENSE("GPL"); 40 MODULE_CLASSES("{sound}"); 41 MODULE_DEVICES("{{Cirrus Logic,Sound Fusion (CS4280)}," 40 MODULE_SUPPORTED_DEVICE("{{Cirrus Logic,Sound Fusion (CS4280)}," 42 41 "{Cirrus Logic,Sound Fusion (CS4610)}," 43 42 "{Cirrus Logic,Sound Fusion (CS4612)}," … … 50 49 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 51 50 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 52 #ifdef TARGET_OS253 51 static int external_amp[SNDRV_CARDS] = {0}; 54 52 static int thinkpad[SNDRV_CARDS] = {1,0,0,0,0,0,0,0}; 55 53 static int mmap_valid[SNDRV_CARDS] = {0}; 56 #else57 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 #endif61 54 62 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");55 //module_param_array(index, int, NULL, 0444); 63 56 MODULE_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); 66 58 MODULE_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); 69 60 MODULE_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); 72 62 MODULE_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); 75 64 MODULE_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); 78 66 MODULE_PARM_DESC(mmap_valid, "Support OSS mmap."); 79 MODULE_PARM_SYNTAX(mmap_valid, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);80 67 81 68 static struct pci_device_id snd_cs46xx_ids[] = { … … 92 79 { 93 80 static int dev; 94 s nd_card_t*card;95 cs46xx_t*chip;81 struct snd_card *card; 82 struct snd_cs46xx *chip; 96 83 int err; 97 84 … … 112 99 return err; 113 100 } 101 card->private_data = chip; 114 102 chip->accept_valid = mmap_valid[dev]; 115 103 if ((err = snd_cs46xx_pcm(chip, 0, NULL)) < 0) { … … 127 115 } 128 116 #endif 129 if ((err = snd_cs46xx_mixer(chip )) < 0) {117 if ((err = snd_cs46xx_mixer(chip, 2)) < 0) { 130 118 snd_card_free(card); 131 119 return err; … … 164 152 } 165 153 166 154 pci_set_drvdata(pci, card); 167 155 dev++; 168 156 return 0; 169 157 } 170 158 171 172 159 static void __devexit snd_card_cs46xx_remove(struct pci_dev *pci) 173 160 { 174 175 161 snd_card_free(pci_get_drvdata(pci)); 162 pci_set_drvdata(pci, NULL); 176 163 } 177 164 178 165 static 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 185 174 }; 186 175 187 176 static int __init alsa_card_cs46xx_init(void) 188 177 { 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); 198 179 } 199 180 … … 205 186 module_init(alsa_card_cs46xx_init) 206 187 module_exit(alsa_card_cs46xx_exit) 207 208 #ifndef MODULE209 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.