Ignore:
Timestamp:
Dec 14, 2007, 8:27:04 AM (18 years ago)
Author:
Brendan Oakley
Message:

Merged to ALSA 0.9.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/pci/als4000.c

    r210 r277  
    6464#include <linux/pci.h>
    6565#include <linux/slab.h>
     66#include <linux/gameport.h>
    6667#include <sound/core.h>
    6768#include <sound/pcm.h>
     
    7980MODULE_DEVICES("{{Avance Logic,ALS4000}}");
    8081
     82#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
     83#define SUPPORT_JOYSTICK 1
     84#endif
     85
    8186static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;      /* Index 0-MAX */
    8287static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;       /* ID for this card */
    8388static 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
     90static int joystick_port[SNDRV_CARDS];
    8991#endif
    9092
     
    536538/******************************************************************/
    537539
    538 static void __devinit snd_als4000_set_addr(unsigned long gcr,
     540static void snd_als4000_set_addr(unsigned long gcr,
    539541                                           unsigned int sb,
    540542                                           unsigned int mpu,
     
    610612    unsigned short word;
    611613    int err;
     614        int joystick = 0;
    612615
    613616    if (dev >= SNDRV_CARDS)
     
    637640    pci_set_master(pci);
    638641
    639     /* disable all legacy ISA stuff except for joystick */
    640     snd_als4000_set_addr(gcr, 0, 0, 0, joystick_port[dev]);
    641 
    642642    card = snd_card_new(index[dev], id[dev], THIS_MODULE,
    643643                        sizeof( snd_card_als4000_t ) );
     
    651651    acard->gcr = gcr;
    652652    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);
    653661
    654662    if ((err = snd_sbdsp_create(card,
     
    697705    }
    698706
     707#ifdef SUPPORT_JOYSTICK
     708        if (acard->res_joystick) {
     709                acard->gameport.io = joystick;
     710                gameport_register_port(&acard->gameport);
     711        }
     712#endif
    699713    strcpy(card->driver, "ALS4000");
    700714    strcpy(card->shortname, "Avance Logic ALS4000");
     
    747761#ifndef MODULE
    748762
    749 /* format is: snd-als4000=enable,index,id */
     763/* format is: snd-als4000=enable,index,id,joystick_port */
    750764
    751765static int __init alsa_card_als4000_setup(char *str)
     
    757771    (void)(get_option(&str,&enable[nr_dev]) == 2 &&
    758772           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               );
    760778    nr_dev++;
    761779    return 1;
Note: See TracChangeset for help on using the changeset viewer.