]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ALSA: usb-audio: Update UMP group attributes for GTB blocks, too
authorTakashi Iwai <tiwai@suse.de>
Wed, 7 Aug 2024 09:22:59 +0000 (11:22 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 7 Aug 2024 09:31:38 +0000 (11:31 +0200)
When a FB is created from a GTB instead of UMP FB Info inquiry, we
missed the update of the corresponding UMP Group attributes.
Export the call of updater and let it be called from the USB driver.

Fixes: 0642a3c5cacc ("ALSA: ump: Update substream name from assigned FB names")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20240807092303.1935-5-tiwai@suse.de
include/sound/ump.h
sound/core/ump.c
sound/usb/midi2.c

index 7484f62fb234e37e74e677d4ddc5b28f7bd09e18..532c2c3ea28e3c13b485636c7bb932c684891369 100644 (file)
@@ -123,6 +123,7 @@ static inline int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
 
 int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val);
 int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol);
+void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump);
 
 /*
  * Some definitions for UMP
index 4502de891adff2cf83e155b37027b780722cda50..243ecdbb2a6e5f5cb003e5f6365e44ff56895b85 100644 (file)
@@ -525,7 +525,7 @@ static void snd_ump_proc_read(struct snd_info_entry *entry,
 }
 
 /* update dir_bits and active flag for all groups in the client */
-static void update_group_attrs(struct snd_ump_endpoint *ump)
+void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump)
 {
        struct snd_ump_block *fb;
        struct snd_ump_group *group;
@@ -578,6 +578,7 @@ static void update_group_attrs(struct snd_ump_endpoint *ump)
                }
        }
 }
+EXPORT_SYMBOL_GPL(snd_ump_update_group_attrs);
 
 /*
  * UMP endpoint and function block handling
@@ -863,7 +864,7 @@ static int ump_handle_fb_info_msg(struct snd_ump_endpoint *ump,
        if (fb) {
                fill_fb_info(ump, &fb->info, buf);
                if (ump->parsed) {
-                       update_group_attrs(ump);
+                       snd_ump_update_group_attrs(ump);
                        seq_notify_fb_change(ump, fb);
                }
        }
@@ -895,7 +896,7 @@ static int ump_handle_fb_name_msg(struct snd_ump_endpoint *ump,
                                buf->raw, 3);
        /* notify the FB name update to sequencer, too */
        if (ret > 0 && ump->parsed) {
-               update_group_attrs(ump);
+               snd_ump_update_group_attrs(ump);
                seq_notify_fb_change(ump, fb);
        }
        return ret;
@@ -1065,7 +1066,7 @@ int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump)
        }
 
        /* initialize group attributions */
-       update_group_attrs(ump);
+       snd_ump_update_group_attrs(ump);
 
  error:
        ump->parsed = true;
index 4fb43d9743d7d9a81d355faa284f37c35da755ff..692dfc3c182f0e39cf4db386181fbc31a262c811 100644 (file)
@@ -877,6 +877,8 @@ static int create_gtb_block(struct snd_usb_midi2_ump *rmidi, int dir, int blk)
                }
        }
 
+       snd_ump_update_group_attrs(rmidi->ump);
+
        usb_audio_dbg(umidi->chip,
                      "Created a UMP block %d from GTB, name=%s, flags=0x%x\n",
                      blk, fb->info.name, fb->info.flags);