Changeset 277
- Timestamp:
- Dec 14, 2007, 8:27:04 AM (18 years ago)
- Location:
- GPL/branches/alsa-resync1/alsa-kernel
- Files:
-
- 47 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/core/control.c
r262 r277 43 43 44 44 #define snd_kctl_ioctl(n) list_entry(n, snd_kctl_ioctl_t, list) 45 46 /* find id without lock */ 47 static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id); 45 48 46 49 static DECLARE_RWSEM(snd_ioctl_rwsem); -
GPL/branches/alsa-resync1/alsa-kernel/core/init.c
r250 r277 730 730 #endif 731 731 set_current_state(TASK_UNINTERRUPTIBLE); 732 set_current_state(TASK_UNINTERRUPTIBLE); 732 733 snd_power_unlock(card); 733 734 schedule_timeout(30 * HZ); -
GPL/branches/alsa-resync1/alsa-kernel/core/sound.c
r262 r277 88 88 int locked; 89 89 90 if (! current->fs->root) 91 return; 90 92 read_lock(&snd_card_rwlock); 91 93 locked = snd_cards_lock & (1 << card); … … 102 104 char *str; 103 105 106 if (! current->fs->root) 107 return; 104 108 switch (minor) { 105 109 case SNDRV_MINOR_SEQUENCER: str = "snd-seq"; break; -
GPL/branches/alsa-resync1/alsa-kernel/core/timer.c
r222 r277 149 149 static void snd_timer_request(snd_timer_id_t *tid) 150 150 { 151 if (! current->fs->root) 152 return; 151 153 switch (tid->dev_class) { 152 154 case SNDRV_TIMER_CLASS_GLOBAL: … … 486 488 } 487 489 timer = timeri->timer; 488 if (!timer)490 if (!timer) 489 491 return -EINVAL; 490 492 spin_lock_irqsave(&timer->lock, flags); … … 1777 1779 1778 1780 remove_wait_queue(&tu->qchange_sleep, &wait); 1779 set_current_state(TASK_RUNNING);1780 1781 1781 1782 if (signal_pending(current)) { -
GPL/branches/alsa-resync1/alsa-kernel/drivers/dummy.c
r262 r277 44 44 #define MAX_MIDI_DEVICES 2 45 45 46 #if 0 /* emu10k1 emulation */ 47 #define MAX_BUFFER_SIZE (128 * 1024) 48 static int emu10k1_playback_constraints(snd_pcm_runtime_t *runtime) 49 { 50 int err; 51 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 52 return err; 53 if ((err = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 256, UINT_MAX)) < 0) 54 return err; 55 return 0; 56 } 57 #define add_playback_constraints emu10k1_playback_constraints 58 #endif 46 59 47 60 #if 0 /* RME9652 emulation */ … … 105 118 #ifndef USE_PERIODS_MAX 106 119 #define USE_PERIODS_MAX 1024 120 #endif 121 #ifndef add_playback_constraints 122 #define add_playback_constraints(x) 0 123 #endif 124 #ifndef add_capture_constraints 125 #define add_capture_constraints(x) 0 107 126 #endif 108 127 … … 334 353 snd_pcm_runtime_t *runtime = substream->runtime; 335 354 snd_card_dummy_pcm_t *dpcm; 355 int err; 336 356 337 357 dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); … … 356 376 if (substream->pcm->device & 2) 357 377 runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID); 378 if ((err = add_playback_constraints(runtime)) < 0) { 379 snd_magic_kfree(dpcm); 380 return err; 381 } 382 358 383 return 0; 359 384 } … … 363 388 snd_pcm_runtime_t *runtime = substream->runtime; 364 389 snd_card_dummy_pcm_t *dpcm; 390 int err; 365 391 366 392 dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL); … … 386 412 if (substream->pcm->device & 2) 387 413 runtime->hw.info &= ~(SNDRV_PCM_INFO_MMAP|SNDRV_PCM_INFO_MMAP_VALID); 414 if ((err = add_capture_constraints(runtime)) < 0) { 415 snd_magic_kfree(dpcm); 416 return err; 417 } 418 388 419 return 0; 389 420 } -
GPL/branches/alsa-resync1/alsa-kernel/drivers/mtpav.c
r246 r277 815 815 get_option(&str,&index) == 2 && 816 816 get_id(&str,&id) == 2 && 817 get_option (&str,(int *)&port) == 2 &&817 get_option_long(&str,&port) == 2 && 818 818 get_option(&str,&irq) == 2 && 819 819 get_option(&str,&hwports) == 2); -
GPL/branches/alsa-resync1/alsa-kernel/drivers/opl3/opl3_synth.c
r32 r277 21 21 22 22 #include <sound/opl3.h> 23 #define __SND_OSS_COMPAT__24 23 #include <sound/asound_fm.h> 25 24 -
GPL/branches/alsa-resync1/alsa-kernel/drivers/serial-u16550.c
r224 r277 1000 1000 get_option(&str,&index[nr_dev]) == 2 && 1001 1001 get_id(&str,&id[nr_dev]) == 2 && 1002 get_option (&str,(int *)&port[nr_dev]) == 2 &&1002 get_option_long(&str,&port[nr_dev]) == 2 && 1003 1003 get_option(&str,&irq[nr_dev]) == 2 && 1004 1004 get_option(&str,&speed[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/initval.h
r250 r277 198 198 #endif 199 199 200 /* simple wrapper for long variable. 201 * the value more than 32bit won't work! 202 */ 203 inline static int get_option_long(char **str, long *valp) 204 { 205 int val, ret; 206 ret = get_option(str, &val); 207 if (ret) 208 *valp = val; 209 return ret; 210 } 211 200 212 #endif /* __SOUND_INITVAL_H */ -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/pcm_oss.h
r262 r277 51 51 unsigned int subdivision; /* requested subdivision */ 52 52 size_t period_bytes; /* requested period size */ 53 size_t period_ptr; /* actual write pointer to period */ 53 54 unsigned int periods; 54 55 size_t buffer_bytes; /* requested buffer size */ -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/sscape_ioctl.h
r262 r277 9 9 }; 10 10 11 #define SSCAPE_MICROCODE_SIZE 65536 12 11 13 struct sscape_microcode 12 14 { 13 unsigned char *code; /* 65536 chars */15 unsigned char *code; 14 16 }; 15 17 -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/version.h
r262 r277 1 /* include/version.h. Generated automaticallyby configure. */2 #define CONFIG_SND_VERSION "0.9. 7"1 /* include/version.h. Generated by configure. */ 2 #define CONFIG_SND_VERSION "0.9.8" 3 3 #define CONFIG_SND_DATE "" -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/ymfpci.h
r250 r277 26 26 #include "rawmidi.h" 27 27 #include "ac97_codec.h" 28 #i fndef TARGET_OS2 //TODO: Implement linux/gameport.h28 #include "timer.h" 29 29 #include <linux/gameport.h> 30 #endif /* !TARGET_OS2 */31 30 32 31 #ifndef PCI_VENDOR_ID_YAMAHA … … 315 314 unsigned short old_legacy_ctrl; 316 315 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) 317 unsigned int joystick_port;318 struct semaphore joystick_mutex;319 316 struct resource *joystick_res; 320 317 struct gameport gameport; … … 402 399 int snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch); 403 400 int snd_ymfpci_timer(ymfpci_t *chip, int device); 404 #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)405 int snd_ymfpci_joystick(ymfpci_t *chip);406 #endif407 401 408 402 int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpci_voice_t **rvoice); 409 403 int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice); 410 404 405 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) 406 #define SUPPORT_JOYSTICK 407 #endif 408 411 409 #endif /* __SOUND_YMFPCI_H */ -
GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a.c
r262 r277 339 339 get_option(&str,&index[nr_dev]) == 2 && 340 340 get_id(&str,&id[nr_dev]) == 2 && 341 get_option (&str,(int *)&port[nr_dev]) == 2 &&342 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&343 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&341 get_option_long(&str,&port[nr_dev]) == 2 && 342 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 343 get_option_long(&str,&fm_port[nr_dev]) == 2 && 344 344 get_option(&str,&irq[nr_dev]) == 2 && 345 345 get_option(&str,&mpu_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/ad1848/ad1848.c
r250 r277 175 175 get_option(&str,&index[nr_dev]) == 2 && 176 176 get_id(&str,&id[nr_dev]) == 2 && 177 get_option (&str,(int *)&port[nr_dev]) == 2 &&177 get_option_long(&str,&port[nr_dev]) == 2 && 178 178 get_option(&str,&irq[nr_dev]) == 2 && 179 179 get_option(&str,&dma1[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/als100.c
r262 r277 360 360 get_option(&str,&index[nr_dev]) == 2 && 361 361 get_id(&str,&id[nr_dev]) == 2 && 362 get_option (&str,(int *)&port[nr_dev]) == 2 &&363 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&364 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&362 get_option_long(&str,&port[nr_dev]) == 2 && 363 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 364 get_option_long(&str,&fm_port[nr_dev]) == 2 && 365 365 get_option(&str,&irq[nr_dev]) == 2 && 366 366 get_option(&str,&mpu_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/azt2320.c
r262 r277 394 394 get_option(&str,&index[nr_dev]) == 2 && 395 395 get_id(&str,&id[nr_dev]) == 2 && 396 get_option (&str,(int *)&port[nr_dev]) == 2 &&397 get_option (&str,(int *)&wss_port[nr_dev]) == 2 &&398 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&396 get_option_long(&str,&port[nr_dev]) == 2 && 397 get_option_long(&str,&wss_port[nr_dev]) == 2 && 398 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 399 399 get_option(&str,&irq[nr_dev]) == 2 && 400 400 get_option(&str,&mpu_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/cmi8330.c
r262 r277 663 663 get_id(&str,&id[nr_dev]) == 2 && 664 664 get_option(&str,&pnp) == 2 && 665 get_option (&str,(int *)&sbport[nr_dev]) == 2 &&665 get_option_long(&str,&sbport[nr_dev]) == 2 && 666 666 get_option(&str,&sbirq[nr_dev]) == 2 && 667 667 get_option(&str,&sbdma8[nr_dev]) == 2 && 668 668 get_option(&str,&sbdma16[nr_dev]) == 2 && 669 get_option (&str,(int *)&wssport[nr_dev]) == 2 &&669 get_option_long(&str,&wssport[nr_dev]) == 2 && 670 670 get_option(&str,&wssirq[nr_dev]) == 2 && 671 671 get_option(&str,&wssdma[nr_dev]) == 2); -
GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231.c
r212 r277 195 195 get_id(&str,&id[nr_dev]) == 2 && 196 196 get_option(&str,&pnp) == 2 && 197 get_option (&str,(int *)&port[nr_dev]) == 2 &&198 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&197 get_option_long(&str,&port[nr_dev]) == 2 && 198 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 199 199 get_option(&str,&irq[nr_dev]) == 2 && 200 200 get_option(&str,&mpu_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4236.c
r262 r277 666 666 get_id(&str,&id[nr_dev]) == 2 && 667 667 get_option(&str,&pnp) == 2 && 668 get_option (&str,(int *)&port[nr_dev]) == 2 &&669 get_option (&str,(int *)&cport[nr_dev]) == 2 &&670 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&671 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&672 get_option (&str,(int *)&sb_port[nr_dev]) == 2 &&668 get_option_long(&str,&port[nr_dev]) == 2 && 669 get_option_long(&str,&cport[nr_dev]) == 2 && 670 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 671 get_option_long(&str,&fm_port[nr_dev]) == 2 && 672 get_option_long(&str,&sb_port[nr_dev]) == 2 && 673 673 get_option(&str,&irq[nr_dev]) == 2 && 674 674 get_option(&str,&mpu_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/dt019x.c
r262 r277 348 348 get_option(&str,&index[nr_dev]) == 2 && 349 349 get_id(&str,&id[nr_dev]) == 2 && 350 get_option (&str,(int *)&port[nr_dev]) == 2 &&351 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&352 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&350 get_option_long(&str,&port[nr_dev]) == 2 && 351 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 352 get_option_long(&str,&fm_port[nr_dev]) == 2 && 353 353 get_option(&str,&irq[nr_dev]) == 2 && 354 354 get_option(&str,&mpu_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688.c
r212 r277 231 231 get_option(&str,&index[nr_dev]) == 2 && 232 232 get_id(&str,&id[nr_dev]) == 2 && 233 get_option (&str,(int *)&port[nr_dev]) == 2 &&234 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&233 get_option_long(&str,&port[nr_dev]) == 2 && 234 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 235 235 get_option(&str,&irq[nr_dev]) == 2 && 236 236 get_option(&str,&mpu_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c
r262 r277 2294 2294 get_id(&str,&id[nr_dev]) == 2 && 2295 2295 get_option(&str,&pnp) == 2 && 2296 get_option (&str,(int *)&port[nr_dev]) == 2 &&2297 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&2298 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&2296 get_option_long(&str,&port[nr_dev]) == 2 && 2297 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 2298 get_option_long(&str,&fm_port[nr_dev]) == 2 && 2299 2299 get_option(&str,&irq[nr_dev]) == 2 && 2300 2300 get_option(&str,&dma1[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusclassic.c
r262 r277 292 292 get_option(&str,&index[nr_dev]) == 2 && 293 293 get_id(&str,&id[nr_dev]) == 2 && 294 get_option (&str,(int *)&port[nr_dev]) == 2 &&294 get_option_long(&str,&port[nr_dev]) == 2 && 295 295 get_option(&str,&irq[nr_dev]) == 2 && 296 296 get_option(&str,&dma1[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusextreme.c
r262 r277 430 430 get_option(&str,&index[nr_dev]) == 2 && 431 431 get_id(&str,&id[nr_dev]) == 2 && 432 get_option (&str,(int *)&port[nr_dev]) == 2 &&433 get_option (&str,(int *)&gf1_port[nr_dev]) == 2 &&434 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&432 get_option_long(&str,&port[nr_dev]) == 2 && 433 get_option_long(&str,&gf1_port[nr_dev]) == 2 && 434 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 435 435 get_option(&str,&irq[nr_dev]) == 2 && 436 436 get_option(&str,&gf1_irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusmax.c
r262 r277 432 432 get_option(&str,&index[nr_dev]) == 2 && 433 433 get_id(&str,&id[nr_dev]) == 2 && 434 get_option (&str,(int *)&port[nr_dev]) == 2 &&434 get_option_long(&str,&port[nr_dev]) == 2 && 435 435 get_option(&str,&irq[nr_dev]) == 2 && 436 436 get_option(&str,&dma1[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/interwave.c
r262 r277 1007 1007 get_id(&str,&id[nr_dev]) == 2 && 1008 1008 get_option(&str,&pnp) == 2 && 1009 get_option (&str,(int *)&port[nr_dev]) == 2 &&1010 #ifdef SNDRV_STB 1011 get_option (&str,(int *)&port_tc[nr_dev]) == 2 &&1009 get_option_long(&str,&port[nr_dev]) == 2 && 1010 #ifdef SNDRV_STB 1011 get_option_long(&str,&port_tc[nr_dev]) == 2 && 1012 1012 #endif 1013 1013 get_option(&str,&irq[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/opl3sa2.c
r262 r277 904 904 get_id(&str,&id[nr_dev]) == 2 && 905 905 get_option(&str,&pnp) == 2 && 906 get_option (&str,(int *)&port[nr_dev]) == 2 &&907 get_option (&str,(int *)&sb_port[nr_dev]) == 2 &&908 get_option (&str,(int *)&wss_port[nr_dev]) == 2 &&909 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&910 get_option (&str,(int *)&midi_port[nr_dev]) == 2 &&906 get_option_long(&str,&port[nr_dev]) == 2 && 907 get_option_long(&str,&sb_port[nr_dev]) == 2 && 908 get_option_long(&str,&wss_port[nr_dev]) == 2 && 909 get_option_long(&str,&fm_port[nr_dev]) == 2 && 910 get_option_long(&str,&midi_port[nr_dev]) == 2 && 911 911 get_option(&str,&irq[nr_dev]) == 2 && 912 912 get_option(&str,&dma1[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/opti9xx/opti92x-ad1848.c
r250 r277 2241 2241 get_id(&str,&id) == 2 && 2242 2242 get_option(&str,&pnp) == 2 && 2243 get_option (&str,(int *)&port) == 2 &&2244 get_option (&str,(int *)&mpu_port) == 2 &&2245 get_option (&str,(int *)&fm_port) == 2 &&2243 get_option_long(&str,&port) == 2 && 2244 get_option_long(&str,&mpu_port) == 2 && 2245 get_option_long(&str,&fm_port) == 2 && 2246 2246 get_option(&str,&irq) == 2 && 2247 2247 get_option(&str,&mpu_irq) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000.c
r262 r277 1045 1045 __error: 1046 1046 for (i = 0; i < EMU8000_NUM_CONTROLS; i++) { 1047 down_write(&card->controls_rwsem); 1047 1048 if (emu->controls[i]) 1048 1049 snd_ctl_remove(card, emu->controls[i]); 1050 up_write(&card->controls_rwsem); 1049 1051 } 1050 1052 return err; -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_patch.c
r210 r277 234 234 * so give controls back to kernel if needed. 235 235 */ 236 if (need_resched()) { 237 if (current->state != TASK_RUNNING) 238 set_current_state(TASK_RUNNING); 239 schedule(); 240 } 236 cond_resched(); 241 237 242 238 if (i == sp->v.loopend && -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_pcm.c
r224 r277 425 425 #define CHECK_SCHEDULER() \ 426 426 do { \ 427 if (need_resched()) {\ 428 if (current->state != TASK_RUNNING)\ 429 set_current_state(TASK_RUNNING);\ 430 schedule();\ 431 if (signal_pending(current))\ 432 return -EAGAIN;\ 433 }\ 427 cond_resched();\ 428 if (signal_pending(current))\ 429 return -EAGAIN;\ 434 430 } while (0) 435 431 -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/es968.c
r262 r277 258 258 get_option(&str,&index[nr_dev]) == 2 && 259 259 get_id(&str,&id[nr_dev]) == 2 && 260 get_option (&str,(int *)&port[nr_dev]) == 2 &&260 get_option_long(&str,&port[nr_dev]) == 2 && 261 261 get_option(&str,&irq[nr_dev]) == 2 && 262 262 get_option(&str,&dma8[nr_dev]) == 2); -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16.c
r262 r277 715 715 get_id(&str,&id[nr_dev]) == 2 && 716 716 get_option(&str,&pnp) == 2 && 717 get_option (&str,(int *)&port[nr_dev]) == 2 &&718 get_option (&str,(int *)&mpu_port[nr_dev]) == 2 &&719 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&717 get_option_long(&str,&port[nr_dev]) == 2 && 718 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 719 get_option_long(&str,&fm_port[nr_dev]) == 2 && 720 720 get_option(&str,&irq[nr_dev]) == 2 && 721 721 get_option(&str,&dma8[nr_dev]) == 2 && … … 728 728 #ifdef SNDRV_SBAWE_EMU8000 729 729 && 730 get_option (&str,(int *)&awe_port[nr_dev]) == 2 &&730 get_option_long(&str,&awe_port[nr_dev]) == 2 && 731 731 get_option(&str,&seq_ports[nr_dev]) == 2 732 732 #endif -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_csp.c
r250 r277 1056 1056 snd_assert(p != NULL, return); 1057 1057 1058 card = p->chip->card; 1059 1058 card = p->chip->card; 1059 1060 down_write(&card->controls_rwsem); 1060 1061 if (p->qsound_switch) 1061 1062 snd_ctl_remove(card, p->qsound_switch); 1062 1063 if (p->qsound_space) 1063 1064 snd_ctl_remove(card, p->qsound_space); 1065 up_write(&card->controls_rwsem); 1064 1066 1065 1067 /* cancel pending transfer of QSound parameters */ -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8.c
r246 r277 243 243 get_option(&str,&index[nr_dev]) == 2 && 244 244 get_id(&str,&id[nr_dev]) == 2 && 245 get_option (&str,(int *)&port[nr_dev]) == 2 &&245 get_option_long(&str,&port[nr_dev]) == 2 && 246 246 get_option(&str,&irq[nr_dev]) == 2 && 247 247 get_option(&str,&dma8[nr_dev]) == 2); -
GPL/branches/alsa-resync1/alsa-kernel/isa/sgalaxy.c
r246 r277 342 342 get_option(&str,&index[nr_dev]) == 2 && 343 343 get_id(&str,&id[nr_dev]) == 2 && 344 get_option (&str,(int *)&sbport[nr_dev]) == 2 &&345 get_option (&str,(int *)&wssport[nr_dev]) == 2 &&346 get_option(&str, (int *)&irq[nr_dev]) == 2 &&347 get_option(&str, (int *)&dma1[nr_dev]) == 2);344 get_option_long(&str,&sbport[nr_dev]) == 2 && 345 get_option_long(&str,&wssport[nr_dev]) == 2 && 346 get_option(&str,&irq[nr_dev]) == 2 && 347 get_option(&str,&dma1[nr_dev]) == 2); 348 348 nr_dev++; 349 349 return 1; -
GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront.c
r262 r277 757 757 get_id(&str,&id[nr_dev]) == 2 && 758 758 get_option(&str,&isapnp[nr_dev]) == 2 && 759 get_option (&str,(int *)&cs4232_pcm_port[nr_dev]) == 2 &&759 get_option_long(&str,&cs4232_pcm_port[nr_dev]) == 2 && 760 760 get_option(&str,&cs4232_pcm_irq[nr_dev]) == 2 && 761 get_option (&str,(int *)&cs4232_mpu_port[nr_dev]) == 2 &&761 get_option_long(&str,&cs4232_mpu_port[nr_dev]) == 2 && 762 762 get_option(&str,&cs4232_mpu_irq[nr_dev]) == 2 && 763 get_option (&str,(int *)&ics2115_port[nr_dev]) == 2 &&763 get_option_long(&str,&ics2115_port[nr_dev]) == 2 && 764 764 get_option(&str,&ics2115_irq[nr_dev]) == 2 && 765 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&765 get_option_long(&str,&fm_port[nr_dev]) == 2 && 766 766 get_option(&str,&dma1[nr_dev]) == 2 && 767 767 get_option(&str,&dma2[nr_dev]) == 2 && -
GPL/branches/alsa-resync1/alsa-kernel/pci/als4000.c
r210 r277 64 64 #include <linux/pci.h> 65 65 #include <linux/slab.h> 66 #include <linux/gameport.h> 66 67 #include <sound/core.h> 67 68 #include <sound/pcm.h> … … 79 80 MODULE_DEVICES("{{Avance Logic,ALS4000}}"); 80 81 82 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) 83 #define SUPPORT_JOYSTICK 1 84 #endif 85 81 86 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 82 87 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 83 88 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 84 static int joystick_port[SNDRV_CARDS] = 85 #ifdef CONFIG_ISA 86 {0x200}; /* enable as default */ 87 #else 88 {0}; /* disabled */ 89 #ifdef SUPPORT_JOYSTICK 90 static int joystick_port[SNDRV_CARDS]; 89 91 #endif 90 92 … … 536 538 /******************************************************************/ 537 539 538 static void __devinitsnd_als4000_set_addr(unsigned long gcr,540 static void snd_als4000_set_addr(unsigned long gcr, 539 541 unsigned int sb, 540 542 unsigned int mpu, … … 610 612 unsigned short word; 611 613 int err; 614 int joystick = 0; 612 615 613 616 if (dev >= SNDRV_CARDS) … … 637 640 pci_set_master(pci); 638 641 639 /* disable all legacy ISA stuff except for joystick */640 snd_als4000_set_addr(gcr, 0, 0, 0, joystick_port[dev]);641 642 642 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 643 643 sizeof( snd_card_als4000_t ) ); … … 651 651 acard->gcr = gcr; 652 652 card->private_free = snd_card_als4000_free; 653 654 /* disable all legacy ISA stuff except for joystick */ 655 #ifdef SUPPORT_JOYSTICK 656 if (joystick_port[dev] > 0 && 657 (acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 gameport")) != NULL) 658 joystick = joystick_port[dev]; 659 #endif 660 snd_als4000_set_addr(gcr, 0, 0, 0, joystick); 653 661 654 662 if ((err = snd_sbdsp_create(card, … … 697 705 } 698 706 707 #ifdef SUPPORT_JOYSTICK 708 if (acard->res_joystick) { 709 acard->gameport.io = joystick; 710 gameport_register_port(&acard->gameport); 711 } 712 #endif 699 713 strcpy(card->driver, "ALS4000"); 700 714 strcpy(card->shortname, "Avance Logic ALS4000"); … … 747 761 #ifndef MODULE 748 762 749 /* format is: snd-als4000=enable,index,id */763 /* format is: snd-als4000=enable,index,id,joystick_port */ 750 764 751 765 static int __init alsa_card_als4000_setup(char *str) … … 757 771 (void)(get_option(&str,&enable[nr_dev]) == 2 && 758 772 get_option(&str,&index[nr_dev]) == 2 && 759 get_id(&str,&id[nr_dev]) == 2); 773 get_id(&str,&id[nr_dev]) == 2 774 #ifdef SUPPORT_JOYSTICK 775 && get_option(&str,&joystick_port[nr_dev]) == 2 776 #endif 777 ); 760 778 nr_dev++; 761 779 return 1; -
GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c
r262 r277 28 28 //#include <linux/pci.h> 29 29 #include <linux/slab.h> 30 #include <linux/gameport.h> 30 31 #include <sound/core.h> 31 32 #include <sound/info.h> … … 79 80 MODULE_PARM_DESC(soft_ac3, "Sofware-conversion of raw SPDIF packets (model 033 only)."); 80 81 MODULE_PARM_SYNTAX(soft_ac3, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC); 82 #endif 83 #ifdef SUPPORT_JOYSTICK 84 MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 85 MODULE_PARM_DESC(joystick, "Enable joystick."); 86 MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); 81 87 #endif 82 88 … … 349 355 #define CM_EXTENT_MIDI 0x2 350 356 #define CM_EXTENT_SYNTH 0x4 357 358 /* fixed legacy joystick address */ 359 #define CM_JOYSTICK_ADDR 0x200 360 351 361 352 362 /* … … 2302 2312 DEFINE_BIT_SWITCH_ARG(line_rear, CM_REG_MIXER1, CM_SPK4, 1, 0); 2303 2313 DEFINE_BIT_SWITCH_ARG(line_bass, CM_REG_LEGACY_CTRL, CM_LINE_AS_BASS, 0, 0); 2304 DEFINE_BIT_SWITCH_ARG(joystick, CM_REG_FUNCTRL1, CM_JYSTK_EN, 0, 0); 2314 // DEFINE_BIT_SWITCH_ARG(joystick, CM_REG_FUNCTRL1, CM_JYSTK_EN, 0, 0); /* now module option */ 2305 2315 DEFINE_SWITCH_ARG(modem, CM_REG_MISC_CTRL, CM_FLINKON|CM_FLINKOFF, CM_FLINKON, 0, 0); 2306 2316 … … 2512 2522 /* card control switches */ 2513 2523 static struct snd_kcontrol_new snd_cmipci_control_switches[] __devinitdata = { 2514 2524 // DEFINE_CARD_SWITCH("Joystick", joystick), 2515 2525 DEFINE_CARD_SWITCH("Modem", modem), 2516 2526 }; … … 2973 2983 #endif /* USE_VAR48KRATE */ 2974 2984 2985 #ifdef SUPPORT_JOYSTICK 2986 if (joystick[dev] && 2987 (cm->res_joystick = request_region(CM_JOYSTICK_ADDR, 8, "CMIPCI gameport")) != NULL) { 2988 cm->gameport.io = CM_JOYSTICK_ADDR; 2989 snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN); 2990 gameport_register_port(&cm->gameport); 2991 } else 2992 snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN); 2993 #endif 2975 2994 *rcmipci = cm; 2976 2995 return 0; … … 3174 3193 3175 3194 /* format is: snd-cmipci=enable,index,id, 3176 mpu_port,fm_port*/3195 mpu_port,fm_port,soft_ac3,joystick */ 3177 3196 3178 3197 static int __init alsa_card_cmipci_setup(char *str) … … 3185 3204 get_option(&str,&index[nr_dev]) == 2 && 3186 3205 get_id(&str,&id[nr_dev]) == 2 && 3187 get_option(&str,(int *)&mpu_port[nr_dev]) == 2 && 3188 get_option(&str,(int *)&fm_port[nr_dev]) == 2); 3206 get_option_long(&str,&mpu_port[nr_dev]) == 2 && 3207 get_option_long(&str,&fm_port[nr_dev]) == 2 3208 #ifdef DO_SOFT_AC3 3209 && get_option(&str,&soft_ac3[nr_dev]) == 2 3210 #endif 3211 #ifdef SUPPORT_JOYSTICK 3212 && get_option(&str,&joystick[nr_dev]) == 2 3213 #endif 3214 ); 3189 3215 nr_dev++; 3190 3216 return 1; -
GPL/branches/alsa-resync1/alsa-kernel/pci/es1968.c
r262 r277 95 95 */ 96 96 97 #define __SND_OSS_COMPAT__98 97 #include <sound/driver.h> 99 98 #include <asm/io.h> … … 103 102 #include <linux/pci.h> 104 103 #include <linux/slab.h> 104 #include <linux/gameport.h> 105 105 #include <sound/core.h> 106 106 #include <sound/pcm.h> … … 109 109 #define SNDRV_GET_ID 110 110 #include <sound/initval.h> 111 112 #define chip_t es1968_t 111 113 112 114 #define CARD_NAME "ESS Maestro1/2" … … 120 122 "{ESS,Maestro 1}," 121 123 "{TerraTec,DMX}}"); 124 125 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) 126 #define SUPPORT_JOYSTICK 1 127 #endif 122 128 123 129 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 1-MAX */ … … 130 136 static int use_pm[SNDRV_CARDS] = { REPEAT_SNDRV(2) }; 131 137 static int enable_mpu[SNDRV_CARDS] = { REPEAT_SNDRV(1) }; 138 #ifdef SUPPORT_JOYSTICK 139 static int joystick[SNDRV_CARDS]; 140 #endif 132 141 133 142 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); … … 158 167 MODULE_PARM_DESC(enable_mpu, "Enable MPU401. (0 = off, 1 = on, 2 = auto)"); 159 168 MODULE_PARM_SYNTAX(enable_mpu, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC); 169 #ifdef SUPPORT_JOYSTICK 170 MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 171 MODULE_PARM_DESC(joystick, "Enable joystick."); 172 MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC); 173 #endif 160 174 161 175 … … 610 624 #ifdef CONFIG_PM 611 625 u16 apu_map[NR_APUS][NR_APU_REGS]; 626 #endif 627 628 #ifdef SUPPORT_JOYSTICK 629 struct gameport gameport; 630 struct resource *res_joystick; 612 631 #endif 613 632 }; … … 2506 2525 if (chip->irq >= 0) 2507 2526 free_irq(chip->irq, (void *)chip); 2527 #ifdef SUPPORT_JOYSTICK 2528 if (chip->res_joystick) { 2529 gameport_unregister_port(&chip->gameport); 2530 release_resource(chip->res_joystick); 2531 kfree_nocheck(chip->res_joystick); 2532 } 2533 #endif 2508 2534 snd_es1968_set_acpi(chip, ACPI_D3); 2509 2535 chip->master_switch = NULL; … … 2651 2677 2652 2678 /* 2653 * joystick2654 */2655 2656 static int snd_es1968_joystick_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)2657 {2658 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;2659 uinfo->count = 1;2660 uinfo->value.integer.min = 0;2661 uinfo->value.integer.max = 1;2662 return 0;2663 }2664 2665 static int snd_es1968_joystick_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)2666 {2667 es1968_t *chip = snd_kcontrol_chip(kcontrol);2668 u16 val;2669 2670 pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &val);2671 ucontrol->value.integer.value[0] = (val & 0x04) ? 1 : 0;2672 return 0;2673 }2674 2675 static int snd_es1968_joystick_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol)2676 {2677 es1968_t *chip = snd_kcontrol_chip(kcontrol);2678 u16 val, oval;2679 2680 pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &oval);2681 val = oval & ~0x04;2682 if (ucontrol->value.integer.value[0])2683 val |= 0x04;2684 if (val != oval) {2685 pci_write_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, val);2686 return 1;2687 }2688 return 0;2689 }2690 2691 #define num_controls(ary) (sizeof(ary) / sizeof(snd_kcontrol_new_t))2692 2693 static snd_kcontrol_new_t snd_es1968_control_switches[] __devinitdata = {2694 {2695 .name = "Joystick",2696 .iface = SNDRV_CTL_ELEM_IFACE_CARD,2697 .info = snd_es1968_joystick_info,2698 .get = snd_es1968_joystick_get,2699 .put = snd_es1968_joystick_put,2700 }2701 };2702 2703 /*2704 2679 */ 2705 2680 static int __devinit snd_es1968_probe(struct pci_dev *pci, … … 2798 2773 printk("snd_es1968_probe cp8\n"); 2799 2774 2800 /* card switches */ 2801 for (i = 0; i < num_controls(snd_es1968_control_switches); i++) { 2802 err = snd_ctl_add(card, snd_ctl_new1(&snd_es1968_control_switches[i], chip)); 2803 if (err < 0) { 2804 snd_card_free(card); 2805 return err; 2806 } 2807 } 2775 #ifdef SUPPORT_JOYSTICK 2776 #define JOYSTICK_ADDR 0x200 2777 if (joystick[dev] && 2778 (chip->res_joystick = request_region(JOYSTICK_ADDR, 8, "ES1968 gameport")) != NULL) { 2779 u16 val; 2780 pci_read_config_word(pci, ESM_LEGACY_AUDIO_CONTROL, &val); 2781 pci_write_config_word(pci, ESM_LEGACY_AUDIO_CONTROL, val | 0x04); 2782 chip->gameport.io = JOYSTICK_ADDR; 2783 gameport_register_port(&chip->gameport); 2784 } 2785 #endif 2808 2786 printk("snd_es1968_probe cp9\n"); 2809 2787 … … 2879 2857 clock, 2880 2858 use_pm, 2881 enable_mpu 2859 enable_mpu, 2860 joystick 2882 2861 */ 2883 2862 … … 2896 2875 get_option(&str,&clock[nr_dev]) == 2 && 2897 2876 get_option(&str,&use_pm[nr_dev]) == 2 && 2898 get_option(&str,&enable_mpu[nr_dev]) == 2); 2877 get_option(&str,&enable_mpu[nr_dev]) == 2 2878 #ifdef SUPPORT_JOYSTICK 2879 && get_option(&str,&joystick[nr_dev]) == 2 2880 #endif 2881 ); 2899 2882 nr_dev++; 2900 2883 return 1; -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.c
r262 r277 1041 1041 snd_BUG(); 1042 1042 val = 0; 1043 rate = 48000; 1043 1044 break; 1044 1045 } … … 1051 1052 ice->akm[i].ops.set_rate_val(&ice->akm[i], rate); 1052 1053 } 1054 if (ice->spdif.ops.setup_rate) 1055 ice->spdif.ops.setup_rate(ice, rate); 1053 1056 } 1054 1057 … … 1073 1076 1074 1077 snd_ice1712_set_pro_rate(ice, params_rate(hw_params), 0); 1075 if (ice->spdif.ops.setup_rate)1076 ice->spdif.ops.setup_rate(ice, params_rate(hw_params));1077 1078 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1078 1079 } -
GPL/branches/alsa-resync1/alsa-kernel/pci/intel8x0.c
r260 r277 34 34 #include <linux/pci.h> 35 35 #include <linux/slab.h> 36 #include <linux/gameport.h> 36 37 #include <sound/core.h> 37 38 #include <sound/pcm.h> … … 3242 3243 } 3243 3244 3244 #if 0 // fixme to be gone?3245 3245 static void __devexit snd_intel8x0_joystick_remove(struct pci_dev *pci) 3246 3246 { … … 3258 3258 pci_write_config_word(pci, 0xe6, val); 3259 3259 } 3260 #endif // fixme to be gone3261 3260 3262 3261 static struct pci_device_id snd_intel8x0_joystick_ids[] = { … … 3279 3278 .id_table = snd_intel8x0_joystick_ids, 3280 3279 .probe = snd_intel8x0_joystick_probe, 3280 .remove = __devexit_p(snd_intel8x0_joystick_remove), 3281 3281 }; 3282 3282 3283 static int have_joystick; 3283 3284 #endif -
GPL/branches/alsa-resync1/alsa-kernel/pci/nm256/nm256.c
r76 r277 338 338 } 339 339 #endif 340 memcpy_toio( chip->buffer + offset, src, size);340 memcpy_toio((void *)chip->buffer + offset, src, size); 341 341 } 342 342 -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme96.c
r262 r277 1525 1525 1526 1526 if (bytes > RME96_BUFFER_SIZE - rme96->playback_ptr) { 1527 memcpy_toio( rme96->iobase + RME96_IO_PLAY_BUFFER +1528 rme96->playback_ptr,1527 memcpy_toio((void *)(rme96->iobase + RME96_IO_PLAY_BUFFER + 1528 rme96->playback_ptr), 1529 1529 runtime->dma_area + rme96->playback_ptr, 1530 1530 RME96_BUFFER_SIZE - rme96->playback_ptr); … … 1533 1533 bytes = RME96_BUFFER_SIZE; 1534 1534 } 1535 memcpy_toio( rme96->iobase + RME96_IO_PLAY_BUFFER,1535 memcpy_toio((void *)(rme96->iobase + RME96_IO_PLAY_BUFFER), 1536 1536 runtime->dma_area, 1537 1537 bytes); 1538 1538 rme96->playback_ptr = bytes; 1539 1539 } else if (bytes != 0) { 1540 memcpy_toio( rme96->iobase + RME96_IO_PLAY_BUFFER +1541 rme96->playback_ptr,1540 memcpy_toio((void *)(rme96->iobase + RME96_IO_PLAY_BUFFER + 1541 rme96->playback_ptr), 1542 1542 runtime->dma_area + rme96->playback_ptr, 1543 1543 bytes); … … 1561 1561 if (ptr > rme96->capture_ptr) { 1562 1562 memcpy_fromio(runtime->dma_area + rme96->capture_ptr, 1563 rme96->iobase + RME96_IO_REC_BUFFER +1564 rme96->capture_ptr,1563 (void *)(rme96->iobase + RME96_IO_REC_BUFFER + 1564 rme96->capture_ptr), 1565 1565 ptr - rme96->capture_ptr); 1566 1566 rme96->capture_ptr += ptr - rme96->capture_ptr; 1567 1567 } else if (ptr < rme96->capture_ptr) { 1568 1568 memcpy_fromio(runtime->dma_area + rme96->capture_ptr, 1569 rme96->iobase + RME96_IO_REC_BUFFER +1570 rme96->capture_ptr,1569 (void *)(rme96->iobase + RME96_IO_REC_BUFFER + 1570 rme96->capture_ptr), 1571 1571 RME96_BUFFER_SIZE - rme96->capture_ptr); 1572 1572 memcpy_fromio(runtime->dma_area, 1573 rme96->iobase + RME96_IO_REC_BUFFER,1573 (void *)(rme96->iobase + RME96_IO_REC_BUFFER), 1574 1574 ptr); 1575 1575 rme96->capture_ptr = ptr; -
GPL/branches/alsa-resync1/alsa-kernel/pci/ymfpci/ymfpci.c
r212 r277 51 51 static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; 52 52 static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1}; 53 #ifdef SUPPORT_JOYSTICK 54 static long joystick_port[SNDRV_CARDS]; 55 #endif 53 56 #endif 54 57 static int rear_switch[SNDRV_CARDS] = {1,1,1,1,1,1,1,1}; … … 69 72 MODULE_PARM_DESC(fm_port, "FM OPL-3 Port."); 70 73 MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED); 74 #ifdef SUPPORT_JOYSTICK 75 MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 76 MODULE_PARM_DESC(joystick_port, "Joystick port address"); 77 MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED); 78 #endif 71 79 MODULE_PARM(rear_switch, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 72 80 MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch"); … … 92 100 struct resource *fm_res = NULL; 93 101 struct resource *mpu_res = NULL; 102 #ifdef SUPPORT_JOYSTICK 103 struct resource *joystick_res = NULL; 104 #endif 94 105 ymfpci_t *chip; 95 106 opl3_t *opl3; … … 124 135 125 136 if (pci_id->device >= 0x0010) { /* YMF 744/754 */ 126 if (fm_port[dev] < 0) {137 if (fm_port[dev] <= 0) { 127 138 fm_port[dev] = pci_resource_start(pci, 1); 128 139 } 129 if (fm_port[dev] > =0 &&140 if (fm_port[dev] > 0 && 130 141 (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) { 131 142 legacy_ctrl |= YMFPCI_LEGACY_FMEN; 132 143 pci_write_config_word(pci, PCIR_DSXG_FMBASE, fm_port[dev]); 133 144 } 134 if (mpu_port[dev] < 0) {145 if (mpu_port[dev] <= 0) { 135 146 mpu_port[dev] = pci_resource_start(pci, 1) + 0x20; 136 147 } 137 if (mpu_port[dev] > =0 &&148 if (mpu_port[dev] > 0 && 138 149 (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) { 139 150 legacy_ctrl |= YMFPCI_LEGACY_MEN; 140 151 pci_write_config_word(pci, PCIR_DSXG_MPU401BASE, mpu_port[dev]); 141 152 } 153 #ifdef SUPPORT_JOYSTICK 154 if (joystick_port[dev] < 0) { 155 joystick_port[dev] = pci_resource_start(pci, 2); 156 } 157 if (joystick_port[dev] >= 0 && 158 (joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport")) != NULL) { 159 legacy_ctrl |= YMFPCI_LEGACY_JPEN; 160 pci_write_config_word(pci, PCIR_DSXG_JOYBASE, joystick_port[dev]); 161 } 162 #endif 142 163 } else { 143 164 switch (fm_port[dev]) { … … 169 190 mpu_port[dev] = -1; 170 191 } 192 #ifdef SUPPORT_JOYSTICK 193 switch (joystick_port[dev]) { 194 case 0x201: legacy_ctrl2 |= 0 << 6; break; 195 case 0x202: legacy_ctrl2 |= 1 << 6; break; 196 case 0x204: legacy_ctrl2 |= 2 << 6; break; 197 case 0x205: legacy_ctrl2 |= 3 << 6; break; 198 default: joystick_port[dev] = -1; break; 199 } 200 if (joystick_port[dev] > 0 && 201 (joystick_res = request_region(joystick_port[dev], 1, "YMFPCI gameport")) != NULL) { 202 legacy_ctrl |= YMFPCI_LEGACY_JPEN; 203 } else { 204 legacy_ctrl2 &= ~YMFPCI_LEGACY2_JSIO; 205 joystick_port[dev] = -1; 206 } 207 #endif 171 208 } 172 209 if (mpu_res) { … … 190 227 kfree_nocheck(fm_res); 191 228 } 229 #ifdef SUPPORT_JOYSTICK 230 if (joystick_res) { 231 release_resource(joystick_res); 232 kfree_nocheck(joystick_res); 233 } 234 #endif 192 235 return err; 193 236 } … … 252 295 } 253 296 #endif 254 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) 255 if ((err = snd_ymfpci_joystick(chip)) < 0) { 256 printk(KERN_WARNING "ymfpci: cannot initialize joystick, skipping...\n"); 257 } 258 #endif 297 #ifdef SUPPORT_JOYSTICK 298 if (chip->joystick_res) { 299 chip->gameport.io = joystick_port[dev]; 300 gameport_register_port(&chip->gameport); 301 } 302 #endif 303 strcpy(card->driver, str); 304 sprintf(card->shortname, "Yamaha DS-XG PCI (%s)", str); 305 sprintf(card->longname, "%s at 0x%lx, irq %i", 306 card->shortname, 307 chip->reg_area_phys, 308 chip->irq); 259 309 260 310 if ((err = snd_card_register(card)) < 0) { … … 321 371 get_option(&str,&index[nr_dev]) == 2 && 322 372 get_id(&str,&id[nr_dev]) == 2 && 323 get_option (&str,(int *)&fm_port[nr_dev]) == 2 &&324 get_option (&str,(int *)&mpu_port[nr_dev]) == 2);373 get_option_long(&str,&fm_port[nr_dev]) == 2 && 374 get_option_long(&str,&mpu_port[nr_dev]) == 2); 325 375 nr_dev++; 326 376 return 1; -
GPL/branches/alsa-resync1/alsa-kernel/pci/ymfpci/ymfpci_main.c
r250 r277 2316 2316 init_waitqueue_head(&chip->interrupt_sleep); 2317 2317 atomic_set(&chip->interrupt_sleep_count, 0); 2318 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))2319 init_MUTEX(&chip->joystick_mutex);2320 #endif2321 2318 chip->card = card; 2322 2319 chip->pci = pci;
Note:
See TracChangeset
for help on using the changeset viewer.