Merge branch 'topic/quirk-cleanup' into for-linus
authorTakashi Iwai <tiwai@suse.de>
Mon, 23 Mar 2009 23:35:44 +0000 (00:35 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 23 Mar 2009 23:35:44 +0000 (00:35 +0100)
1  2 
include/sound/core.h

diff --combined include/sound/core.h
@@@ -296,20 -296,8 +296,20 @@@ int snd_card_locked(int card)
  extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd);
  #endif
  
 +int snd_card_create(int idx, const char *id,
 +                  struct module *module, int extra_size,
 +                  struct snd_card **card_ret);
 +
 +static inline __deprecated
  struct snd_card *snd_card_new(int idx, const char *id,
 -                       struct module *module, int extra_size);
 +                            struct module *module, int extra_size)
 +{
 +      struct snd_card *card;
 +      if (snd_card_create(idx, id, module, extra_size, &card) < 0)
 +              return NULL;
 +      return card;
 +}
 +
  int snd_card_disconnect(struct snd_card *card);
  int snd_card_free(struct snd_card *card);
  int snd_card_free_when_closed(struct snd_card *card);
@@@ -458,21 -446,33 +458,33 @@@ static inline int __snd_bug_on(int cond
  struct snd_pci_quirk {
        unsigned short subvendor;       /* PCI subvendor ID */
        unsigned short subdevice;       /* PCI subdevice ID */
+       unsigned short subdevice_mask;  /* bitmask to match */
        int value;                      /* value */
  #ifdef CONFIG_SND_DEBUG_VERBOSE
        const char *name;               /* name of the device (optional) */
  #endif
  };
  
- #define _SND_PCI_QUIRK_ID(vend,dev) \
-       .subvendor = (vend), .subdevice = (dev)
+ #define _SND_PCI_QUIRK_ID_MASK(vend, mask, dev)       \
+       .subvendor = (vend), .subdevice = (dev), .subdevice_mask = (mask)
+ #define _SND_PCI_QUIRK_ID(vend, dev) \
+       _SND_PCI_QUIRK_ID_MASK(vend, 0xffff, dev)
  #define SND_PCI_QUIRK_ID(vend,dev) {_SND_PCI_QUIRK_ID(vend, dev)}
  #ifdef CONFIG_SND_DEBUG_VERBOSE
  #define SND_PCI_QUIRK(vend,dev,xname,val) \
        {_SND_PCI_QUIRK_ID(vend, dev), .value = (val), .name = (xname)}
+ #define SND_PCI_QUIRK_VENDOR(vend, xname, val)                        \
+       {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val), .name = (xname)}
+ #define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val)                       \
+       {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev),                       \
+                       .value = (val), .name = (xname)}
  #else
  #define SND_PCI_QUIRK(vend,dev,xname,val) \
        {_SND_PCI_QUIRK_ID(vend, dev), .value = (val)}
+ #define SND_PCI_QUIRK_MASK(vend, mask, dev, xname, val)                       \
+       {_SND_PCI_QUIRK_ID_MASK(vend, mask, dev), .value = (val)}
+ #define SND_PCI_QUIRK_VENDOR(vend, xname, val)                        \
+       {_SND_PCI_QUIRK_ID_MASK(vend, 0, 0), .value = (val)}
  #endif
  
  const struct snd_pci_quirk *