Skip to content

Commit 8191743

Browse files
committed
ALSA: usb-audio: Clean up quirk entries with macros
Introduced a couple of macros to simplify some quirk entries. Just cosmetic, no functional changes. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 6d28484 commit 8191743

File tree

1 file changed

+30
-63
lines changed

1 file changed

+30
-63
lines changed

sound/usb/quirks-table.h

Lines changed: 30 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@
2525
.idProduct = prod, \
2626
.bInterfaceClass = USB_CLASS_VENDOR_SPEC
2727

28+
#define QUIRK_RENAME_DEVICE(_vendor, _device) \
29+
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { \
30+
.vendor_name = _vendor, \
31+
.product_name = _device, \
32+
.ifnum = QUIRK_NO_INTERFACE \
33+
}
34+
35+
#define QUIRK_DEVICE_PROFILE(_vendor, _device, _profile) \
36+
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { \
37+
.vendor_name = _vendor, \
38+
.product_name = _device, \
39+
.profile_name = _profile, \
40+
.ifnum = QUIRK_NO_INTERFACE \
41+
}
42+
2843
/* FTDI devices */
2944
{
3045
USB_DEVICE(0x0403, 0xb8d8),
@@ -61,20 +76,12 @@
6176
/* Creative/E-Mu devices */
6277
{
6378
USB_DEVICE(0x041e, 0x3010),
64-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
65-
.vendor_name = "Creative Labs",
66-
.product_name = "Sound Blaster MP3+",
67-
.ifnum = QUIRK_NO_INTERFACE
68-
}
79+
QUIRK_RENAME_DEVICE("Creative Labs", "Sound Blaster MP3+")
6980
},
7081
/* Creative/Toshiba Multimedia Center SB-0500 */
7182
{
7283
USB_DEVICE(0x041e, 0x3048),
73-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
74-
.vendor_name = "Toshiba",
75-
.product_name = "SB-0500",
76-
.ifnum = QUIRK_NO_INTERFACE
77-
}
84+
QUIRK_RENAME_DEVICE("Toshiba", "SB-0500")
7885
},
7986
{
8087
/* E-Mu 0202 USB */
@@ -207,11 +214,7 @@
207214
.idProduct = 0x0990,
208215
.bInterfaceClass = USB_CLASS_AUDIO,
209216
.bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL,
210-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
211-
.vendor_name = "Logitech, Inc.",
212-
.product_name = "QuickCam Pro 9000",
213-
.ifnum = QUIRK_NO_INTERFACE
214-
}
217+
QUIRK_RENAME_DEVICE("Logitech, Inc.", "QuickCam Pro 9000")
215218
},
216219

217220
/*
@@ -2596,11 +2599,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
25962599
},
25972600
{
25982601
USB_DEVICE(0x0ccd, 0x0028),
2599-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2600-
.vendor_name = "TerraTec",
2601-
.product_name = "Aureon5.1MkII",
2602-
.ifnum = QUIRK_NO_INTERFACE
2603-
}
2602+
QUIRK_RENAME_DEVICE("TerraTec", "Aureon5.1MkII")
26042603
},
26052604
{
26062605
USB_DEVICE(0x0ccd, 0x0035),
@@ -2615,19 +2614,11 @@ YAMAHA_DEVICE(0x7010, "UB99"),
26152614
/* Stanton/N2IT Final Scratch v1 device ('Scratchamp') */
26162615
{
26172616
USB_DEVICE(0x103d, 0x0100),
2618-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2619-
.vendor_name = "Stanton",
2620-
.product_name = "ScratchAmp",
2621-
.ifnum = QUIRK_NO_INTERFACE
2622-
}
2617+
QUIRK_RENAME_DEVICE("Stanton", "ScratchAmp")
26232618
},
26242619
{
26252620
USB_DEVICE(0x103d, 0x0101),
2626-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2627-
.vendor_name = "Stanton",
2628-
.product_name = "ScratchAmp",
2629-
.ifnum = QUIRK_NO_INTERFACE
2630-
}
2621+
QUIRK_RENAME_DEVICE("Stanton", "ScratchAmp")
26312622
},
26322623

