Ignore:
Timestamp:
Mar 25, 2008, 12:48:35 AM (17 years ago)
Author:
Paul Smedley
Message:

Cleanups + reinstante bt87x support

File:
1 edited

Legend:

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

    r305 r319  
    2222 */
    2323
     24#ifdef TARGET_OS2
     25#include <asm/bitops.h>
     26#endif
    2427#include <linux/init.h>
    2528#include <linux/interrupt.h>
     
    4144                "{Brooktree,Bt879}}");
    4245
     46#ifndef TARGET_OS2
    4347static int index[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -2}; /* Exclude the first card */
    4448static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;       /* ID for this card */
     49#else
     50static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;      /* Index 0-MAX */
     51static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;       /* ID for this card */
     52#endif
    4553static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;      /* Enable this card */
    4654static int digital_rate[SNDRV_CARDS];   /* digital input rate */
     
    818826        /* Pinnacle  Studio PCTV rave */
    819827        BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, 0xbd11, 0x1200, GENERIC),
    820         { }
     828        {0}
    821829};
    822830MODULE_DEVICE_TABLE(pci, snd_bt87x_ids);
     
    847855        int i;
    848856        const struct pci_device_id *supported;
    849 
     857#ifdef TARGET_OS2
     858        u16 subsystem_vendor, subsystem_device;
     859#endif
     860
     861#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
    850862        supported = pci_match_id(snd_bt87x_ids, pci);
     863#else
     864        supported = pci_match_device(snd_bt87x_ids, pci);
     865#endif
    851866        if (supported && supported->driver_data > 0)
    852867                return supported->driver_data;
    853868
     869#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 0)
     870        subsystem_vendor = pci->subsystem_vendor;
     871        subsystem_device = pci->subsystem_device;
     872#else
     873        pci_read_config_word(pci, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vendor);
     874        pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &subsystem_device);
     875#endif
    854876        for (i = 0; i < ARRAY_SIZE(blacklist); ++i)
     877#ifndef TARGET_OS2
    855878                if (blacklist[i].subvendor == pci->subsystem_vendor &&
    856879                    blacklist[i].subdevice == pci->subsystem_device) {
     880#else
     881                if (blacklist[i].subvendor == subsystem_vendor &&
     882                    blacklist[i].subdevice == subsystem_device) {
     883#endif
    857884                        snd_printdd(KERN_INFO "card %#04x-%#04x:%#04x has no audio\n",
     885#ifndef TARGET_OS2
    858886                                    pci->device, pci->subsystem_vendor, pci->subsystem_device);
     887#else
     888                                    pci->device, subsystem_vendor, subsystem_device);
     889#endif
    859890                        return -EBUSY;
    860891                }
    861892
    862893        snd_printk(KERN_INFO "unknown card %#04x-%#04x:%#04x\n",
     894#ifndef TARGET_OS2
    863895                   pci->device, pci->subsystem_vendor, pci->subsystem_device);
     896#else
     897                   pci->device, subsystem_vendor, subsystem_device);
     898#endif
    864899        snd_printk(KERN_DEBUG "please mail id, board name, and, "
    865900                   "if it works, the correct digital_rate option to "
     
    9651000        BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_878, PCI_ANY_ID, PCI_ANY_ID, UNKNOWN),
    9661001        BT_DEVICE(PCI_DEVICE_ID_BROOKTREE_879, PCI_ANY_ID, PCI_ANY_ID, UNKNOWN),
    967         { }
     1002        {0}
    9681003};
    9691004
Note: See TracChangeset for help on using the changeset viewer.