Commit a85ff0db authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

usb: gadget: midi2: More flexible MIDI 1.0 configuration

This patch allows users to set up MIDI 1.0 ports more flexibly.
Namely, instead of the fixed mapping only from FB 0, now multiple
block definitions are applied to build up the MIDI 1.0 mapping.

The each block config has midi1_first_group and midi1_num_groups
attributes, and those specify which Groups are used for MIDI 1.0.
Those fields must be within the UMP Groups defined in the block
itself.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230725062206.9674-8-tiwai@suse.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b437d2f
...@@ -39,14 +39,16 @@ Description: ...@@ -39,14 +39,16 @@ Description:
The attributes: The attributes:
=============== =============================================== ================= ==============================================
name Function Block name string name Function Block name string
direction 1: input, 2: output, 3: bidirectional direction 1: input, 2: output, 3: bidirectional
first_group The first UMP Group number (0-15) first_group The first UMP Group number (0-15)
num_groups The number of groups in this FB (1-16) num_groups The number of groups in this FB (1-16)
ui_hint 0: unknown, 1: receiver, 2: sender, 3: both midi1_first_group The first UMP Group number for MIDI 1.0 (0-15)
midi_ci_verison Supported MIDI-CI version number (8 bit) midi1_num_groups The number of groups for MIDI 1.0 (0-16)
is_midi1 Legacy MIDI 1.0 device (0, 1 or 2) ui_hint 0: unknown, 1: receiver, 2: sender, 3: both
sysex8_streams Max number of SysEx8 streams (8 bit) midi_ci_verison Supported MIDI-CI version number (8 bit)
active Active FB flag (0 or 1) is_midi1 Legacy MIDI 1.0 device (0, 1 or 2)
=============== =============================================== sysex8_streams Max number of SysEx8 streams (8 bit)
active Active FB flag (0 or 1)
================= ==============================================
...@@ -1009,22 +1009,24 @@ Each Endpoint subdirectory contains a subdirectory "block.0", which ...@@ -1009,22 +1009,24 @@ Each Endpoint subdirectory contains a subdirectory "block.0", which
represents the Function Block for Block 0 information. represents the Function Block for Block 0 information.
Its attributes are: Its attributes are:
=============== =============================================== ================= ===============================================
name Function Block name string name Function Block name string
direction Direction of this FB direction Direction of this FB
1: input, 2: output, or 3: bidirectional 1: input, 2: output, or 3: bidirectional
first_group The first UMP Group number (0-15) first_group The first UMP Group number (0-15)
num_groups The number of groups in this FB (1-16) num_groups The number of groups in this FB (1-16)
ui_hint UI-hint of this FB midi1_first_group The first UMP Group number for MIDI 1.0 (0-15)
0: unknown, 1: receiver, 2: sender, 3: both midi1_num_groups The number of groups for MIDI 1.0 (0-16)
midi_ci_verison Supported MIDI-CI version number (8 bit) ui_hint UI-hint of this FB
is_midi1 Legacy MIDI 1.0 device (0-2) 0: unknown, 1: receiver, 2: sender, 3: both
0: MIDI 2.0 device, midi_ci_verison Supported MIDI-CI version number (8 bit)
1: MIDI 1.0 without restriction, or is_midi1 Legacy MIDI 1.0 device (0-2)
2: MIDI 1.0 with low speed 0: MIDI 2.0 device,
sysex8_streams Max number of SysEx8 streams (8 bit) 1: MIDI 1.0 without restriction, or
active Bool flag for FB activity (0 or 1) 2: MIDI 1.0 with low speed
=============== =============================================== sysex8_streams Max number of SysEx8 streams (8 bit)
active Bool flag for FB activity (0 or 1)
================= ===============================================
If multiple Function Blocks are required, you can add more Function If multiple Function Blocks are required, you can add more Function
Blocks by creating subdirectories "block.<num>" with the corresponding Blocks by creating subdirectories "block.<num>" with the corresponding
......
This diff is collapsed.
...@@ -18,6 +18,8 @@ struct f_midi2_block_info { ...@@ -18,6 +18,8 @@ struct f_midi2_block_info {
unsigned int direction; /* FB direction: 1-3 */ unsigned int direction; /* FB direction: 1-3 */
unsigned int first_group; /* first UMP group: 0-15 */ unsigned int first_group; /* first UMP group: 0-15 */
unsigned int num_groups; /* number of UMP groups: 1-16 */ unsigned int num_groups; /* number of UMP groups: 1-16 */
unsigned int midi1_first_group; /* first UMP group for MIDI 1.0 */
unsigned int midi1_num_groups; /* number of UMP groups for MIDI 1.0 */
unsigned int ui_hint; /* UI-hint: 0-3 */ unsigned int ui_hint; /* UI-hint: 0-3 */
unsigned int midi_ci_version; /* MIDI-CI version: 0-255 */ unsigned int midi_ci_version; /* MIDI-CI version: 0-255 */
unsigned int sysex8_streams; /* number of sysex8 streams: 0-255 */ unsigned int sysex8_streams; /* number of sysex8 streams: 0-255 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment