diff options
Diffstat (limited to 'linux/sound/pci/bt87x.c')
-rw-r--r-- | linux/sound/pci/bt87x.c | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/linux/sound/pci/bt87x.c b/linux/sound/pci/bt87x.c index 9dd881d73..65888ed3c 100644 --- a/linux/sound/pci/bt87x.c +++ b/linux/sound/pci/bt87x.c @@ -35,6 +35,27 @@ #include <sound/control.h> #include <sound/initval.h> #include "compat.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) +/* structs that used to be typedefs */ +#define snd_card _snd_card +#define snd_pcm _snd_pcm +#define snd_pcm_substream _snd_pcm_substream +#define snd_pcm_hardware _snd_pcm_hardware +#define snd_pcm_runtime _snd_pcm_runtime +#define snd_pcm_hw_params sndrv_pcm_hw_params +#define snd_pcm_ops _snd_pcm_ops +#define snd_ctl_elem_info sndrv_ctl_elem_info +#define snd_ctl_elem_value sndrv_ctl_elem_value +#undef snd_kcontrol +#define snd_kcontrol _snd_kcontrol +#define snd_kcontrol_new _snd_kcontrol_new +#undef snd_device +#define snd_device _snd_device +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +/* From linux/pch_ids.h, appeared in 2.6.14 */ +#define PCI_DEVICE_ID_BROOKTREE_879 0x0879 +#endif MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); MODULE_DESCRIPTION("Brooktree Bt87x audio driver"); @@ -370,13 +391,21 @@ static int snd_bt87x_set_digital_hw(struct snd_bt87x *chip, struct snd_pcm_runti static int snd_bt87x_set_analog_hw(struct snd_bt87x *chip, struct snd_pcm_runtime *runtime) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) static struct snd_ratnum analog_clock = { +#else + static ratnum_t analog_clock = { +#endif .num = ANALOG_CLOCK, .den_min = CLOCK_DIV_MIN, .den_max = CLOCK_DIV_MAX, .den_step = 1 }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) static struct snd_pcm_hw_constraint_ratnums constraint_rates = { +#else + static snd_pcm_hw_constraint_ratnums_t constraint_rates = { +#endif .nrats = 1, .rats = &analog_clock }; @@ -709,7 +738,11 @@ static int __devinit snd_bt87x_create(struct snd_card *card, { struct snd_bt87x *chip; int err; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) static struct snd_device_ops ops = { +#else + static snd_device_ops_t ops = { +#endif .dev_free = snd_bt87x_dev_free }; @@ -817,30 +850,24 @@ static int __devinit snd_bt87x_detect_card(struct pci_dev *pci) int i; const struct pci_device_id *supported; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) supported = pci_match_device(&driver, pci); +#else + supported = pci_match_device(driver.id_table, pci); +#endif if (supported && supported->driver_data > 0) return supported->driver_data; for (i = 0; i < ARRAY_SIZE(blacklist); ++i) if (blacklist[i].subvendor == pci->subsystem_vendor && blacklist[i].subdevice == pci->subsystem_device) { -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16) - snd_printdd(KERN_INFO "card %#04x:%#04x has no audio\n", - pci->subsystem_vendor, pci->subsystem_device); -#else snd_printdd(KERN_INFO "card %#04x-%#04x:%#04x has no audio\n", pci->device, pci->subsystem_vendor, pci->subsystem_device); -#endif return -EBUSY; } -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16) - snd_printk(KERN_INFO "unknown card %#04x:%#04x, using default rate 32000\n", - pci->subsystem_vendor, pci->subsystem_device); -#else snd_printk(KERN_INFO "unknown card %#04x-%#04x:%#04x, using default rate 32000\n", pci->device, pci->subsystem_vendor, pci->subsystem_device); -#endif snd_printk(KERN_DEBUG "please mail id, board name, and, " "if it works, the correct digital_rate option to " "<alsa-devel@lists.sf.net>\n"); |