-
Notifications
You must be signed in to change notification settings - Fork 0
/
usbaudio.h
80 lines (71 loc) · 2.08 KB
/
usbaudio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef USBAUDIO_H_
#define USBAUDIO_H_
#define QUIRK_ANY_INTERFACE -1
enum quirk_type {
QUIRK_IGNORE_INTERFACE,
QUIRK_COMPOSITE,
QUIRK_AUTODETECT,
QUIRK_MIDI_STANDARD_INTERFACE,
QUIRK_MIDI_FIXED_ENDPOINT,
QUIRK_MIDI_YAMAHA,
QUIRK_MIDI_ROLAND,
QUIRK_MIDI_MIDIMAN,
QUIRK_MIDI_NOVATION,
QUIRK_MIDI_RAW_BYTES,
QUIRK_MIDI_EMAGIC,
QUIRK_MIDI_CME,
QUIRK_MIDI_AKAI,
QUIRK_MIDI_US122L,
QUIRK_MIDI_FTDI,
QUIRK_MIDI_CH345,
QUIRK_AUDIO_STANDARD_INTERFACE,
QUIRK_AUDIO_FIXED_ENDPOINT,
QUIRK_AUDIO_EDIROL_UAXX,
QUIRK_AUDIO_STANDARD_MIXER,
QUIRK_TYPE_COUNT
};
struct snd_usb_audio_quirk {
const char *vendor_name;
const char *product_name;
int16_t ifnum;
uint16_t type;
const void *data;
};
struct snd_usb_midi_endpoint_info {
int8_t out_ep; /* ep number, 0 autodetect */
uint8_t out_interval; /* interval for interrupt endpoints */
int8_t in_ep;
uint8_t in_interval;
uint16_t out_cables; /* bitmask */
uint16_t in_cables; /* bitmask */
int16_t assoc_in_jacks[16];
int16_t assoc_out_jacks[16];
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
int __snd_usbmidi_create(struct snd_card *card, struct usb_interface *iface,
struct list_head *midi_list,
const struct snd_usb_audio_quirk *quirk,
unsigned int usb_id, unsigned int *num_rawmidis);
#else
int __snd_usbmidi_create(struct snd_card *card, struct usb_interface *iface,
struct list_head *midi_list,
const struct snd_usb_audio_quirk *quirk,
unsigned int usb_id);
#endif
static inline int snd_usbmidi_create(struct snd_card *card,
struct usb_interface *iface,
struct list_head *midi_list,
const struct snd_usb_audio_quirk *quirk)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
return __snd_usbmidi_create(card, iface, midi_list, quirk, 0, NULL);
#else
return __snd_usbmidi_create(card, iface, midi_list, quirk, 0);
#endif
}
void snd_usbmidi_input_stop(struct list_head *p);
void snd_usbmidi_input_start(struct list_head *p);
void snd_usbmidi_disconnect(struct list_head *p);
void snd_usbmidi_suspend(struct list_head *p);
void snd_usbmidi_resume(struct list_head *p);
#endif // USBAUDIO_H_