From patchwork Sat Apr 9 09:21:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 8787801 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C8789F39A for ; Sat, 9 Apr 2016 09:22:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 798242035E for ; Sat, 9 Apr 2016 09:22:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 41D1320357 for ; Sat, 9 Apr 2016 09:22:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3286E2667F5; Sat, 9 Apr 2016 11:22:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6AED6262618; Sat, 9 Apr 2016 11:22:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1568C262618; Sat, 9 Apr 2016 11:22:03 +0200 (CEST) Received: from mail.zonque.de (svenfoo.org [82.94.215.22]) by alsa0.perex.cz (Postfix) with ESMTP id 00D482617E0 for ; Sat, 9 Apr 2016 11:21:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 7ECB6C000F; Sat, 9 Apr 2016 11:21:54 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CdGJ-tMbcXdS; Sat, 9 Apr 2016 11:21:54 +0200 (CEST) Received: from tamtam.fritz.box (p5DDC7850.dip0.t-ipconnect.de [93.220.120.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id CE898C00B7; Sat, 9 Apr 2016 11:21:53 +0200 (CEST) From: Daniel Mack To: alsa-devel@alsa-project.org Date: Sat, 9 Apr 2016 11:21:47 +0200 Message-Id: <1460193708-17889-2-git-send-email-daniel@zonque.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1460193708-17889-1-git-send-email-daniel@zonque.org> References: <1460193708-17889-1-git-send-email-daniel@zonque.org> Cc: tiwai@suse.de, orm.finnendahl@selma.hfmdk-frankfurt.de, clemens@ladisch.de, jan.baumgart@selma.hfmdk-frankfurt.de, Daniel Mack Subject: [alsa-devel] [PATCH v2 2/2] sound: usb: allow clock source validity interrupts X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 unit ID is unique for a given device. Signed-off-by: Daniel Mack --- sound/usb/mixer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index cab6f52..652e281 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -2389,7 +2389,13 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer, continue; info = (struct usb_mixer_elem_info *)list; - if (info->control != control) + + /* + * Allow any value of 'control' in case there is only one + * mixer element with the given unit ID. + */ + if (info->control != control && + (list != mixer->id_elems[unitid] || list->next_id_elem)) continue; switch (attribute) {