diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-06-12 11:10:53 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-06-12 19:22:34 +0300 |
commit | 01dfa8e969dbbc72fc4564e8d61c905c4f3a2352 (patch) | |
tree | f8c3181d29e56c08ac6026a2d58f4495fd830900 /sound/core | |
parent | 6a8b4800ae54e9ceb8d017bcfb61d04ff0da90f2 (diff) | |
download | linux-01dfa8e969dbbc72fc4564e8d61c905c4f3a2352.tar.xz |
ALSA: ump: Add info flag bit for static blocks
UMP v1.1 spec allows to inform whether the function blocks are static
and not dynamically updated. Add a new flag bit to
snd_ump_endpoint_info to reflect that attribute, too.
The flag is set when a USB MIDI device is still in the old MIDI 2.0
without UMP 1.1 support. Then the driver falls back to GTBs, and they
are supposed to be static-only.
Link: https://lore.kernel.org/r/20230612081054.17200-10-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/ump.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/core/ump.c b/sound/core/ump.c index f364bb290d3a..a64dc2d8a129 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -490,6 +490,8 @@ static void snd_ump_proc_read(struct snd_info_entry *entry, ump->info.sw_revision[2], ump->info.sw_revision[3]); } + snd_iprintf(buffer, "Static Blocks: %s\n", + (ump->info.flags & SNDRV_UMP_EP_INFO_STATIC_BLOCKS) ? "Yes" : "No"); snd_iprintf(buffer, "Num Blocks: %d\n\n", ump->info.num_blocks); list_for_each_entry(fb, &ump->block_list, list) { @@ -608,6 +610,9 @@ static int ump_handle_ep_info_msg(struct snd_ump_endpoint *ump, ump->info.num_blocks = 1; } + if (buf->ep_info.static_function_block) + ump->info.flags |= SNDRV_UMP_EP_INFO_STATIC_BLOCKS; + ump->info.protocol_caps = (buf->ep_info.protocol << 8) | buf->ep_info.jrts; @@ -708,6 +713,12 @@ static bool is_fb_info_updated(struct snd_ump_endpoint *ump, { char tmpbuf[offsetof(struct snd_ump_block_info, name)]; + if (ump->info.flags & SNDRV_UMP_EP_INFO_STATIC_BLOCKS) { + ump_info(ump, "Skipping static FB info update (blk#%d)\n", + fb->info.block_id); + return 0; + } + memcpy(tmpbuf, &fb->info, sizeof(tmpbuf)); fill_fb_info(ump, (struct snd_ump_block_info *)tmpbuf, buf); return memcmp(&fb->info, tmpbuf, sizeof(tmpbuf)) != 0; |