usb-midi.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. usb-midi.h -- USB-MIDI driver
  3. Copyright (C) 2001
  4. NAGANO Daisuke <breeze.nagano@nifty.ne.jp>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. /* ------------------------------------------------------------------------- */
  18. #ifndef _USB_MIDI_H_
  19. #define _USB_MIDI_H_
  20. #ifndef USB_SUBCLASS_MIDISTREAMING
  21. #define USB_SUBCLASS_MIDISTREAMING 3
  22. #endif
  23. /* ------------------------------------------------------------------------- */
  24. /* Roland MIDI Devices */
  25. #define USB_VENDOR_ID_ROLAND 0x0582
  26. #define USBMIDI_ROLAND_UA100G 0x0000
  27. #define USBMIDI_ROLAND_MPU64 0x0002
  28. #define USBMIDI_ROLAND_SC8850 0x0003
  29. #define USBMIDI_ROLAND_SC8820 0x0007
  30. #define USBMIDI_ROLAND_UM2 0x0005
  31. #define USBMIDI_ROLAND_UM1 0x0009
  32. #define USBMIDI_ROLAND_PC300 0x0008
  33. /* YAMAHA MIDI Devices */
  34. #define USB_VENDOR_ID_YAMAHA 0x0499
  35. #define USBMIDI_YAMAHA_MU1000 0x1001
  36. /* Steinberg MIDI Devices */
  37. #define USB_VENDOR_ID_STEINBERG 0x0763
  38. #define USBMIDI_STEINBERG_USB2MIDI 0x1001
  39. /* Mark of the Unicorn MIDI Devices */
  40. #define USB_VENDOR_ID_MOTU 0x07fd
  41. #define USBMIDI_MOTU_FASTLANE 0x0001
  42. /* ------------------------------------------------------------------------- */
  43. /* Supported devices */
  44. struct usb_midi_endpoint {
  45. int endpoint;
  46. int cableId; /* if bit-n == 1 then cableId-n is enabled (n: 0 - 15) */
  47. };
  48. struct usb_midi_device {
  49. char *deviceName;
  50. u16 idVendor;
  51. u16 idProduct;
  52. int interface;
  53. int altSetting; /* -1: auto detect */
  54. struct usb_midi_endpoint in[15];
  55. struct usb_midi_endpoint out[15];
  56. };
  57. static struct usb_midi_device usb_midi_devices[] = {
  58. { /* Roland UM-1 */
  59. "Roland UM-1",
  60. USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM1, 2, -1,
  61. { { 0x81, 1 }, {-1, -1} },
  62. { { 0x01, 1,}, {-1, -1} },
  63. },
  64. { /* Roland UM-2 */
  65. "Roland UM-2" ,
  66. USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM2, 2, -1,
  67. { { 0x81, 3 }, {-1, -1} },
  68. { { 0x01, 3,}, {-1, -1} },
  69. },
  70. /** Next entry courtesy research by Michael Minn <michael@michaelminn.com> **/
  71. { /* Roland UA-100 */
  72. "Roland UA-100",
  73. USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UA100G, 2, -1,
  74. { { 0x82, 7 }, {-1, -1} }, /** cables 0,1 and 2 for SYSEX **/
  75. { { 0x02, 7 }, {-1, -1} },
  76. },
  77. /** Next entry courtesy research by Michael Minn <michael@michaelminn.com> **/
  78. { /* Roland SC8850 */
  79. "Roland SC8850",
  80. USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8850, 2, -1,
  81. { { 0x81, 0x3f }, {-1, -1} },
  82. { { 0x01, 0x3f }, {-1, -1} },
  83. },
  84. { /* Roland SC8820 */
  85. "Roland SC8820",
  86. USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8820, 2, -1,
  87. { { 0x81, 0x13 }, {-1, -1} },
  88. { { 0x01, 0x13 }, {-1, -1} },
  89. },
  90. { /* Roland SC8820 */
  91. "Roland SC8820",
  92. USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8820, 2, -1,
  93. { { 0x81, 17 }, {-1, -1} },
  94. { { 0x01, 17 }, {-1, -1} },
  95. },
  96. { /* YAMAHA MU1000 */
  97. "YAMAHA MU1000",
  98. USB_VENDOR_ID_YAMAHA, USBMIDI_YAMAHA_MU1000, 0, -1,
  99. { { 0x81, 1 }, {-1, -1} },
  100. { { 0x01, 15 }, {-1, -1} },
  101. },
  102. { /* Roland PC-300 */
  103. "Roland PC-300",
  104. USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_PC300, 2, -1,
  105. { { 0x81, 1 }, {-1, -1} },
  106. { { 0x01, 1 }, {-1, -1} },
  107. },
  108. { /* MOTU Fastlane USB */
  109. "MOTU Fastlane USB",
  110. USB_VENDOR_ID_MOTU, USBMIDI_MOTU_FASTLANE, 1, 0,
  111. { { 0x82, 3 }, {-1, -1} },
  112. { { 0x02, 3 }, {-1, -1} },
  113. }
  114. };
  115. #define VENDOR_SPECIFIC_USB_MIDI_DEVICES (sizeof(usb_midi_devices)/sizeof(struct usb_midi_device))
  116. /* for Hot-Plugging */
  117. static struct usb_device_id usb_midi_ids [] = {
  118. { .match_flags = (USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS),
  119. .bInterfaceClass = USB_CLASS_AUDIO, .bInterfaceSubClass = USB_SUBCLASS_MIDISTREAMING},
  120. { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM1 ) },
  121. { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UM2 ) },
  122. { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_UA100G ) },
  123. { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_PC300 ) },
  124. { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8850 ) },
  125. { USB_DEVICE( USB_VENDOR_ID_ROLAND, USBMIDI_ROLAND_SC8820 ) },
  126. { USB_DEVICE( USB_VENDOR_ID_YAMAHA, USBMIDI_YAMAHA_MU1000 ) },
  127. { USB_DEVICE( USB_VENDOR_ID_MOTU, USBMIDI_MOTU_FASTLANE ) },
  128. /* { USB_DEVICE( USB_VENDOR_ID_STEINBERG, USBMIDI_STEINBERG_USB2MIDI ) },*/
  129. { } /* Terminating entry */
  130. };
  131. MODULE_DEVICE_TABLE (usb, usb_midi_ids);
  132. /* ------------------------------------------------------------------------- */
  133. #endif /* _USB_MIDI_H_ */