blob: c76cf24a640a6ff811eda6106d35f8991da02789 [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,
29 struct audioformat *fmt);
30
Joe Turnerb62b9982015-02-16 20:44:33 +000031bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip);
32
Daniel Macke5779992010-03-04 19:46:13 +010033int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
34 struct audioformat *fp);
35
Daniel Mack2b58fd52012-09-04 10:23:07 +020036void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep);
37
Daniel Mack21bb5aa2013-04-10 00:56:03 +080038void snd_usb_set_interface_quirk(struct usb_device *dev);
Daniel Mack2b58fd52012-09-04 10:23:07 +020039void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
40 __u8 request, __u8 requesttype, __u16 value,
41 __u16 index, void *data, __u16 size);
42
Jurgen Kramer6874daa2014-11-28 17:32:54 +010043int snd_usb_select_mode_quirk(struct snd_usb_substream *subs,
44 struct audioformat *fmt);
45
Daniel Mack126825e2013-04-17 00:01:40 +080046u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
47 struct audioformat *fp,
48 unsigned int sample_bytes);
49
Ruslan Bilovolceb18f52018-03-19 03:46:02 +020050void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
51 struct audioformat *fp,
52 int stream);
53
Takashi Iwaid8695bc2020-03-25 11:33:19 +010054bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface);
Chris Wulff55f73262020-03-14 12:54:49 -040055
Daniel Macke5779992010-03-04 19:46:13 +010056#endif /* __USBAUDIO_QUIRKS_H */