ALSA: usb-audio: Extend quirk_flags to 64bit

Now we reached the limit of 32bit bitmap for quirk flags.
In order to be future-ready, simply extend the flag bitmap to 64bit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260729074523.92761-3-tiwai@suse.de
This commit is contained in:
Takashi Iwai
2026-07-29 09:45:17 +02:00
parent a08ec82525
commit e6fc0af9dd
4 changed files with 9 additions and 9 deletions

View File

@@ -715,7 +715,7 @@ static void snd_usb_init_quirk_flags(int idx, struct snd_usb_audio *chip)
/* old style option found: the position-based integer value */
if (quirk_flags[idx] &&
!kstrtou32(quirk_flags[idx], 0, &chip->quirk_flags)) {
!kstrtou64(quirk_flags[idx], 0, &chip->quirk_flags)) {
snd_usb_apply_flag_dbg("module param", chip, chip->quirk_flags);
return;
}

View File

@@ -2145,7 +2145,7 @@ struct usb_string_match {
struct usb_audio_quirk_flags_table {
u32 id;
u32 flags;
u64 flags;
const struct usb_string_match *usb_string_match;
};
@@ -2638,7 +2638,7 @@ const char *snd_usb_quirk_flag_find_name(unsigned long index)
return snd_usb_audio_quirk_flag_names[index];
}
u32 snd_usb_quirk_flags_from_name(const char *name)
u64 snd_usb_quirk_flags_from_name(const char *name)
{
int i;
@@ -2647,7 +2647,7 @@ u32 snd_usb_quirk_flags_from_name(const char *name)
for (i = 0; snd_usb_audio_quirk_flag_names[i]; i++) {
if (strcasecmp(name, snd_usb_audio_quirk_flag_names[i]) == 0)
return BIT_U32(i);
return BIT_U64(i);
}
return 0;
@@ -2705,7 +2705,7 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
{
u16 chip_vid = USB_ID_VENDOR(chip->usb_id);
u16 chip_pid = USB_ID_PRODUCT(chip->usb_id);
u32 mask_flags, unmask_flags, bit;
u64 mask_flags, unmask_flags, bit;
char *p, *field, *flag;
bool is_unmask;
u16 vid, pid;
@@ -2759,7 +2759,7 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
is_unmask = false;
}
if (!kstrtou32(flag, 16, &bit)) {
if (!kstrtou64(flag, 16, &bit)) {
if (is_unmask)
unmask_flags |= bit;
else

View File

@@ -57,6 +57,6 @@ void snd_usb_init_quirk_flags_parse_string(struct snd_usb_audio *chip,
const char *str);
const char *snd_usb_quirk_flag_find_name(unsigned long flag);
u32 snd_usb_quirk_flags_from_name(const char *name);
u64 snd_usb_quirk_flags_from_name(const char *name);
#endif /* __USBAUDIO_QUIRKS_H */

View File

@@ -44,7 +44,7 @@ struct snd_usb_audio {
atomic_t active;
atomic_t shutdown;
struct snd_refcount usage_count;
unsigned int quirk_flags;
u64 quirk_flags;
unsigned int need_delayed_register:1; /* warn for delayed registration */
int num_interfaces;
int last_iface;
@@ -298,7 +298,7 @@ enum {
/* Please also edit snd_usb_audio_quirk_flag_names */
};
#define QUIRK_FLAG(x) BIT_U32(QUIRK_TYPE_ ## x)
#define QUIRK_FLAG(x) BIT_U64(QUIRK_TYPE_ ## x)
#define QUIRK_FLAG_GET_SAMPLE_RATE QUIRK_FLAG(GET_SAMPLE_RATE)
#define QUIRK_FLAG_SHARE_MEDIA_DEVICE QUIRK_FLAG(SHARE_MEDIA_DEVICE)