blob: 31abb7cb01a526d59aeaa78d2e46d16c686083c7 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Daniel Macke5779992010-03-04 19:46:13 +01002#ifndef __USBAUDIO_QUIRKS_H
3#define __USBAUDIO_QUIRKS_H
4
Daniel Mack2b58fd52012-09-04 10:23:07 +02005struct audioformat;
6struct snd_usb_endpoint;
7struct snd_usb_substream;
8
Daniel Macke5779992010-03-04 19:46:13 +01009int 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
14int snd_usb_apply_interface_quirk(struct snd_usb_audio *chip,
15 int iface,
16 int altno);
17
18int snd_usb_apply_boot_quirk(struct usb_device *dev,
19 struct usb_interface *intf,
Takashi Iwai79289e22016-01-11 11:33:34 +010020 const struct snd_usb_audio_quirk *quirk,
21 unsigned int usb_id);
Daniel Macke5779992010-03-04 19:46:13 +010022
Alexander Tsoy73ac9f52020-01-12 13:23:58 +030023int 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 Macke5779992010-03-04 19:46:13 +010028void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
Takashi Iwaicab941b2020-11-23 09:53:33 +010029 const struct audioformat *fmt);
Daniel Macke5779992010-03-04 19:46:13 +010030
31int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
Takashi Iwaicab941b2020-11-23 09:53:33 +010032 const struct audioformat *fp);
Daniel Macke5779992010-03-04 19:46:13 +010033
Daniel Mack2b58fd52012-09-04 10:23:07 +020034void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep);
35
36void 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 Iwaid767aba2020-11-23 09:53:24 +010040int snd_usb_select_mode_quirk(struct snd_usb_audio *chip,
Takashi Iwaicab941b2020-11-23 09:53:33 +010041 const struct audioformat *fmt);
Jurgen Kramer6874daa2014-11-28 17:32:54 +010042
Daniel Mack126825e2013-04-17 00:01:40 +080043u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
44 struct audioformat *fp,
45 unsigned int sample_bytes);
46
Ruslan Bilovolceb18f52018-03-19 03:46:02 +020047void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
48 struct audioformat *fp,
49 int stream);
50
Takashi Iwaid8695bc2020-03-25 11:33:19 +010051bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface);
Chris Wulff55f73262020-03-14 12:54:49 -040052
Takashi Iwai4d4dee02021-07-29 09:38:47 +020053void snd_usb_init_quirk_flags(struct snd_usb_audio *chip);
54
Daniel Macke5779992010-03-04 19:46:13 +010055#endif /* __USBAUDIO_QUIRKS_H */