]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: ump: Force 1 Group for MIDI1 FBs
authorTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2024 14:06:06 +0000 (16:06 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2024 14:17:51 +0000 (16:17 +0200)
When a Function Block declares it being a legacy MIDI1 device, it has
to be only with a single UMP Group.  Correct the attribute when a
device declares it wrongly.

Fixes: 37e0e14128e0 ("ALSA: ump: Support UMP Endpoint and Function Block parsing")
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20240722140610.10845-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/ump.c

index b325fcfa77d067e1bc9fe32fb6e0916285c17272..0f0d7e895c5aa920f7533832de8440a6621a7a3a 100644 (file)
@@ -733,6 +733,12 @@ static void fill_fb_info(struct snd_ump_endpoint *ump,
                info->block_id, info->direction, info->active,
                info->first_group, info->num_groups, info->midi_ci_version,
                info->sysex8_streams, info->flags);
+
+       if ((info->flags & SNDRV_UMP_BLOCK_IS_MIDI1) && info->num_groups != 1) {
+               info->num_groups = 1;
+               ump_dbg(ump, "FB %d: corrected groups to 1 for MIDI1\n",
+                       info->block_id);
+       }
 }
 
 /* check whether the FB info gets updated by the current message */