Commit 191227d9 authored by Daniel Mack's avatar Daniel Mack Committed by Takashi Iwai

ALSA: usb-audio: allow clock source validity interrupts

miniDSP USBStreamer UAC2 devices send clock validity changes with the
control field set to zero. The current interrupt handler ignores all
packets if the control field does not match the mixer element's, but
it really should only do that in case that field is needed to
distinguish multiple elements with the same ID.

This patch implements a logic that lets notifications packets pass
if the element ID is unique for a given device.
Signed-off-by: default avatarDaniel Mack <daniel@zonque.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent cddaafb9
...@@ -2374,6 +2374,7 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer, ...@@ -2374,6 +2374,7 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer,
__u8 unitid = (index >> 8) & 0xff; __u8 unitid = (index >> 8) & 0xff;
__u8 control = (value >> 8) & 0xff; __u8 control = (value >> 8) & 0xff;
__u8 channel = value & 0xff; __u8 channel = value & 0xff;
unsigned int count = 0;
if (channel >= MAX_CHANNELS) { if (channel >= MAX_CHANNELS) {
usb_audio_dbg(mixer->chip, usb_audio_dbg(mixer->chip,
...@@ -2382,6 +2383,12 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer, ...@@ -2382,6 +2383,12 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer,
return; return;
} }
for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem)
count++;
if (count == 0)
return;
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 *info;
...@@ -2389,7 +2396,7 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer, ...@@ -2389,7 +2396,7 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer,
continue; continue;
info = (struct usb_mixer_elem_info *)list; info = (struct usb_mixer_elem_info *)list;
if (info->control != control) if (count > 1 && info->control != control)
continue; continue;
switch (attribute) { switch (attribute) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment