Changeset 277


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
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/core/control.c

    r262 r277  
    4343
    4444#define snd_kctl_ioctl(n) list_entry(n, snd_kctl_ioctl_t, list)
     45
     46/* find id without lock */
     47static snd_kcontrol_t *_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id);
    4548
    4649static DECLARE_RWSEM(snd_ioctl_rwsem);
  • GPL/branches/alsa-resync1/alsa-kernel/core/init.c

    r250 r277  
    730730#endif
    731731                set_current_state(TASK_UNINTERRUPTIBLE);
     732                set_current_state(TASK_UNINTERRUPTIBLE);
    732733                snd_power_unlock(card);
    733734                schedule_timeout(30 * HZ);
  • GPL/branches/alsa-resync1/alsa-kernel/core/sound.c

    r262 r277  
    8888    int locked;
    8989
     90        if (! current->fs->root)
     91                return;
    9092    read_lock(&snd_card_rwlock);
    9193    locked = snd_cards_lock & (1 << card);
     
    102104    char *str;
    103105
     106        if (! current->fs->root)
     107                return;
    104108    switch (minor) {
    105109    case SNDRV_MINOR_SEQUENCER: str = "snd-seq";        break;
  • GPL/branches/alsa-resync1/alsa-kernel/core/timer.c

    r222 r277  
    149149static void snd_timer_request(snd_timer_id_t *tid)
    150150{
     151        if (! current->fs->root)
     152                return;
    151153    switch (tid->dev_class) {
    152154    case SNDRV_TIMER_CLASS_GLOBAL:
     
    486488    }
    487489    timer = timeri->timer;
    488     if (! timer)
     490        if (!timer)
    489491        return -EINVAL;
    490492    spin_lock_irqsave(&timer->lock, flags);
     
    17771779
    17781780            remove_wait_queue(&tu->qchange_sleep, &wait);
    1779                         set_current_state(TASK_RUNNING);
    17801781
    17811782            if (signal_pending(current)) {
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/dummy.c

    r262 r277  
    4444#define MAX_MIDI_DEVICES        2
    4545
     46#if 0 /* emu10k1 emulation */
     47#define MAX_BUFFER_SIZE         (128 * 1024)
     48static 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
    4659
    4760#if 0 /* RME9652 emulation */
     
    105118#ifndef USE_PERIODS_MAX
    106119#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
    107126#endif
    108127
     
    334353    snd_pcm_runtime_t *runtime = substream->runtime;
    335354    snd_card_dummy_pcm_t *dpcm;
     355        int err;
    336356
    337357    dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL);
     
    356376    if (substream->pcm->device & 2)
    357377        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
    358383    return 0;
    359384}
     
    363388    snd_pcm_runtime_t *runtime = substream->runtime;
    364389    snd_card_dummy_pcm_t *dpcm;
     390        int err;
    365391
    366392    dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL);
     
    386412    if (substream->pcm->device & 2)
    387413        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
    388419    return 0;
    389420}
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/mtpav.c

    r246 r277  
    815815               get_option(&str,&index) == 2 &&
    816816               get_id(&str,&id) == 2 &&
    817                get_option(&str,(int *)&port) == 2 &&
     817               get_option_long(&str,&port) == 2 &&
    818818               get_option(&str,&irq) == 2 &&
    819819               get_option(&str,&hwports) == 2);
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/opl3/opl3_synth.c

    r32 r277  
    2121
    2222#include <sound/opl3.h>
    23 #define __SND_OSS_COMPAT__
    2423#include <sound/asound_fm.h>
    2524
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/serial-u16550.c

    r224 r277  
    10001000               get_option(&str,&index[nr_dev]) == 2 &&
    10011001               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 &&
    10031003               get_option(&str,&irq[nr_dev]) == 2 &&
    10041004               get_option(&str,&speed[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/initval.h

    r250 r277  
    198198#endif
    199199
     200/* simple wrapper for long variable.
     201 * the value more than 32bit won't work!
     202 */
     203inline 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
    200212#endif /* __SOUND_INITVAL_H */
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/pcm_oss.h

    r262 r277  
    5151        unsigned int subdivision;               /* requested subdivision */
    5252        size_t period_bytes;                    /* requested period size */
     53        size_t period_ptr;                      /* actual write pointer to period */
    5354        unsigned int periods;
    5455        size_t buffer_bytes;                    /* requested buffer size */
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/sscape_ioctl.h

    r262 r277  
    99};
    1010
     11#define SSCAPE_MICROCODE_SIZE  65536
     12
    1113struct sscape_microcode
    1214{
    13   unsigned char *code;  /* 65536 chars */
     15  unsigned char *code;
    1416};
    1517
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/version.h

    r262 r277  
    1 /* include/version.h.  Generated automatically by configure.  */
    2 #define CONFIG_SND_VERSION "0.9.7"
     1/* include/version.h.  Generated by configure.  */
     2#define CONFIG_SND_VERSION "0.9.8"
    33#define CONFIG_SND_DATE ""
  • GPL/branches/alsa-resync1/alsa-kernel/include/sound/ymfpci.h

    r250 r277  
    2626#include "rawmidi.h"
    2727#include "ac97_codec.h"
    28 #ifndef TARGET_OS2 //TODO: Implement linux/gameport.h
     28#include "timer.h"
    2929#include <linux/gameport.h>
    30 #endif /* !TARGET_OS2 */
    3130
    3231#ifndef PCI_VENDOR_ID_YAMAHA
     
    315314        unsigned short old_legacy_ctrl;
    316315#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
    317         unsigned int joystick_port;
    318         struct semaphore joystick_mutex;
    319316        struct resource *joystick_res;
    320317        struct gameport gameport;
     
    402399int snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch);
    403400int 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 #endif
    407401
    408402int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, ymfpci_voice_t **rvoice);
    409403int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice);
    410404
     405#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
     406#define SUPPORT_JOYSTICK
     407#endif
     408
    411409#endif /* __SOUND_YMFPCI_H */
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a.c

    r262 r277  
    339339               get_option(&str,&index[nr_dev]) == 2 &&
    340340               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 &&
    344344               get_option(&str,&irq[nr_dev]) == 2 &&
    345345               get_option(&str,&mpu_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/ad1848/ad1848.c

    r250 r277  
    175175               get_option(&str,&index[nr_dev]) == 2 &&
    176176               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 &&
    178178               get_option(&str,&irq[nr_dev]) == 2 &&
    179179               get_option(&str,&dma1[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/als100.c

    r262 r277  
    360360               get_option(&str,&index[nr_dev]) == 2 &&
    361361               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 &&
    365365               get_option(&str,&irq[nr_dev]) == 2 &&
    366366               get_option(&str,&mpu_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/azt2320.c

    r262 r277  
    394394               get_option(&str,&index[nr_dev]) == 2 &&
    395395               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 &&
    399399               get_option(&str,&irq[nr_dev]) == 2 &&
    400400               get_option(&str,&mpu_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cmi8330.c

    r262 r277  
    663663               get_id(&str,&id[nr_dev]) == 2 &&
    664664               get_option(&str,&pnp) == 2 &&
    665                get_option(&str,(int *)&sbport[nr_dev]) == 2 &&
     665               get_option_long(&str,&sbport[nr_dev]) == 2 &&
    666666               get_option(&str,&sbirq[nr_dev]) == 2 &&
    667667               get_option(&str,&sbdma8[nr_dev]) == 2 &&
    668668               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 &&
    670670               get_option(&str,&wssirq[nr_dev]) == 2 &&
    671671               get_option(&str,&wssdma[nr_dev]) == 2);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231.c

    r212 r277  
    195195               get_id(&str,&id[nr_dev]) == 2 &&
    196196               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 &&
    199199               get_option(&str,&irq[nr_dev]) == 2 &&
    200200               get_option(&str,&mpu_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4236.c

    r262 r277  
    666666               get_id(&str,&id[nr_dev]) == 2 &&
    667667               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 &&
    673673               get_option(&str,&irq[nr_dev]) == 2 &&
    674674               get_option(&str,&mpu_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/dt019x.c

    r262 r277  
    348348               get_option(&str,&index[nr_dev]) == 2 &&
    349349               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 &&
    353353               get_option(&str,&irq[nr_dev]) == 2 &&
    354354               get_option(&str,&mpu_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688.c

    r212 r277  
    231231               get_option(&str,&index[nr_dev]) == 2 &&
    232232               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 &&
    235235               get_option(&str,&irq[nr_dev]) == 2 &&
    236236               get_option(&str,&mpu_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c

    r262 r277  
    22942294               get_id(&str,&id[nr_dev]) == 2 &&
    22952295               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 &&
    22992299               get_option(&str,&irq[nr_dev]) == 2 &&
    23002300               get_option(&str,&dma1[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusclassic.c

    r262 r277  
    292292               get_option(&str,&index[nr_dev]) == 2 &&
    293293               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 &&
    295295               get_option(&str,&irq[nr_dev]) == 2 &&
    296296               get_option(&str,&dma1[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusextreme.c

    r262 r277  
    430430               get_option(&str,&index[nr_dev]) == 2 &&
    431431               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 &&
    435435               get_option(&str,&irq[nr_dev]) == 2 &&
    436436               get_option(&str,&gf1_irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusmax.c

    r262 r277  
    432432               get_option(&str,&index[nr_dev]) == 2 &&
    433433               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 &&
    435435               get_option(&str,&irq[nr_dev]) == 2 &&
    436436               get_option(&str,&dma1[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/gus/interwave.c

    r262 r277  
    10071007               get_id(&str,&id[nr_dev]) == 2 &&
    10081008               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 &&
    10121012#endif
    10131013               get_option(&str,&irq[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/opl3sa2.c

    r262 r277  
    904904               get_id(&str,&id[nr_dev]) == 2 &&
    905905               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 &&
    911911               get_option(&str,&irq[nr_dev]) == 2 &&
    912912               get_option(&str,&dma1[nr_dev]) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/opti9xx/opti92x-ad1848.c

    r250 r277  
    22412241               get_id(&str,&id) == 2 &&
    22422242               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 &&
    22462246               get_option(&str,&irq) == 2 &&
    22472247               get_option(&str,&mpu_irq) == 2 &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000.c

    r262 r277  
    10451045__error:
    10461046        for (i = 0; i < EMU8000_NUM_CONTROLS; i++) {
     1047                down_write(&card->controls_rwsem);
    10471048                if (emu->controls[i])
    10481049                        snd_ctl_remove(card, emu->controls[i]);
     1050                up_write(&card->controls_rwsem);
    10491051        }
    10501052        return err;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_patch.c

    r210 r277  
    234234                 * so give controls back to kernel if needed.
    235235                 */
    236                 if (need_resched()) {
    237                         if (current->state != TASK_RUNNING)
    238                                 set_current_state(TASK_RUNNING);
    239                         schedule();
    240                 }
     236                cond_resched();
    241237
    242238                if (i == sp->v.loopend &&
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/emu8000_pcm.c

    r224 r277  
    425425#define CHECK_SCHEDULER() \
    426426do { \
    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;\
    434430} while (0)
    435431
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/es968.c

    r262 r277  
    258258               get_option(&str,&index[nr_dev]) == 2 &&
    259259               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 &&
    261261               get_option(&str,&irq[nr_dev]) == 2 &&
    262262               get_option(&str,&dma8[nr_dev]) == 2);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16.c

    r262 r277  
    715715               get_id(&str,&id[nr_dev]) == 2 &&
    716716               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 &&
    720720               get_option(&str,&irq[nr_dev]) == 2 &&
    721721               get_option(&str,&dma8[nr_dev]) == 2 &&
     
    728728#ifdef SNDRV_SBAWE_EMU8000
    729729               &&
    730                get_option(&str,(int *)&awe_port[nr_dev]) == 2 &&
     730               get_option_long(&str,&awe_port[nr_dev]) == 2 &&
    731731               get_option(&str,&seq_ports[nr_dev]) == 2
    732732#endif
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_csp.c

    r250 r277  
    10561056    snd_assert(p != NULL, return);
    10571057
    1058     card = p->chip->card;
    1059 
     1058        card = p->chip->card;   
     1059       
     1060        down_write(&card->controls_rwsem);
    10601061    if (p->qsound_switch)
    10611062        snd_ctl_remove(card, p->qsound_switch);
    10621063    if (p->qsound_space)
    10631064        snd_ctl_remove(card, p->qsound_space);
     1065        up_write(&card->controls_rwsem);
    10641066
    10651067    /* cancel pending transfer of QSound parameters */
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8.c

    r246 r277  
    243243               get_option(&str,&index[nr_dev]) == 2 &&
    244244               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 &&
    246246               get_option(&str,&irq[nr_dev]) == 2 &&
    247247               get_option(&str,&dma8[nr_dev]) == 2);
  • GPL/branches/alsa-resync1/alsa-kernel/isa/sgalaxy.c

    r246 r277  
    342342               get_option(&str,&index[nr_dev]) == 2 &&
    343343               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);
    348348        nr_dev++;
    349349        return 1;
  • GPL/branches/alsa-resync1/alsa-kernel/isa/wavefront/wavefront.c

    r262 r277  
    757757               get_id(&str,&id[nr_dev]) == 2 &&
    758758               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 &&
    760760               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 &&
    762762               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 &&
    764764               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 &&
    766766               get_option(&str,&dma1[nr_dev]) == 2 &&
    767767               get_option(&str,&dma2[nr_dev]) == 2 &&
  • 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.