Ignore:
Timestamp:
Mar 24, 2008, 2:43:42 AM (17 years ago)
Author:
Paul Smedley
Message:

Update source to ALSA 1.0.16 level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud-2.0/alsa-kernel/pci/ens1370.c

    r73 r305  
    11/*
    22 *  Driver for Ensoniq ES1370/ES1371 AudioPCI soundcard
    3  *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>,
     3 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
    44 *                   Thomas Sailer <sailer@ife.ee.ethz.ch>
    55 *
     
    2727 */
    2828
    29 #include <sound/driver.h>
    3029#include <asm/io.h>
    3130#include <linux/delay.h>
     
    3433#include <linux/pci.h>
    3534#include <linux/slab.h>
    36 //#include <linux/gameport.h>
     35#include <linux/gameport.h>
    3736#include <linux/moduleparam.h>
     37#include <linux/mutex.h>
     38
    3839#include <sound/core.h>
    3940#include <sound/control.h>
     
    4849#include <sound/asoundef.h>
    4950
    50 #ifndef PCI_DEVICE_ID_ENSONIQ_CT5880
    51 #define PCI_DEVICE_ID_ENSONIQ_CT5880    0x5880
    52 #endif
    53 
    5451#ifndef CHIP1371
    5552#undef CHIP1370
     
    6461
    6562
    66 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Thomas Sailer <sailer@ife.ee.ethz.ch>");
     63MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Thomas Sailer <sailer@ife.ee.ethz.ch>");
    6764MODULE_LICENSE("GPL");
    6865#ifdef CHIP1370
     
    10097#endif
    10198
    102 //module_param_array(index, int, NULL, 0444);
     99module_param_array(index, int, NULL, 0444);
    103100MODULE_PARM_DESC(index, "Index value for Ensoniq AudioPCI soundcard.");
    104 //module_param_array(id, charp, NULL, 0444);
     101module_param_array(id, charp, NULL, 0444);
    105102MODULE_PARM_DESC(id, "ID string for Ensoniq AudioPCI soundcard.");
    106 //module_param_array(enable, bool, NULL, 0444);
     103module_param_array(enable, bool, NULL, 0444);
    107104MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard.");
    108105#ifdef SUPPORT_JOYSTICK
    109106#ifdef CHIP1371
    110 //module_param_array(joystick_port, int, NULL, 0444);
     107module_param_array(joystick_port, int, NULL, 0444);
    111108MODULE_PARM_DESC(joystick_port, "Joystick port address.");
    112109#else
    113 //module_param_array(joystick, bool, NULL, 0444);
     110module_param_array(joystick, bool, NULL, 0444);
    114111MODULE_PARM_DESC(joystick, "Enable joystick.");
    115112#endif
    116113#endif /* SUPPORT_JOYSTICK */
    117114#ifdef CHIP1371
    118 //module_param_array(spdif, int, NULL, 0444);
     115module_param_array(spdif, int, NULL, 0444);
    119116MODULE_PARM_DESC(spdif, "S/PDIF output (-1 = none, 0 = auto, 1 = force).");
    120 //module_param_array(lineio, int, NULL, 0444);
     117module_param_array(lineio, int, NULL, 0444);
    121118MODULE_PARM_DESC(lineio, "Line In to Rear Out (0 = auto, 1 = force).");
    122119#endif
     
    384381struct ensoniq {
    385382        spinlock_t reg_lock;
    386         struct semaphore src_mutex;
     383        struct mutex src_mutex;
    387384
    388385        int irq;
     
    416413
    417414        struct pci_dev *pci;
    418         unsigned short subsystem_vendor_id;
    419         unsigned short subsystem_device_id;
    420415        struct snd_card *card;
    421416        struct snd_pcm *pcm1;   /* DAC1/ADC PCM */
     
    447442};
    448443
    449 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs);
     444static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id);
    450445
    451446static struct pci_device_id snd_audiopci_ids[] = {
     
    614609        unsigned int t, x;
    615610
    616         down(&ensoniq->src_mutex);
     611        mutex_lock(&ensoniq->src_mutex);
    617612        for (t = 0; t < POLL_COUNT; t++) {
    618613                if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
     
    639634                        snd_es1371_wait_src_ready(ensoniq);
    640635                        outl(x, ES_REG(ensoniq, 1371_SMPRATE));
    641                         up(&ensoniq->src_mutex);
     636                        mutex_unlock(&ensoniq->src_mutex);
    642637                        return;
    643638                }
    644639        }
    645         up(&ensoniq->src_mutex);
     640        mutex_unlock(&ensoniq->src_mutex);
    646641        snd_printk(KERN_ERR "codec write timeout at 0x%lx [0x%x]\n",
    647642                   ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC)));
     
    655650
    656651      __again:
    657         down(&ensoniq->src_mutex);
     652        mutex_lock(&ensoniq->src_mutex);
    658653        for (t = 0; t < POLL_COUNT; t++) {
    659654                if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
     
    688683                        for (t = 0; t < POLL_COUNT; t++) {
    689684                                if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) {
    690                                         up(&ensoniq->src_mutex);
     685                                        mutex_unlock(&ensoniq->src_mutex);
    691686                                        return ES_1371_CODEC_READ(x);
    692687                                }
    693688                        }
    694                         up(&ensoniq->src_mutex);
     689                        mutex_unlock(&ensoniq->src_mutex);
    695690                        if (++fail > 10) {
    696691                                snd_printk(KERN_ERR "codec read timeout (final) "
     
    703698                }
    704699        }
    705         up(&ensoniq->src_mutex);
     700        mutex_unlock(&ensoniq->src_mutex);
    706701        snd_printk(KERN_ERR "es1371: codec read timeout at 0x%lx [0x%x]\n",
    707702                   ES_REG(ensoniq, 1371_CODEC), inl(ES_REG(ensoniq, 1371_CODEC)));
     
    722717        unsigned int n, truncm, freq, result;
    723718
    724         down(&ensoniq->src_mutex);
     719        mutex_lock(&ensoniq->src_mutex);
    725720        n = rate / 3000;
    726721        if ((1 << n) & ((1 << 15) | (1 << 13) | (1 << 11) | (1 << 9)))
     
    747742        snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC, n << 8);
    748743        snd_es1371_src_write(ensoniq, ES_SMPREG_VOL_ADC + 1, n << 8);
    749         up(&ensoniq->src_mutex);
     744        mutex_unlock(&ensoniq->src_mutex);
    750745}
    751746
     
    754749        unsigned int freq, r;
    755750
    756         down(&ensoniq->src_mutex);
     751        mutex_lock(&ensoniq->src_mutex);
    757752        freq = ((rate << 15) + 1500) / 3000;
    758753        r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE |
     
    768763                                                   ES_1371_DIS_P2 | ES_1371_DIS_R1));
    769764        outl(r, ES_REG(ensoniq, 1371_SMPRATE));
    770         up(&ensoniq->src_mutex);
     765        mutex_unlock(&ensoniq->src_mutex);
    771766}
    772767
     
    775770        unsigned int freq, r;
    776771
    777         down(&ensoniq->src_mutex);
     772        mutex_lock(&ensoniq->src_mutex);
    778773        freq = ((rate << 15) + 1500) / 3000;
    779774        r = (snd_es1371_wait_src_ready(ensoniq) & (ES_1371_SRC_DISABLE |
     
    790785                                                   ES_1371_DIS_P1 | ES_1371_DIS_R1));
    791786        outl(r, ES_REG(ensoniq, 1371_SMPRATE));
    792         up(&ensoniq->src_mutex);
     787        mutex_unlock(&ensoniq->src_mutex);
    793788}
    794789
     
    803798        {
    804799                unsigned int what = 0;
    805                 struct list_head *pos;
    806800                struct snd_pcm_substream *s;
    807                 snd_pcm_group_for_each(pos, substream) {
    808                         s = snd_pcm_group_substream_entry(pos);
     801                snd_pcm_group_for_each_entry(s, substream) {
    809802                        if (s == ensoniq->playback1_substream) {
    810803                                what |= ES_P1_PAUSE;
     
    829822        {
    830823                unsigned int what = 0;
    831                 struct list_head *pos;
    832824                struct snd_pcm_substream *s;
    833                 snd_pcm_group_for_each(pos, substream) {
    834                         s = snd_pcm_group_substream_entry(pos);
     825                snd_pcm_group_for_each_entry(s, substream) {
    835826                        if (s == ensoniq->playback1_substream) {
    836827                                what |= ES_DAC1_EN;
     
    11341125                                   &snd_es1370_hw_constraints_rates);
    11351126#else
    1136 //      snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
    1137 //                                    &snd_es1371_hw_constraints_dac_clock);
     1127        snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
     1128                                      &snd_es1371_hw_constraints_dac_clock);
    11381129#endif
    11391130        return 0;
     
    11571148                                      &snd_es1370_hw_constraints_clock);
    11581149#else
    1159 //      snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
    1160 //                                    &snd_es1371_hw_constraints_dac_clock);
     1150        snd_pcm_hw_constraint_ratdens(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
     1151                                      &snd_es1371_hw_constraints_dac_clock);
    11611152#endif
    11621153        return 0;
     
    14281419  .get = snd_es1371_spdif_get, .put = snd_es1371_spdif_put }
    14291420
    1430 static int snd_es1371_spdif_info(struct snd_kcontrol *kcontrol,
    1431                                  struct snd_ctl_elem_info *uinfo)
    1432 {
    1433         uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
    1434         uinfo->count = 1;
    1435         uinfo->value.integer.min = 0;
    1436         uinfo->value.integer.max = 1;
    1437         return 0;
    1438 }
     1421#define snd_es1371_spdif_info           snd_ctl_boolean_mono_info
    14391422
    14401423static int snd_es1371_spdif_get(struct snd_kcontrol *kcontrol,
     
    14981481
    14991482
    1500 static int snd_es1373_rear_info(struct snd_kcontrol *kcontrol,
    1501                                 struct snd_ctl_elem_info *uinfo)
    1502 {
    1503         uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
    1504         uinfo->count = 1;
    1505         uinfo->value.integer.min = 0;
    1506         uinfo->value.integer.max = 1;
    1507         return 0;
    1508 }
     1483#define snd_es1373_rear_info            snd_ctl_boolean_mono_info
    15091484
    15101485static int snd_es1373_rear_get(struct snd_kcontrol *kcontrol,
     
    15511526};
    15521527
    1553 static int snd_es1373_line_info(struct snd_kcontrol *kcontrol,
    1554                                 struct snd_ctl_elem_info *uinfo)
    1555 {
    1556         uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
    1557         uinfo->count = 1;
    1558         uinfo->value.integer.min = 0;
    1559         uinfo->value.integer.max = 1;
    1560         return 0;
    1561 }
     1528#define snd_es1373_line_info            snd_ctl_boolean_mono_info
    15621529
    15631530static int snd_es1373_line_get(struct snd_kcontrol *kcontrol,
     
    16101577}
    16111578
    1612 static struct {
     1579struct es1371_quirk {
    16131580        unsigned short vid;             /* vendor ID */
    16141581        unsigned short did;             /* device ID */
    16151582        unsigned char rev;              /* revision */
    1616 } es1371_spdif_present[] __devinitdata = {
     1583};
     1584
     1585static int es1371_quirk_lookup(struct ensoniq *ensoniq,
     1586                                struct es1371_quirk *list)
     1587{
     1588        while (list->vid != (unsigned short)PCI_ANY_ID) {
     1589                if (ensoniq->pci->vendor == list->vid &&
     1590                    ensoniq->pci->device == list->did &&
     1591                    ensoniq->rev == list->rev)
     1592                        return 1;
     1593                list++;
     1594        }
     1595        return 0;
     1596}
     1597
     1598static struct es1371_quirk es1371_spdif_present[] __devinitdata = {
    16171599        { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_C },
    16181600        { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_D },
     
    16231605};
    16241606
    1625 static int snd_ensoniq_1371_mixer(struct ensoniq * ensoniq, int has_spdif, int has_line)
     1607static struct snd_pci_quirk ens1373_line_quirk[] __devinitdata = {
     1608        SND_PCI_QUIRK_ID(0x1274, 0x2000), /* GA-7DXR */
     1609        SND_PCI_QUIRK_ID(0x1458, 0xa000), /* GA-8IEXP */
     1610        {0} /* end */
     1611};
     1612
     1613static int __devinit snd_ensoniq_1371_mixer(struct ensoniq *ensoniq,
     1614                                            int has_spdif, int has_line)
    16261615{
    16271616        struct snd_card *card = ensoniq->card;
    16281617        struct snd_ac97_bus *pbus;
    16291618        struct snd_ac97_template ac97;
    1630         int err, idx;
     1619        int err;
    16311620        static struct snd_ac97_bus_ops ops = {
    16321621                .write = snd_es1371_codec_write,
     
    16441633        if ((err = snd_ac97_mixer(pbus, &ac97, &ensoniq->u.es1371.ac97)) < 0)
    16451634                return err;
    1646         for (idx = 0; es1371_spdif_present[idx].vid != (unsigned short)PCI_ANY_ID; idx++)
    1647                 if ((ensoniq->pci->vendor == es1371_spdif_present[idx].vid &&
    1648                      ensoniq->pci->device == es1371_spdif_present[idx].did &&
    1649                      ensoniq->rev == es1371_spdif_present[idx].rev) || has_spdif > 0) {
    1650                         struct snd_kcontrol *kctl;
    1651                         int i, index = 0;
    1652 
    1653                         if (has_spdif < 0)
    1654                                 break;
    1655 
    1656                         ensoniq->spdif_default = ensoniq->spdif_stream =
    1657                                 SNDRV_PCM_DEFAULT_CON_SPDIF;
    1658                         outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS));
    1659 
    1660                         if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SPDIF)
    1661                                 index++;
    1662 
    1663                         for (i = 0; i < (int)ARRAY_SIZE(snd_es1371_mixer_spdif); i++) {
    1664                                 kctl = snd_ctl_new1(&snd_es1371_mixer_spdif[i], ensoniq);
    1665                                 if (! kctl)
    1666                                         return -ENOMEM;
    1667                                 kctl->id.index = index;
    1668                                 if ((err = snd_ctl_add(card, kctl)) < 0)
    1669                                         return err;
    1670                         }
    1671                         break;
     1635        if (has_spdif > 0 ||
     1636            (!has_spdif && es1371_quirk_lookup(ensoniq, es1371_spdif_present))) {
     1637                struct snd_kcontrol *kctl;
     1638                int i, index = 0;
     1639
     1640                ensoniq->spdif_default = ensoniq->spdif_stream =
     1641                        SNDRV_PCM_DEFAULT_CON_SPDIF;
     1642                outl(ensoniq->spdif_default, ES_REG(ensoniq, CHANNEL_STATUS));
     1643
     1644                if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SPDIF)
     1645                        index++;
     1646
     1647                for (i = 0; i < ARRAY_SIZE(snd_es1371_mixer_spdif); i++) {
     1648                        kctl = snd_ctl_new1(&snd_es1371_mixer_spdif[i], ensoniq);
     1649                        if (!kctl)
     1650                                return -ENOMEM;
     1651                        kctl->id.index = index;
     1652                        err = snd_ctl_add(card, kctl);
     1653                        if (err < 0)
     1654                                return err;
    16721655                }
     1656        }
    16731657        if (ensoniq->u.es1371.ac97->ext_id & AC97_EI_SDAC) {
    16741658                /* mirror rear to front speakers */
     
    16791663                        return err;
    16801664        }
    1681         if (((ensoniq->subsystem_vendor_id == 0x1274) &&
    1682             (ensoniq->subsystem_device_id == 0x2000)) || /* GA-7DXR */
    1683             ((ensoniq->subsystem_vendor_id == 0x1458) &&
    1684             (ensoniq->subsystem_device_id == 0xa000)) || /* GA-8IEXP */
    1685             has_line > 0) {
    1686                  err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_line, ensoniq));
     1665        if (has_line > 0 ||
     1666            snd_pci_quirk_lookup(ensoniq->pci, ens1373_line_quirk)) {
     1667                 err = snd_ctl_add(card, snd_ctl_new1(&snd_ens1373_line,
     1668                                                      ensoniq));
    16871669                 if (err < 0)
    16881670                         return err;
     
    17011683  .private_value = mask }
    17021684
    1703 static int snd_ensoniq_control_info(struct snd_kcontrol *kcontrol,
    1704                                     struct snd_ctl_elem_info *uinfo)
    1705 {
    1706         uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
    1707         uinfo->count = 1;
    1708         uinfo->value.integer.min = 0;
    1709         uinfo->value.integer.max = 1;
    1710         return 0;
    1711 }
     1685#define snd_ensoniq_control_info        snd_ctl_boolean_mono_info
    17121686
    17131687static int snd_ensoniq_control_get(struct snd_kcontrol *kcontrol,
     
    19181892
    19191893        if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry))
    1920                 snd_info_set_text_ops(entry, ensoniq, 1024, snd_ensoniq_proc_read);
     1894                snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read);
    19211895}
    19221896
     
    19591933
    19601934#ifdef CHIP1371
    1961 static struct {
    1962         unsigned short svid;            /* subsystem vendor ID */
    1963         unsigned short sdid;            /* subsystem device ID */
    1964 } es1371_amplifier_hack[] = {
    1965         { .svid = 0x107b, .sdid = 0x2150 },     /* Gateway Solo 2150 */
    1966         { .svid = 0x13bd, .sdid = 0x100c },     /* EV1938 on Mebius PC-MJ100V */
    1967         { .svid = 0x1102, .sdid = 0x5938 },     /* Targa Xtender300 */
    1968         { .svid = 0x1102, .sdid = 0x8938 },     /* IPC Topnote G notebook */
    1969         { .svid = PCI_ANY_ID, .sdid = PCI_ANY_ID }
    1970 };
    1971 static struct {
    1972         unsigned short vid;             /* vendor ID */
    1973         unsigned short did;             /* device ID */
    1974         unsigned char rev;              /* revision */
    1975 } es1371_ac97_reset_hack[] = {
     1935static struct snd_pci_quirk es1371_amplifier_hack[] __devinitdata = {
     1936        SND_PCI_QUIRK_ID(0x107b, 0x2150),       /* Gateway Solo 2150 */
     1937        SND_PCI_QUIRK_ID(0x13bd, 0x100c),       /* EV1938 on Mebius PC-MJ100V */
     1938        SND_PCI_QUIRK_ID(0x1102, 0x5938),       /* Targa Xtender300 */
     1939        SND_PCI_QUIRK_ID(0x1102, 0x8938),       /* IPC Topnote G notebook */
     1940        {0} /* end */
     1941};
     1942
     1943static struct es1371_quirk es1371_ac97_reset_hack[] = {
    19761944        { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_C },
    19771945        { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_D },
     
    19871955#ifdef CHIP1371
    19881956        int idx;
    1989         struct pci_dev *pci = ensoniq->pci;
    19901957#endif
    19911958        /* this code was part of snd_ensoniq_create before intruduction
     
    20021969        outl(ensoniq->sctrl, ES_REG(ensoniq, SERIAL));
    20031970        outl(0, ES_REG(ensoniq, 1371_LEGACY));
    2004         for (idx = 0; es1371_ac97_reset_hack[idx].vid != (unsigned short)PCI_ANY_ID; idx++)
    2005                 if (pci->vendor == es1371_ac97_reset_hack[idx].vid &&
    2006                     pci->device == es1371_ac97_reset_hack[idx].did &&
    2007                     ensoniq->rev == es1371_ac97_reset_hack[idx].rev) {
    2008                         outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
    2009                         /* need to delay around 20ms(bleech) to give
    2010                         some CODECs enough time to wakeup */
    2011                         msleep(20);
    2012                         break;
    2013                 }
     1971        if (es1371_quirk_lookup(ensoniq, es1371_ac97_reset_hack)) {
     1972            outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
     1973            /* need to delay around 20ms(bleech) to give
     1974               some CODECs enough time to wakeup */
     1975            msleep(20);
     1976        }
    20141977        /* AC'97 warm reset to start the bitclk */
    20151978        outl(ensoniq->ctrl | ES_1371_SYNC_RES, ES_REG(ensoniq, CONTROL));
     
    20752038        snd_ak4531_suspend(ensoniq->u.es1370.ak4531);
    20762039#endif 
    2077         pci_set_power_state(pci, PCI_D3hot);
     2040
    20782041        pci_disable_device(pci);
    20792042        pci_save_state(pci);
     2043        pci_set_power_state(pci, pci_choose_state(pci, state));
    20802044        return 0;
    20812045}
     
    20862050        struct ensoniq *ensoniq = card->private_data;
    20872051
     2052        pci_set_power_state(pci, PCI_D0);
    20882053        pci_restore_state(pci);
    2089         pci_enable_device(pci);
    2090         pci_set_power_state(pci, PCI_D0);
     2054        if (pci_enable_device(pci) < 0) {
     2055                printk(KERN_ERR DRIVER_NAME ": pci_enable_device failed, "
     2056                       "disabling device\n");
     2057                snd_card_disconnect(card);
     2058                return -EIO;
     2059        }
    20912060        pci_set_master(pci);
    20922061
     
    21092078{
    21102079        struct ensoniq *ensoniq;
    2111         unsigned short cmdw;
    2112         unsigned char cmdb;
    2113 #ifdef CHIP1371
    2114         int idx;
    2115 #endif
    21162080        int err;
    21172081        static struct snd_device_ops ops = {
     
    21282092        }
    21292093        spin_lock_init(&ensoniq->reg_lock);
    2130         init_MUTEX(&ensoniq->src_mutex);
     2094        mutex_init(&ensoniq->src_mutex);
    21312095        ensoniq->card = card;
    21322096        ensoniq->pci = pci;
     
    21382102        }
    21392103        ensoniq->port = pci_resource_start(pci, 0);
    2140         if (request_irq(pci->irq, snd_audiopci_interrupt, SA_INTERRUPT|SA_SHIRQ,
     2104        if (request_irq(pci->irq, snd_audiopci_interrupt, IRQF_SHARED,
    21412105                        "Ensoniq AudioPCI", ensoniq)) {
    21422106                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
     
    21542118#endif
    21552119        pci_set_master(pci);
    2156         pci_read_config_byte(pci, PCI_REVISION_ID, &cmdb);
    2157         ensoniq->rev = cmdb;
    2158         pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &cmdw);
    2159         ensoniq->subsystem_vendor_id = cmdw;
    2160         pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &cmdw);
    2161         ensoniq->subsystem_device_id = cmdw;
     2120#ifndef TARGET_OS2
     2121        ensoniq->rev = pci->revision;
     2122#else
     2123        ensoniq->rev = snd_pci_revision(pci);
     2124#endif
    21622125#ifdef CHIP1370
    21632126#if 0
     
    21722135        ensoniq->sctrl = 0;
    21732136        ensoniq->cssr = 0;
    2174         for (idx = 0; es1371_amplifier_hack[idx].svid != (unsigned short)PCI_ANY_ID; idx++)
    2175                 if (ensoniq->subsystem_vendor_id == es1371_amplifier_hack[idx].svid &&
    2176                     ensoniq->subsystem_device_id == es1371_amplifier_hack[idx].sdid) {
    2177                         ensoniq->ctrl |= ES_1371_GPIO_OUT(1);   /* turn amplifier on */
    2178                         break;
    2179                 }
    2180         for (idx = 0; es1371_ac97_reset_hack[idx].vid != (unsigned short)PCI_ANY_ID; idx++)
    2181                 if (pci->vendor == es1371_ac97_reset_hack[idx].vid &&
    2182                     pci->device == es1371_ac97_reset_hack[idx].did &&
    2183                     ensoniq->rev == es1371_ac97_reset_hack[idx].rev) {
    2184                         ensoniq->cssr |= ES_1371_ST_AC97_RST;
    2185                         break;
    2186                 }
     2137        if (snd_pci_quirk_lookup(pci, es1371_amplifier_hack))
     2138                ensoniq->ctrl |= ES_1371_GPIO_OUT(1);   /* turn amplifier on */
     2139
     2140        if (es1371_quirk_lookup(ensoniq, es1371_ac97_reset_hack))
     2141                ensoniq->cssr |= ES_1371_ST_AC97_RST;
    21872142#endif
    21882143
     
    24072362 */
    24082363
    2409 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
     2364static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id)
    24102365{
    24112366        struct ensoniq *ensoniq = dev_id;
     
    25242479        .id_table = snd_audiopci_ids,
    25252480        .probe = snd_audiopci_probe,
    2526         .remove = snd_audiopci_remove,
     2481        .remove = __devexit_p(snd_audiopci_remove),
    25272482#ifdef CONFIG_PM
    25282483        .suspend = snd_ensoniq_suspend,
Note: See TracChangeset for help on using the changeset viewer.