^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __USBAUDIO_QUIRKS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __USBAUDIO_QUIRKS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) struct audioformat;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) struct snd_usb_endpoint;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) struct snd_usb_substream;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) int snd_usb_create_quirk(struct snd_usb_audio *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct usb_interface *iface,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) struct usb_driver *driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) const struct snd_usb_audio_quirk *quirk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) int iface,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) int altno);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) int snd_usb_apply_boot_quirk(struct usb_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct usb_interface *intf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) const struct snd_usb_audio_quirk *quirk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) unsigned int usb_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) int snd_usb_apply_boot_quirk_once(struct usb_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct usb_interface *intf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) const struct snd_usb_audio_quirk *quirk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) unsigned int usb_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct audioformat *fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct audioformat *fp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) void snd_usb_set_interface_quirk(struct usb_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __u8 request, __u8 requesttype, __u16 value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) __u16 index, void *data, __u16 size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) int snd_usb_select_mode_quirk(struct snd_usb_substream *subs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct audioformat *fmt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct audioformat *fp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) unsigned int sample_bytes);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) struct audioformat *fp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) int stream);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #endif /* __USBAUDIO_QUIRKS_H */