1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef _USB_MIDI_H_
25#define _USB_MIDI_H_
26
27#ifndef USB_SUBCLASS_MIDISTREAMING
28#define USB_SUBCLASS_MIDISTREAMING 3
29#endif
30
31#define USB_DT_CS_DEVICE 0x21
32#define USB_DT_CS_CONFIG 0x22
33#define USB_DT_CS_STRING 0x23
34#define USB_DT_CS_INTERFACE 0x24
35#define USB_DT_CS_ENDPOINT 0x25
36
37
38
39
40#ifndef USB_VENDOR_ID_ROLAND
41#define USB_VENDOR_ID_ROLAND 0x0582
42#endif
43#define USBMIDI_ROLAND_UA100G 0x0000
44#define USBMIDI_ROLAND_MPU64 0x0002
45#define USBMIDI_ROLAND_SC8850 0x0003
46#define USBMIDI_ROLAND_UM2 0x0005
47#define USBMIDI_ROLAND_SC8820 0x0007
48#define USBMIDI_ROLAND_PC300 0x0008
49#define USBMIDI_ROLAND_UM1 0x0009
50
51
52#ifndef USB_VENDOR_ID_YAMAHA
53#define USB_VENDOR_ID_YAMAHA 0x0499
54#endif
55#define USBMIDI_YAMAHA_MU1000 0x1001
56
57
58#ifndef USB_VENDOR_ID_STEINBERG
59#define USB_VENDOR_ID_STEINBERG 0x0763
60#endif
61#define USBMIDI_STEINBERG_USB2MIDI 0x1001
62
63
64#ifndef USB_VENDOR_ID_MOTU
65#define USB_VENDOR_ID_MOTU 0x07fd
66#endif
67#define USBMIDI_MOTU_FASTLANE 0x0001
68
69
70
71
72struct usb_midi_endpoint {
73 int endpoint;
74 int cableId;
75};
76
77struct usb_midi_device {
78 char *deviceName;
79
80 int idVendor;
81 int idProduct;
82 int interface;
83 int altSetting;
84
85 struct usb_midi_endpoint in[15];
86 struct usb_midi_endpoint out[15];
87};
88
89static struct usb_midi_device usb_midi_devices[] = {
90 {
91 "Roland UM-1",
92 USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM1, 2, -1,
93 { { 0x81, 1 }, {-1, -1} },
94 { { 0x01, 1,}, {-1, -1} },
95 },
96
97 {
98 "Roland UM-2" ,
99 USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM2, 2, -1,
100 { { 0x81, 3 }, {-1, -1} },
101 { { 0x01, 3,}, {-1, -1} },
102 },
103
104
105 {
106 "Roland UA-100",
107 USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UA100G, 2, -1,
108 { { 0x82, 7 }, {-1, -1} },
109 { { 0x02, 7 }, {-1, -1} },
110 },
111
112
113 {
114 "Roland SC8850",
115 USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8850, 2, -1,
116 { { 0x81, 0x3f }, {-1, -1} },
117 { { 0x01, 0x3f }, {-1, -1} },
118 },
119
120 {
121 "Roland SC8820",
122 USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8820, 2, -1,
123 { { 0x81, 0x13 }, {-1, -1} },
124 { { 0x01, 0x13 }, {-1, -1} },
125 },
126
127 {
128 "YAMAHA MU1000",
129 USB_VENDOR_ID_YAMAHA, USBMIDI_YAMAHA_MU1000, 0, -1,
130 { { 0x81, 1 }, {-1, -1} },
131 { { 0x01, 15 }, {-1, -1} },
132 },
133 {
134 "Roland PC-300",
135 USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_PC300, 2, -1,
136 { { 0x81, 1 }, {-1, -1} },
137 { { 0x01, 1 }, {-1, -1} },
138 },
139 {
140 "MOTU Fastlane USB",
141 USB_VENDOR_ID_MOTU, USBMIDI_MOTU_FASTLANE, 1, 0,
142 { { 0x82, 3 }, {-1, -1} },
143 { { 0x02, 3 }, {-1, -1} },
144 }
145};
146
147#define VENDOR_SPECIFIC_USB_MIDI_DEVICES (sizeof(usb_midi_devices)/sizeof(struct usb_midi_device))
148
149
150
151static struct usb_device_id usb_midi_ids [] = {
152 { match_flags: (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS),
153 bInterfaceClass: USB_CLASS_AUDIO, bInterfaceSubClass: USB_SUBCLASS_MIDISTREAMING},
154 { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM1 ) },
155 { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM2 ) },
156 { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UA100G ) },
157 { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_PC300 ) },
158 { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8850 ) },
159 { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8820 ) },
160 { USB_DEVICE( USB_VENDOR_ID_YAMAHA, USBMIDI_YAMAHA_MU1000 ) },
161 { USB_DEVICE( USB_VENDOR_ID_MOTU, USBMIDI_MOTU_FASTLANE ) },
162
163 { }
164};
165
166MODULE_DEVICE_TABLE (usb, usb_midi_ids);
167
168
169#endif
170
171
172