]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: usb-audio: Simplify quirk entries with a macro
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Aug 2020 08:21:39 +0000 (10:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 17:24:27 +0000 (18:24 +0100)
commit fa10635fca359f047df6a18b3befd2f1e7304e1a upstream.

Introduce a new macro USB_AUDIO_DEVICE() for the entries matching with
the pid/vid pair and the class/subclass, and remove the open-code.

Link: https://lore.kernel.org/r/20200817082140.20232-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[ just add the macro for 5.4.y, no entry changes made - gregkh ]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/usb/quirks-table.h

index 01dee2074ab367286005c4fef6c2673d508ae29f..c29ccdf9e8bca948907863857a90fbd98775604c 100644 (file)
        .idProduct = prod, \
        .bInterfaceClass = USB_CLASS_VENDOR_SPEC
 
+/* A standard entry matching with vid/pid and the audio class/subclass */
+#define USB_AUDIO_DEVICE(vend, prod) \
+       .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
+                      USB_DEVICE_ID_MATCH_INT_CLASS | \
+                      USB_DEVICE_ID_MATCH_INT_SUBCLASS, \
+       .idVendor = vend, \
+       .idProduct = prod, \
+       .bInterfaceClass = USB_CLASS_AUDIO, \
+       .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
+
 /* HP Thunderbolt Dock Audio Headset */
 {
        USB_DEVICE(0x03f0, 0x0269),