]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ALSA: usb-audio: uac1: Invalidate ctl on interrupt
authorJulian Scheel <julian@jusst.de>
Thu, 16 Nov 2017 16:35:17 +0000 (17:35 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:38:02 +0000 (15:38 -0400)
[ Upstream commit b2500b584cfd228d67e1e43daf27c8af865b499e ]

When an interrupt occurs, the value of at least one of the belonging
controls should have changed. To make sure they get re-read from device
on the next read, invalidate the cache. This was correctly implemented
for uac2 already, but missing for uac1.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/usb/mixer.c

index dbbc5609b453b3ad1f45a9ecd8fe817fcf5ca01f..33deb5ec8b7a1fb870001bc639871e2cc949c81b 100644 (file)
@@ -2403,9 +2403,14 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid)
 {
        struct usb_mixer_elem_list *list;
 
-       for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem)
+       for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem) {
+               struct usb_mixer_elem_info *info =
+                       (struct usb_mixer_elem_info *)list;
+               /* invalidate cache, so the value is read from the device */
+               info->cached = 0;
                snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
                               &list->kctl->id);
+       }
 }
 
 static void snd_usb_mixer_dump_cval(struct snd_info_buffer *buffer,