26332624
/* Novation EMS devices */
@@ -2788,11 +2779,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
27882779
{
27892780
/* aka. Serato Scratch Live DJ Box */
27902781
USB_DEVICE(0x13e5, 0x0001),
2791-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
2792-
.vendor_name = "Rane",
2793-
.product_name = "SL-1",
2794-
.ifnum = QUIRK_NO_INTERFACE
2795-
}
2782+
QUIRK_RENAME_DEVICE("Rane", "SL-1")
27962783
},
27972784

27982785
/* Native Instruments MK2 series */
@@ -3259,10 +3246,7 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
32593246
* is also used by the CM106 based cards, so make it unique.
32603247
*/
32613248
USB_DEVICE(0x0d8c, 0x0103),
3262-
.driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
3263-
.product_name = "Audio Advantage MicroII",
3264-
.ifnum = QUIRK_NO_INTERFACE
3265-
}
3249+
QUIRK_RENAME_DEVICE(NULL, "Audio Advantage MicroII")
32663250
},
32673251

32683252
/* disabled due to regression for other devices;
@@ -3368,12 +3352,7 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
33683352
/* Dell WD15 Dock */
33693353
{
33703354
USB_DEVICE(0x0bda, 0x4014),
3371-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
3372-
.vendor_name = "Dell",
3373-
.product_name = "WD15 Dock",
3374-
.profile_name = "Dell-WD15-Dock",
3375-
.ifnum = QUIRK_NO_INTERFACE
3376-
}
3355+
QUIRK_DEVICE_PROFILE("Dell", "WD15 Dock", "Dell-WD15-Dock")
33773356
},
33783357
/* Dell WD19 Dock */
33793358
{
@@ -3553,12 +3532,8 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
35533532

35543533
#define ALC1220_VB_DESKTOP(vend, prod) { \
35553534
USB_DEVICE(vend, prod), \
3556-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { \
3557-
.vendor_name = "Realtek", \
3558-
.product_name = "ALC1220-VB-DT", \
3559-
.profile_name = "Realtek-ALC1220-VB-Desktop", \
3560-
.ifnum = QUIRK_NO_INTERFACE \
3561-
} \
3535+
QUIRK_DEVICE_PROFILE("Realtek", "ALC1220-VB-DT", \
3536+
"Realtek-ALC1220-VB-Desktop") \
35623537
}
35633538
ALC1220_VB_DESKTOP(0x0414, 0xa002), /* Gigabyte TRX40 Aorus Pro WiFi */
35643539
ALC1220_VB_DESKTOP(0x0db0, 0x0d64), /* MSI TRX40 Creator */
@@ -3574,21 +3549,13 @@ ALC1220_VB_DESKTOP(0x26ce, 0x0a01), /* Asrock TRX40 Creator */
35743549
*/
35753550
{
35763551
USB_DEVICE(0x0414, 0xa000),
3577-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
3578-
.vendor_name = "Gigabyte",
3579-
.product_name = "Aorus Master Front Headphone",
3580-
.profile_name = "Gigabyte-Aorus-Master-Front-Headphone",
3581-
.ifnum = QUIRK_NO_INTERFACE
3582-
}
3552+
QUIRK_DEVICE_PROFILE("Gigabyte", "Aorus Master Front Headphone",
3553+
"Gigabyte-Aorus-Master-Front-Headphone")
35833554
},
35843555
{
35853556
USB_DEVICE(0x0414, 0xa001),
3586-
.driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
3587-
.vendor_name = "Gigabyte",
3588-
.product_name = "Aorus Master Main Audio",
3589-
.profile_name = "Gigabyte-Aorus-Master-Main-Audio",
3590-
.ifnum = QUIRK_NO_INTERFACE
3591-
}
3557+
QUIRK_DEVICE_PROFILE("Gigabyte", "Aorus Master Main Audio",
3558+
"Gigabyte-Aorus-Master-Main-Audio")
35923559
},
35933560

35943561
#undef USB_DEVICE_VENDOR_SPEC

0 commit comments

Comments
 (0)