Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182697
b: refs/heads/master
c: d145827
h: refs/heads/master
i:
  182695: 1457dce
v: v3
  • Loading branch information
Takashi Iwai committed Jan 14, 2010
1 parent 3753541 commit e3b25ed
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47e91348459901c30cc1bb4897e62ced21ca243a
refs/heads/master: d1458279bf9c575a52fd22818ca19c463f380aba
3 changes: 3 additions & 0 deletions trunk/include/sound/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,5 +458,8 @@ struct snd_pci_quirk {
const struct snd_pci_quirk *
snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list);

const struct snd_pci_quirk *
snd_pci_quirk_lookup_id(u16 vendor, u16 device,
const struct snd_pci_quirk *list);

#endif /* __SOUND_CORE_H */
32 changes: 27 additions & 5 deletions trunk/sound/core/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ EXPORT_SYMBOL_GPL(__snd_printk);
#ifdef CONFIG_PCI
#include <linux/pci.h>
/**
* snd_pci_quirk_lookup - look up a PCI SSID quirk list
* @pci: pci_dev handle
* snd_pci_quirk_lookup_id - look up a PCI SSID quirk list
* @vendor: PCI SSV id
* @device: PCI SSD id
* @list: quirk list, terminated by a null entry
*
* Look through the given quirk list and finds a matching entry
Expand All @@ -112,18 +113,39 @@ EXPORT_SYMBOL_GPL(__snd_printk);
* Returns the matched entry pointer, or NULL if nothing matched.
*/
const struct snd_pci_quirk *
snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list)
snd_pci_quirk_lookup_id(u16 vendor, u16 device,
const struct snd_pci_quirk *list)
{
const struct snd_pci_quirk *q;

for (q = list; q->subvendor; q++) {
if (q->subvendor != pci->subsystem_vendor)
if (q->subvendor != vendor)
continue;
if (!q->subdevice ||
(pci->subsystem_device & q->subdevice_mask) == q->subdevice)
(device & q->subdevice_mask) == q->subdevice)
return q;
}
return NULL;
}
EXPORT_SYMBOL(snd_pci_quirk_lookup_id);

/**
* snd_pci_quirk_lookup - look up a PCI SSID quirk list
* @pci: pci_dev handle
* @list: quirk list, terminated by a null entry
*
* Look through the given quirk list and finds a matching entry
* with the same PCI SSID. When subdevice is 0, all subdevice
* values may match.
*
* Returns the matched entry pointer, or NULL if nothing matched.
*/
const struct snd_pci_quirk *
snd_pci_quirk_lookup(struct pci_dev *pci, const struct snd_pci_quirk *list)
{
return snd_pci_quirk_lookup_id(pci->subsystem_vendor,
pci->subsystem_device,
list);
}
EXPORT_SYMBOL(snd_pci_quirk_lookup);
#endif

0 comments on commit e3b25ed

Please sign in to comment.