midi.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __USBMIDI_H
  3. #define __USBMIDI_H
  4. /* maximum number of endpoints per interface */
  5. #define MIDI_MAX_ENDPOINTS 2
  6. /* data for QUIRK_MIDI_FIXED_ENDPOINT */
  7. struct snd_usb_midi_endpoint_info {
  8. int8_t out_ep; /* ep number, 0 autodetect */
  9. uint8_t out_interval; /* interval for interrupt endpoints */
  10. int8_t in_ep;
  11. uint8_t in_interval;
  12. uint16_t out_cables; /* bitmask */
  13. uint16_t in_cables; /* bitmask */
  14. };
  15. /* for QUIRK_MIDI_YAMAHA, data is NULL */
  16. /* for QUIRK_MIDI_MIDIMAN, data points to a snd_usb_midi_endpoint_info
  17. * structure (out_cables and in_cables only) */
  18. /* for QUIRK_COMPOSITE, data points to an array of snd_usb_audio_quirk
  19. * structures, terminated with .ifnum = -1 */
  20. /* for QUIRK_AUDIO_FIXED_ENDPOINT, data points to an audioformat structure */
  21. /* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */
  22. /* for QUIRK_AUDIO_EDIROL_UA700_UA25/UA1000, data is NULL */
  23. /* for QUIRK_IGNORE_INTERFACE, data is NULL */
  24. /* for QUIRK_MIDI_NOVATION and _RAW, data is NULL */
  25. /* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info
  26. * structure (out_cables and in_cables only) */
  27. /* for QUIRK_MIDI_CME, data is NULL */
  28. /* for QUIRK_MIDI_AKAI, data is NULL */
  29. int __snd_usbmidi_create(struct snd_card *card,
  30. struct usb_interface *iface,
  31. struct list_head *midi_list,
  32. const struct snd_usb_audio_quirk *quirk,
  33. unsigned int usb_id);
  34. static inline int snd_usbmidi_create(struct snd_card *card,
  35. struct usb_interface *iface,
  36. struct list_head *midi_list,
  37. const struct snd_usb_audio_quirk *quirk)
  38. {
  39. return __snd_usbmidi_create(card, iface, midi_list, quirk, 0);
  40. }
  41. void snd_usbmidi_input_stop(struct list_head *p);
  42. void snd_usbmidi_input_start(struct list_head *p);
  43. void snd_usbmidi_disconnect(struct list_head *p);
  44. void snd_usbmidi_suspend(struct list_head *p);
  45. void snd_usbmidi_resume(struct list_head *p);
  46. #endif /* __USBMIDI_H */