ALSA: usb-audio: Add quirk_alias option
authorTakashi Iwai <tiwai@suse.de>
Mon, 11 Jan 2016 13:39:12 +0000 (14:39 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 29 Jan 2016 06:36:10 +0000 (07:36 +0100)
commite2703363316278cd4a8880671d38f783f7de18ba
tree84649bbdd9e0de9d853888cb464fcf6871b730ef
parent79289e24194a9d099bf18f200894832c5760cd83
ALSA: usb-audio: Add quirk_alias option

This patch adds a new option "quirk_alias" to snd-usb-audio driver for
allowing user to pass the quirk alias list.  A quirk alias consists of
a string form like 0123abcd:5678beef, which makes to apply a quirk to
a device with USB ID 0123:abcd treated as if it were 5678:beef.
This feature is useful to test an existing quirk, typically for a
newer model of the same vendor, without patching / rebuilding the
kernel driver.

The current implementation is fairly simplistic: since there is no API
for matching a usb_device_id to the given ID pair, it has an open code
to loop over the id table and matches only with vendor:product pair.
So far, this is OK, as all existing entries are with vendor:product
pairs, indeed.  Once when we have another matching entry, however,
we'd need to update get_alias_quirk() as well.

Note that this option is provided only for testing / development.  If
you want to have a proper support, contact to upstream for adding the
matching quirk in the driver code statically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/card.c