blob: 0a49e074ae6a16b17e865f363e0132635f797c63 [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
Takashi Iwaid767aba2020-11-23 09:53:24 +010036void snd_usb_set_interface_quirk(struct snd_usb_audio *chip);
Daniel Mack2b58fd52012-09-04 10:23:07 +020037void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
38 __u8 request, __u8 requesttype, __u16 value,
39 __u16 index, void *data, __u16 size);
40
Takashi Iwaid767aba2020-11-23 09:53:24 +010041int snd_usb_select_mode_quirk(struct snd_usb_audio *chip,
Takashi Iwaicab941b2020-11-23 09:53:33 +010042 const struct audioformat *fmt);
Jurgen Kramer6874daa2014-11-28 17:32:54 +010043
Daniel Mack126825e2013-04-17 00:01:40 +080044u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
45 struct audioformat *fp,
46 unsigned int sample_bytes);
47
Ruslan Bilovolceb18f52018-03-19 03:46:02 +020048void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
49 struct audioformat *fp,
50 int stream);
51
Takashi Iwaid8695bc2020-03-25 11:33:19 +010052bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface);
Chris Wulff55f73262020-03-14 12:54:49 -040053
Takashi Iwai4d4dee02021-07-29 09:38:47 +020054void snd_usb_init_quirk_flags(struct snd_usb_audio *chip);
55
Daniel Macke5779992010-03-04 19:46:13 +010056#endif /* __USBAUDIO_QUIRKS_H */