Skip to content

Commit 8acd273

Browse files
committed
usb: device_next: usbd_midi: mark UMP group as 31.25kb/s from devicetree
Since a new device-tree property has been introduced to describe if a UMP group is limited to 31.25kb/s (like a physical MIDI DIN-5 port), this can be used in the USB UMP group terminal block descriptors, as specified in the USB-MIDI2.0 reference document [1], (in 5.4.2.1 Group Terminal Block Descriptor): Maximum Output Bandwidth Capability in 4KB/second. 0x0000 – 0xFFFF. Bandwidth is total for this Block, shared among all OUT Group Terminals. 0x0000 = Unknown or Not Fixed. 0x0001 = Rounded version of 31.25kb/s [1] https://www.usb.org/sites/default/files/USB%20MIDI%20v2_0.pdf Signed-off-by: Titouan Christophe <[email protected]>
1 parent e379ca0 commit 8acd273

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

subsys/usb/device_next/class/usbd_midi2.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -555,19 +555,19 @@ void usbd_midi_set_ops(const struct device *dev, const struct usbd_midi_ops *ops
555555
#define USBD_MIDI_VALIDATE_INSTANCE(n) \
556556
DT_INST_FOREACH_CHILD(n, USBD_MIDI_VALIDATE_GRPTRM_BLOCK)
557557

558-
#define USBD_MIDI2_INIT_GRPTRM_BLOCK_DESCRIPTOR(node) \
559-
{ \
560-
.bLength = sizeof(struct usb_midi_grptrm_block_descriptor), \
561-
.bDescriptorType = CS_GR_TRM_BLOCK, \
562-
.bDescriptorSubtype = GR_TRM_BLOCK, \
563-
.bGrpTrmBlkID = GRPTRM_BLOCK_ID(node), \
564-
.bGrpTrmBlkType = GRPTRM_BLOCK_TYPE(node), \
565-
.nGroupTrm = DT_REG_ADDR(node), \
566-
.nNumGroupTrm = DT_REG_SIZE(node), \
567-
.iBlockItem = 0, \
568-
.bMIDIProtocol = GRPTRM_PROTOCOL(node), \
569-
.wMaxInputBandwidth = 0x0000, \
570-
.wMaxOutputBandwidth = 0x0000, \
558+
#define USBD_MIDI2_INIT_GRPTRM_BLOCK_DESCRIPTOR(node) \
559+
{ \
560+
.bLength = sizeof(struct usb_midi_grptrm_block_descriptor), \
561+
.bDescriptorType = CS_GR_TRM_BLOCK, \
562+
.bDescriptorSubtype = GR_TRM_BLOCK, \
563+
.bGrpTrmBlkID = GRPTRM_BLOCK_ID(node), \
564+
.bGrpTrmBlkType = GRPTRM_BLOCK_TYPE(node), \
565+
.nGroupTrm = DT_REG_ADDR(node), \
566+
.nNumGroupTrm = DT_REG_SIZE(node), \
567+
.iBlockItem = 0, \
568+
.bMIDIProtocol = GRPTRM_PROTOCOL(node), \
569+
.wMaxInputBandwidth = sys_cpu_to_le16(DT_PROP(node, serial_31250bps)), \
570+
.wMaxOutputBandwidth = sys_cpu_to_le16(DT_PROP(node, serial_31250bps)), \
571571
}
572572

573573
#define USBD_MIDI2_GRPTRM_TOTAL_LEN(n) \

0 commit comments

Comments
 (0)