Changeset 224 for GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c
- Timestamp:
- Jul 26, 2007, 7:21:09 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c
r212 r224 24 24 25 25 #include <sound/driver.h> 26 #include <asm/io.h>27 26 #include <linux/delay.h> 28 27 #include <linux/init.h> 28 #include <linux/interrupt.h> 29 29 #include <linux/pci.h> 30 30 #include <linux/slab.h> 31 #include <linux/gameport.h> 32 31 33 #include <sound/core.h> 32 34 #include <sound/pcm.h> … … 37 39 #define SNDRV_GET_ID 38 40 #include <sound/initval.h> 39 #ifndef LINUX_2_2 40 #include <linux/gameport.h> 41 #endif 41 42 #include <asm/io.h> 42 43 43 44 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); … … 252 253 253 254 spinlock_t reg_lock; 254 snd_info_entry_t *proc_entry;255 255 256 256 unsigned int p_dma_size; … … 260 260 snd_kcontrol_t *master_volume; 261 261 262 #if ndef LINUX_2_2262 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) 263 263 struct gameport gameport; 264 264 #endif … … 272 272 MODULE_DEVICE_TABLE(pci, snd_sonic_ids); 273 273 274 #ifdef TARGET_OS2275 274 static ratden_t sonicvibes_adc_clock = { 276 4000 * 65536,277 48000UL * 65536,278 1,279 65536,275 .num_min = 4000 * 65536, 276 .num_max = 48000UL * 65536, 277 .num_step = 1, 278 .den = 65536, 280 279 }; 281 280 static snd_pcm_hw_constraint_ratdens_t snd_sonicvibes_hw_constraints_adc_clock = { 282 1,283 &sonicvibes_adc_clock,281 .nrats = 1, 282 .rats = &sonicvibes_adc_clock, 284 283 }; 285 #else286 static ratden_t sonicvibes_adc_clock = {287 num_min: 4000 * 65536,288 num_max: 48000UL * 65536,289 num_step: 1,290 den: 65536,291 };292 static snd_pcm_hw_constraint_ratdens_t snd_sonicvibes_hw_constraints_adc_clock = {293 nrats: 1,294 rats: &sonicvibes_adc_clock,295 };296 #endif297 284 298 285 /* … … 1137 1124 snd_card_t *card; 1138 1125 snd_kcontrol_t *kctl; 1139 int idx, err; 1126 unsigned int idx; 1127 int err; 1140 1128 1141 1129 snd_assert(sonic != NULL && sonic->card != NULL, return -EINVAL); … … 1192 1180 snd_info_entry_t *entry; 1193 1181 1194 if ((entry = snd_info_create_card_entry(sonic->card, "sonicvibes", sonic->card->proc_root)) != NULL) { 1195 entry->content = SNDRV_INFO_CONTENT_TEXT; 1196 entry->private_data = sonic; 1197 entry->mode = S_IFREG | S_IRUGO | S_IWUSR; 1198 entry->c.text.read_size = 256; 1199 entry->c.text.read = snd_sonicvibes_proc_read; 1200 if (snd_info_register(entry) < 0) { 1201 snd_info_free_entry(entry); 1202 entry = NULL; 1203 } 1204 } 1205 sonic->proc_entry = entry; 1206 } 1207 1208 static void snd_sonicvibes_proc_done(sonicvibes_t * sonic) 1209 { 1210 if (sonic->proc_entry) { 1211 snd_info_unregister(sonic->proc_entry); 1212 sonic->proc_entry = NULL; 1213 } 1182 if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry)) 1183 snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read); 1214 1184 } 1215 1185 … … 1223 1193 static int snd_sonicvibes_free(sonicvibes_t *sonic) 1224 1194 { 1225 #if ndef LINUX_2_21195 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) 1226 1196 if (sonic->gameport.io) 1227 1197 gameport_unregister_port(&sonic->gameport); 1228 1198 #endif 1229 snd_sonicvibes_proc_done(sonic);1230 1199 pci_write_config_dword(sonic->pci, 0x40, sonic->dmaa_port); 1231 1200 pci_write_config_dword(sonic->pci, 0x48, sonic->dmac_port); … … 1455 1424 snd_card_t *card = sonic->card; 1456 1425 snd_rawmidi_str_t *dir; 1457 int idx, err; 1426 unsigned int idx; 1427 int err; 1458 1428 1459 1429 mpu->private_data = sonic; … … 1527 1497 return err; 1528 1498 } 1529 #if ndef LINUX_2_21499 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) 1530 1500 sonic->gameport.io = sonic->game_port; 1531 1501 gameport_register_port(&sonic->gameport);
Note:
See TracChangeset
for help on using the changeset viewer.
