diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-07-29 09:38:47 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-08-02 09:05:53 +0200 |
commit | 4d4dee0aefec36e6d1568e844a9e75a2e165cb93 (patch) | |
tree | b68e87eb6e04274a76ec1d4aaf2f5b5df0799b85 /sound/usb/usbaudio.h | |
parent | 01099b1ad9101ca3f41071a87b9c496d9ea1d2ad (diff) | |
download | linux-4d4dee0aefec36e6d1568e844a9e75a2e165cb93.tar.gz linux-4d4dee0aefec36e6d1568e844a9e75a2e165cb93.tar.bz2 linux-4d4dee0aefec36e6d1568e844a9e75a2e165cb93.zip |
ALSA: usb-audio: Introduce quirk_flags field
As more and more device-specific workarounds came up and gathered in
various places, it becomes harder to manage. Now it's time to clean
up and collect workarounds more consistently and make them more easily
applicable.
This patch is the first step for that: a new field quirk_flags is
introduced in snd_usb_audio struct to contain the bit flags for
various device-specific quirks. Those are separate one from the
quirks in quirks-table.h; the quirks-table.h entries are for more
intrusive stuff that needs the descriptor override, while the new
quirk_flags is for easier ones that are tied with the vendor:product
IDs.
In this patch, as the first example, we convert the list of devices
and vendors to ignore GET_SAMPLE_RATE, formerly defined in
snb_usb_get_sample_rate_quirk().
Link: https://lore.kernel.org/r/20210729073855.19043-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usbaudio.h')
-rw-r--r-- | sound/usb/usbaudio.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 538831cbd925..37195ac26ac9 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h @@ -34,6 +34,7 @@ struct snd_usb_audio { atomic_t shutdown; atomic_t usage_count; wait_queue_head_t shutdown_wait; + unsigned int quirk_flags; unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ unsigned int tx_length_quirk:1; /* Put length specifier in transfers */ unsigned int need_delayed_register:1; /* warn for delayed registration */ @@ -129,4 +130,14 @@ void snd_usb_unlock_shutdown(struct snd_usb_audio *chip); extern bool snd_usb_use_vmalloc; extern bool snd_usb_skip_validation; +/* + * Driver behavior quirk flags, stored in chip->quirk_flags + * + * QUIRK_FLAG_GET_SAMPLE_RATE: + * Skip reading sample rate for devices, as some devices behave inconsistently + * or return error + */ + +#define QUIRK_FLAG_GET_SAMPLE_RATE (1U << 0) + #endif /* __USBAUDIO_H */ |