Changeset 277 for GPL/branches/alsa-resync1/alsa-kernel/pci/als4000.c
- Timestamp:
- Dec 14, 2007, 8:27:04 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.