xref: /linux/sound/usb/quirks.h (revision 520b7aa00d8cd8e411ecc09f63a2acd90feb6d29)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __USBAUDIO_QUIRKS_H
3 #define __USBAUDIO_QUIRKS_H
4 
5 struct audioformat;
6 struct snd_usb_endpoint;
7 struct snd_usb_substream;
8 
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,
20 			     const struct snd_usb_audio_quirk *quirk,
21 			     unsigned int usb_id);
22 
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 
28 void snd_usb_set_format_quirk(struct snd_usb_substream *subs,
29 			      struct audioformat *fmt);
30 
31 bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip);
32 
33 int snd_usb_is_big_endian_format(struct snd_usb_audio *chip,
34 				 struct audioformat *fp);
35 
36 void snd_usb_endpoint_start_quirk(struct snd_usb_endpoint *ep);
37 
38 void snd_usb_set_interface_quirk(struct usb_device *dev);
39 void 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 
43 int snd_usb_select_mode_quirk(struct snd_usb_substream *subs,
44 			      struct audioformat *fmt);
45 
46 u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
47 					struct audioformat *fp,
48 					unsigned int sample_bytes);
49 
50 void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,
51 					  struct audioformat *fp,
52 					  int stream);
53 
54 #endif /* __USBAUDIO_QUIRKS_H */
55