Commit ce47d47e authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usb-audio: Move media-controller API quirk into quirk_flags

The devices that can have media-controller API entries are currently
specified via tables in quirks-table.h, as a part of descriptor
override.  This can fit better to the new quirk_flags, as we just need
a matching with the given ID and create the MC entries accordingly.

Link: https://lore.kernel.org/r/20210729073855.19043-3-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4d4dee0a
...@@ -826,7 +826,7 @@ static int usb_audio_probe(struct usb_interface *intf, ...@@ -826,7 +826,7 @@ static int usb_audio_probe(struct usb_interface *intf,
goto __error; goto __error;
} }
if (quirk && quirk->shares_media_device) { if (chip->quirk_flags & QUIRK_FLAG_SHARE_MEDIA_DEVICE) {
/* don't want to fail when snd_media_device_create() fails */ /* don't want to fail when snd_media_device_create() fails */
snd_media_device_create(chip, intf); snd_media_device_create(chip, intf);
} }
......
...@@ -2816,7 +2816,6 @@ YAMAHA_DEVICE(0x7010, "UB99"), ...@@ -2816,7 +2816,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
.product_name = pname, \ .product_name = pname, \
.ifnum = QUIRK_ANY_INTERFACE, \ .ifnum = QUIRK_ANY_INTERFACE, \
.type = QUIRK_AUDIO_ALIGN_TRANSFER, \ .type = QUIRK_AUDIO_ALIGN_TRANSFER, \
.shares_media_device = 1, \
} \ } \
} }
......
...@@ -1913,12 +1913,46 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { ...@@ -1913,12 +1913,46 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x05a7, 0x1020, /* Bose Companion 5 */ DEVICE_FLG(0x05a7, 0x1020, /* Bose Companion 5 */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x05e1, 0x0480, /* Hauppauge Woodbury */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x074d, 0x3553, /* Outlaw RR2150 (Micronas UAC3553B) */ DEVICE_FLG(0x074d, 0x3553, /* Outlaw RR2150 (Micronas UAC3553B) */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x0fd9, 0x0008, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */ DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */ DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x2040, 0x7200, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7201, /* Hauppauge HVR-950Q-MXL */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7210, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7211, /* Hauppauge HVR-950Q-MXL */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7213, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7217, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x721b, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x721e, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x721f, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7240, /* Hauppauge HVR-850 */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7260, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7270, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7280, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x7281, /* Hauppauge HVR-950Q-MXL */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x2040, 0x8200, /* Hauppauge Woodbury */
QUIRK_FLAG_SHARE_MEDIA_DEVICE),
DEVICE_FLG(0x21b4, 0x0081, /* AudioQuest DragonFly */ DEVICE_FLG(0x21b4, 0x0081, /* AudioQuest DragonFly */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */ DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */
......
...@@ -116,7 +116,6 @@ struct snd_usb_audio_quirk { ...@@ -116,7 +116,6 @@ struct snd_usb_audio_quirk {
const char *product_name; const char *product_name;
int16_t ifnum; int16_t ifnum;
uint16_t type; uint16_t type;
bool shares_media_device;
const void *data; const void *data;
}; };
...@@ -136,8 +135,11 @@ extern bool snd_usb_skip_validation; ...@@ -136,8 +135,11 @@ extern bool snd_usb_skip_validation;
* QUIRK_FLAG_GET_SAMPLE_RATE: * QUIRK_FLAG_GET_SAMPLE_RATE:
* Skip reading sample rate for devices, as some devices behave inconsistently * Skip reading sample rate for devices, as some devices behave inconsistently
* or return error * or return error
* QUIRK_FLAG_SHARE_MEDIA_DEVICE:
* Create Media Controller API entries
*/ */
#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0) #define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0)
#define QUIRK_FLAG_SHARE_MEDIA_DEVICE (1U << 1)
#endif /* __USBAUDIO_H */ #endif /* __USBAUDIO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment