Skip to content

Commit 8bb7b68

Browse files
tiwaigregkh
authored andcommitted
ALSA: usb-audio: Update UMP group attributes for GTB blocks, too
commit ebaa86c upstream. 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: 0642a3c ("ALSA: ump: Update substream name from assigned FB names") Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fe33062 commit 8bb7b68

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

include/sound/ump.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ static inline int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
122122

123123
int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val);
124124
int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol);
125+
void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump);
125126

126127
/*
127128
* Some definitions for UMP

sound/core/ump.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static void snd_ump_proc_read(struct snd_info_entry *entry,
525525
}
526526

527527
/* update dir_bits and active flag for all groups in the client */
528-
static void update_group_attrs(struct snd_ump_endpoint *ump)
528+
void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump)
529529
{
530530
struct snd_ump_block *fb;
531531
struct snd_ump_group *group;
@@ -575,6 +575,7 @@ static void update_group_attrs(struct snd_ump_endpoint *ump)
575575
}
576576
}
577577
}
578+
EXPORT_SYMBOL_GPL(snd_ump_update_group_attrs);
578579

579580
/*
580581
* UMP endpoint and function block handling
@@ -848,7 +849,7 @@ static int ump_handle_fb_info_msg(struct snd_ump_endpoint *ump,
848849
if (fb) {
849850
fill_fb_info(ump, &fb->info, buf);
850851
if (ump->parsed) {
851-
update_group_attrs(ump);
852+
snd_ump_update_group_attrs(ump);
852853
seq_notify_fb_change(ump, fb);
853854
}
854855
}
@@ -880,7 +881,7 @@ static int ump_handle_fb_name_msg(struct snd_ump_endpoint *ump,
880881
buf->raw, 3);
881882
/* notify the FB name update to sequencer, too */
882883
if (ret > 0 && ump->parsed) {
883-
update_group_attrs(ump);
884+
snd_ump_update_group_attrs(ump);
884885
seq_notify_fb_change(ump, fb);
885886
}
886887
return ret;
@@ -1055,7 +1056,7 @@ int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump)
10551056
}
10561057

10571058
/* initialize group attributions */
1058-
update_group_attrs(ump);
1059+
snd_ump_update_group_attrs(ump);
10591060

10601061
error:
10611062
ump->parsed = true;

sound/usb/midi2.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,8 @@ static int create_gtb_block(struct snd_usb_midi2_ump *rmidi, int dir, int blk)
873873
fb->info.flags |= SNDRV_UMP_BLOCK_IS_MIDI1 |
874874
SNDRV_UMP_BLOCK_IS_LOWSPEED;
875875

876+
snd_ump_update_group_attrs(rmidi->ump);
877+
876878
usb_audio_dbg(umidi->chip,
877879
"Created a UMP block %d from GTB, name=%s\n",
878880
blk, fb->info.name);

0 commit comments

Comments
 (0)