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

Merged to ALSA 0.9.8

Location:
GPL/branches/alsa-resync1/alsa-kernel/pci
Files:
9 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;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/cmipci.c

    r262 r277  
    2828//#include <linux/pci.h>
    2929#include <linux/slab.h>
     30#include <linux/gameport.h>
    3031#include <sound/core.h>
    3132#include <sound/info.h>
     
    7980MODULE_PARM_DESC(soft_ac3, "Sofware-conversion of raw SPDIF packets (model 033 only).");
    8081MODULE_PARM_SYNTAX(soft_ac3, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
     82#endif
     83#ifdef SUPPORT_JOYSTICK
     84MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     85MODULE_PARM_DESC(joystick, "Enable joystick.");
     86MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
    8187#endif
    8288
     
    349355#define CM_EXTENT_MIDI    0x2
    350356#define CM_EXTENT_SYNTH   0x4
     357
     358/* fixed legacy joystick address */
     359#define CM_JOYSTICK_ADDR        0x200
     360 
    351361
    352362/*
     
    23022312DEFINE_BIT_SWITCH_ARG(line_rear, CM_REG_MIXER1, CM_SPK4, 1, 0);
    23032313DEFINE_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 */
    23052315DEFINE_SWITCH_ARG(modem, CM_REG_MISC_CTRL, CM_FLINKON|CM_FLINKOFF, CM_FLINKON, 0, 0);
    23062316
     
    25122522/* card control switches */
    25132523static struct snd_kcontrol_new snd_cmipci_control_switches[] __devinitdata = {
    2514     DEFINE_CARD_SWITCH("Joystick", joystick),
     2524        // DEFINE_CARD_SWITCH("Joystick", joystick),
    25152525    DEFINE_CARD_SWITCH("Modem", modem),
    25162526};
     
    29732983#endif /* USE_VAR48KRATE */
    29742984
     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
    29752994    *rcmipci = cm;
    29762995    return 0;
     
    31743193
    31753194/* format is: snd-cmipci=enable,index,id,
    3176  mpu_port,fm_port */
     3195                         mpu_port,fm_port,soft_ac3,joystick */
    31773196
    31783197static int __init alsa_card_cmipci_setup(char *str)
     
    31853204           get_option(&str,&index[nr_dev]) == 2 &&
    31863205           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               );
    31893215    nr_dev++;
    31903216    return 1;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/es1968.c

    r262 r277  
    9595 */
    9696
    97 #define __SND_OSS_COMPAT__
    9897#include <sound/driver.h>
    9998#include <asm/io.h>
     
    103102#include <linux/pci.h>
    104103#include <linux/slab.h>
     104#include <linux/gameport.h>
    105105#include <sound/core.h>
    106106#include <sound/pcm.h>
     
    109109#define SNDRV_GET_ID
    110110#include <sound/initval.h>
     111
     112#define chip_t es1968_t
    111113
    112114#define CARD_NAME "ESS Maestro1/2"
     
    120122               "{ESS,Maestro 1},"
    121123               "{TerraTec,DMX}}");
     124
     125#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
     126#define SUPPORT_JOYSTICK 1
     127#endif
    122128
    123129static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;      /* Index 1-MAX */
     
    130136static int use_pm[SNDRV_CARDS] = { REPEAT_SNDRV(2) };
    131137static int enable_mpu[SNDRV_CARDS] = { REPEAT_SNDRV(1) };
     138#ifdef SUPPORT_JOYSTICK
     139static int joystick[SNDRV_CARDS];
     140#endif
    132141
    133142MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     
    158167MODULE_PARM_DESC(enable_mpu, "Enable MPU401.  (0 = off, 1 = on, 2 = auto)");
    159168MODULE_PARM_SYNTAX(enable_mpu, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC);
     169#ifdef SUPPORT_JOYSTICK
     170MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
     171MODULE_PARM_DESC(joystick, "Enable joystick.");
     172MODULE_PARM_SYNTAX(joystick, SNDRV_ENABLED "," SNDRV_BOOLEAN_FALSE_DESC);
     173#endif
    160174
    161175
     
    610624#ifdef CONFIG_PM
    611625    u16 apu_map[NR_APUS][NR_APU_REGS];
     626#endif
     627
     628#ifdef SUPPORT_JOYSTICK
     629        struct gameport gameport;
     630        struct resource *res_joystick;
    612631#endif
    613632};
     
    25062525    if (chip->irq >= 0)
    25072526        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
    25082534    snd_es1968_set_acpi(chip, ACPI_D3);
    25092535    chip->master_switch = NULL;
     
    26512677
    26522678/*
    2653  * joystick
    2654  */
    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 /*
    27042679 */
    27052680static int __devinit snd_es1968_probe(struct pci_dev *pci,
     
    27982773        printk("snd_es1968_probe cp8\n");
    27992774
    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
    28082786        printk("snd_es1968_probe cp9\n");
    28092787
     
    28792857 clock,
    28802858 use_pm,
    2881  enable_mpu
     2859                         enable_mpu,
     2860                         joystick
    28822861 */
    28832862
     
    28962875           get_option(&str,&clock[nr_dev]) == 2 &&
    28972876           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               );
    28992882    nr_dev++;
    29002883    return 1;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.c

    r262 r277  
    10411041                snd_BUG();
    10421042                val = 0;
     1043                rate = 48000;
    10431044                break;
    10441045        }
     
    10511052                        ice->akm[i].ops.set_rate_val(&ice->akm[i], rate);
    10521053        }
     1054        if (ice->spdif.ops.setup_rate)
     1055                ice->spdif.ops.setup_rate(ice, rate);
    10531056}
    10541057
     
    10731076
    10741077        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));
    10771078        return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
    10781079}
  • GPL/branches/alsa-resync1/alsa-kernel/pci/intel8x0.c

    r260 r277  
    3434#include <linux/pci.h>
    3535#include <linux/slab.h>
     36#include <linux/gameport.h>
    3637#include <sound/core.h>
    3738#include <sound/pcm.h>
     
    32423243}
    32433244
    3244 #if 0 // fixme to be gone?
    32453245static void __devexit snd_intel8x0_joystick_remove(struct pci_dev *pci)
    32463246{
     
    32583258    pci_write_config_word(pci, 0xe6, val);
    32593259}
    3260 #endif // fixme to be gone
    32613260
    32623261static struct pci_device_id snd_intel8x0_joystick_ids[] = {
     
    32793278        .id_table = snd_intel8x0_joystick_ids,
    32803279        .probe = snd_intel8x0_joystick_probe,
     3280        .remove = __devexit_p(snd_intel8x0_joystick_remove),
    32813281};
     3282
    32823283static int have_joystick;
    32833284#endif
  • GPL/branches/alsa-resync1/alsa-kernel/pci/nm256/nm256.c

    r76 r277  
    338338        }
    339339#endif
    340         memcpy_toio(chip->buffer + offset, src, size);
     340        memcpy_toio((void *)chip->buffer + offset, src, size);
    341341}
    342342
  • GPL/branches/alsa-resync1/alsa-kernel/pci/rme96.c

    r262 r277  
    15251525               
    15261526                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),
    15291529                                    runtime->dma_area + rme96->playback_ptr,
    15301530                                    RME96_BUFFER_SIZE - rme96->playback_ptr);
     
    15331533                                bytes = RME96_BUFFER_SIZE;
    15341534                        }
    1535                         memcpy_toio(rme96->iobase + RME96_IO_PLAY_BUFFER,
     1535                        memcpy_toio((void *)(rme96->iobase + RME96_IO_PLAY_BUFFER),
    15361536                                    runtime->dma_area,
    15371537                                    bytes);
    15381538                        rme96->playback_ptr = bytes;
    15391539                } 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),
    15421542                                    runtime->dma_area + rme96->playback_ptr,
    15431543                                    bytes);
     
    15611561                if (ptr > rme96->capture_ptr) {
    15621562                        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),
    15651565                                      ptr - rme96->capture_ptr);
    15661566                        rme96->capture_ptr += ptr - rme96->capture_ptr;
    15671567                } else if (ptr < rme96->capture_ptr) {
    15681568                        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),
    15711571                                      RME96_BUFFER_SIZE - rme96->capture_ptr);
    15721572                        memcpy_fromio(runtime->dma_area,
    1573                                       rme96->iobase + RME96_IO_REC_BUFFER,
     1573                                      (void *)(rme96->iobase + RME96_IO_REC_BUFFER),
    15741574                                      ptr);
    15751575                        rme96->capture_ptr = ptr;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ymfpci/ymfpci.c

    r212 r277  
    5151static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
    5252static long mpu_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
     53#ifdef SUPPORT_JOYSTICK
     54static long joystick_port[SNDRV_CARDS];
     55#endif
    5356#endif
    5457static int rear_switch[SNDRV_CARDS] = {1,1,1,1,1,1,1,1};
     
    6972MODULE_PARM_DESC(fm_port, "FM OPL-3 Port.");
    7073MODULE_PARM_SYNTAX(fm_port, SNDRV_ENABLED);
     74#ifdef SUPPORT_JOYSTICK
     75MODULE_PARM(joystick_port, "1-" __MODULE_STRING(SNDRV_CARDS) "l");
     76MODULE_PARM_DESC(joystick_port, "Joystick port address");
     77MODULE_PARM_SYNTAX(joystick_port, SNDRV_ENABLED);
     78#endif
    7179MODULE_PARM(rear_switch, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
    7280MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
     
    92100        struct resource *fm_res = NULL;
    93101        struct resource *mpu_res = NULL;
     102#ifdef SUPPORT_JOYSTICK
     103        struct resource *joystick_res = NULL;
     104#endif
    94105        ymfpci_t *chip;
    95106        opl3_t *opl3;
     
    124135
    125136        if (pci_id->device >= 0x0010) { /* YMF 744/754 */
    126                 if (fm_port[dev] < 0) {
     137                if (fm_port[dev] <= 0) {
    127138                        fm_port[dev] = pci_resource_start(pci, 1);
    128139                }
    129                 if (fm_port[dev] >= 0 &&
     140                if (fm_port[dev] > 0 &&
    130141                    (fm_res = request_region(fm_port[dev], 4, "YMFPCI OPL3")) != NULL) {
    131142                        legacy_ctrl |= YMFPCI_LEGACY_FMEN;
    132143                        pci_write_config_word(pci, PCIR_DSXG_FMBASE, fm_port[dev]);
    133144                }
    134                 if (mpu_port[dev] < 0) {
     145                if (mpu_port[dev] <= 0) {
    135146                        mpu_port[dev] = pci_resource_start(pci, 1) + 0x20;
    136147                }
    137                 if (mpu_port[dev] >= 0 &&
     148                if (mpu_port[dev] > 0 &&
    138149                    (mpu_res = request_region(mpu_port[dev], 2, "YMFPCI MPU401")) != NULL) {
    139150                        legacy_ctrl |= YMFPCI_LEGACY_MEN;
    140151                        pci_write_config_word(pci, PCIR_DSXG_MPU401BASE, mpu_port[dev]);
    141152                }
     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
    142163        } else {
    143164                switch (fm_port[dev]) {
     
    169190                        mpu_port[dev] = -1;
    170191                }
     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
    171208        }
    172209        if (mpu_res) {
     
    190227                        kfree_nocheck(fm_res);
    191228                }
     229#ifdef SUPPORT_JOYSTICK
     230                if (joystick_res) {
     231                        release_resource(joystick_res);
     232                        kfree_nocheck(joystick_res);
     233                }
     234#endif
    192235                return err;
    193236        }
     
    252295        }
    253296#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);
    259309
    260310        if ((err = snd_card_register(card)) < 0) {
     
    321371               get_option(&str,&index[nr_dev]) == 2 &&
    322372               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);
    325375        nr_dev++;
    326376        return 1;
  • GPL/branches/alsa-resync1/alsa-kernel/pci/ymfpci/ymfpci_main.c

    r250 r277  
    23162316    init_waitqueue_head(&chip->interrupt_sleep);
    23172317    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 #endif
    23212318    chip->card = card;
    23222319    chip->pci = pci;
Note: See TracChangeset for help on using the changeset viewer.