Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Daniel Mack | e577999 | 2010-03-04 19:46:13 +0100 | [diff] [blame] | 2 | #ifndef __USBAUDIO_QUIRKS_H |
| 3 | #define __USBAUDIO_QUIRKS_H |
| 4 | |
Daniel Mack | 2b58fd5 | 2012-09-04 10:23:07 +0200 | [diff] [blame] | 5 | struct audioformat; |
| 6 | struct snd_usb_endpoint; |
| 7 | struct snd_usb_substream; |
| 8 | |
Daniel Mack | e577999 | 2010-03-04 19:46:13 +0100 | [diff] [blame] | 9 | int snd_usb_create_quirk(struct snd_usb_audio *chip, |
| 10 | struct usb_interface *iface, |
| 11 | struct usb_driver *driver, |
| 12 | const struct snd_usb_audio_quirk *quirk); |
| 13 | |
| 14 | int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip, |
| 15 | int iface, |
| 16 | int altno); |
| 17 | |
| 18 | int snd_usb_apply_boot_quirk(struct usb_device *dev, |
| 19 | struct usb_interface *intf, |
Takashi Iwai | 79289e2 | 2016-01-11 11:33:34 +0100 | [diff] [blame] | 20 | const struct snd_usb_audio_quirk *quirk, |
| 21 | unsigned int usb_id); |
Daniel Mack | e577999 | 2010-03-04 19:46:13 +0100 | [diff] [blame] | 22 | |
Alexander Tsoy | 73ac9f5 | 2020-01-12 13:23:58 +0300 | [diff] [blame] | 23 | int snd_usb_apply_boot_quirk_once(struct usb_device *dev, |
| 24 | struct usb_interface *intf, |
| 25 | const struct snd_usb_audio_quirk *quirk, |
| 26 | unsigned int usb_id); |
| 27 | |
Daniel Mack | e577999 | 2010-03-04 19:46:13 +0100 | [diff] [blame] | 28 | void snd_usb_set_format_quirk(struct snd_usb_substream *subs, |
Takashi Iwai | cab941b | 2020-11-23 09:53:33 +0100 | [diff] [blame] | 29 | const struct audioformat *fmt); |
Daniel Mack | e577999 | 2010-03-04 19:46:13 +0100 | [diff] [blame] | 30 | |
| 31 | int snd_usb_is_big_endian_format(struct snd_usb_audio *chip, |
Takashi Iwai | cab941b | 2020-11-23 09:53:33 +0100 | [diff] [blame] | 32 | const struct audioformat *fp); |
Daniel Mack | e577999 | 2010-03-04 19:46:13 +0100 | [diff] [blame] | 33 | |
Daniel Mack | 2b58fd5 | 2012-09-04 10:23:07 +0200 | [diff] [blame] | 34 | void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep); |
| 35 | |
| 36 | void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, |
| 37 | __u8 request, __u8 requesttype, __u16 value, |
| 38 | __u16 index, void *data, __u16 size); |
| 39 | |
Takashi Iwai | d767aba | 2020-11-23 09:53:24 +0100 | [diff] [blame] | 40 | int snd_usb_select_mode_quirk(struct snd_usb_audio *chip, |
Takashi Iwai | cab941b | 2020-11-23 09:53:33 +0100 | [diff] [blame] | 41 | const struct audioformat *fmt); |
Jurgen Kramer | 6874daa | 2014-11-28 17:32:54 +0100 | [diff] [blame] | 42 | |
Daniel Mack | 126825e | 2013-04-17 00:01:40 +0800 | [diff] [blame] | 43 | u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, |
| 44 | struct audioformat *fp, |
| 45 | unsigned int sample_bytes); |
| 46 | |
Ruslan Bilovol | ceb18f5 | 2018-03-19 03:46:02 +0200 | [diff] [blame] | 47 | void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, |
| 48 | struct audioformat *fp, |
| 49 | int stream); |
| 50 | |
Takashi Iwai | d8695bc | 2020-03-25 11:33:19 +0100 | [diff] [blame] | 51 | bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface); |
Chris Wulff | 55f7326 | 2020-03-14 12:54:49 -0400 | [diff] [blame] | 52 | |
Takashi Iwai | 4d4dee0 | 2021-07-29 09:38:47 +0200 | [diff] [blame] | 53 | void snd_usb_init_quirk_flags(struct snd_usb_audio *chip); |
| 54 | |
Daniel Mack | e577999 | 2010-03-04 19:46:13 +0100 | [diff] [blame] | 55 | #endif /* __USBAUDIO_QUIRKS_H */ |