zephyr/dts/bindings/usb
Titouan Christophe c525e7a0a5 usb: device_next: add new MIDI 2.0 device class
This adds a new USB device class (based on usb/device_next) that implements
revision 2.0 of the MIDIStreaming interface, a sub-class of the USB audio
device class. In practice, the MIDI interface is much more simple and has
little in common with Audio, so it makes sense to have it as a separate
class driver.

MIDI inputs and outputs are configured through the device tree, under a
node `compatible = "zephyr,usb-midi"`. As per the USB-MIDI2.0 spec,
a single usb-midi interface can convey up to 16 Universal MIDI groups,
comprising 16 channels each. Data is carried from/to the host via
so-called Group Terminals, that are organized in Group Terminal Blocks.
They are represented as children of the usb-midi interface in the device
tree.

From the Zephyr application programmer perspective, MIDI data is exchanged
with the host through the device associated with the `zephyr,usb-midi`
interface, using the following API:

* Send a Universal MIDI Packet to the host: `usb_midi_send(device, pkt)`
* Universal MIDI Packets from the host are delivered to the function passed
  in `usb_midi_set_ops(device, &{.rx_packet_cb = handler})`

Compliant USB-MIDI 2.0 devices are required to expose a USB-MIDI1.0
interface as alt setting 0, and the 2.0 interface on alt setting 1.
To avoid the extra complexity of generating backward compatible USB
descriptors and translating Universal MIDI Packets from/to the old
USB-MIDI1.0 format, this driver generates an empty MIDI1.0 interface
(without any input/output); and therefore will only be able to exchange
MIDI data when the host has explicitely enabled MIDI2.0 (alt setting 1).

This implementation is based on the following documents, which are referred
to in the inline comments:

* `midi20`:
    Universal Serial Bus Device Class Definition for MIDI Devices
    Release 2.0
    https://www.usb.org/sites/default/files/USB%20MIDI%20v2_0.pdf
* `ump112`:
    Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol
      With MIDI 1.0 Protocol in UMP Format
    Document Version 1.1.2
    https://midi.org/universal-midi-packet-ump-and-midi-2-0-protocol-specification

Signed-off-by: Titouan Christophe <moiandme@gmail.com>
2025-01-31 19:50:26 +01:00
..
renesas drivers: udc: add support for Renesas RA USB device 2024-12-12 16:23:48 +01:00
uac2
ambiq,usb.yaml dt-bindings: apollo4p: add ambiq usb binding 2024-11-16 15:07:29 -05:00
atmel,sam0-usb.yaml
atmel,sam-usbc.yaml
atmel,sam-usbhs.yaml
diodes,pi3usb9201.yaml
ite,it82xx2-usb.yaml
maxim,max3421e_spi.yaml
nordic,nrf-usbd.yaml
nuvoton,numaker-usbd.yaml
nxp,ehci.yaml dts: bindings: usb: Change the property names in the DTS 2025-01-15 19:05:54 +01:00
nxp,kinetis-usbd.yaml dts: usb: Add no-voltage-regulator property to nxp,kinetis-usbd binding 2024-10-25 05:11:44 +01:00
nxp,lpcip3511.yaml dts: bindings: usb: Change the property names in the DTS 2025-01-15 19:05:54 +01:00
nxp,mcux-usbd.yaml
nxp,usbphy.yaml
raspberrypi,pico-usbd.yaml drivers: usb_dc_rpi_pico: Implemented vbus detection handling 2024-10-17 10:47:15 -04:00
renesas,smartbond-usbd.yaml drivers: usb: udc: add Smartbond UDC driver 2024-10-22 20:41:55 +02:00
snps,designware-usb.yaml
snps,dwc2.yaml
st,stm32-otgfs.yaml
st,stm32-otghs.yaml
st,stm32-usb.yaml
st,stm32f4-fsotg.yaml
usb-audio-feature-volume.yaml
usb-audio-hp.yaml
usb-audio-hs.yaml
usb-audio-mic.yaml
usb-audio.yaml
usb-bc12.yaml
usb-controller.yaml
usb-ep.yaml
zephyr,hid-device.yaml
zephyr,midi2-device.yaml usb: device_next: add new MIDI 2.0 device class 2025-01-31 19:50:26 +01:00
zephyr,native-posix-udc.yaml
zephyr,udc-skeleton.yaml
zephyr,udc-virtual.yaml
zephyr,uhc-virtual.yaml