From patchwork Sun Nov 9 09:18:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 5260021 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 622D09F2F1 for ; Sun, 9 Nov 2014 09:18:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 961702015E for ; Sun, 9 Nov 2014 09:18:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5D9E620158 for ; Sun, 9 Nov 2014 09:18:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7DDC32604ED; Sun, 9 Nov 2014 10:18:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 748D82604E2; Sun, 9 Nov 2014 10:18:23 +0100 (CET) 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 B4C832604E4; Sun, 9 Nov 2014 10:18:21 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id C054B2604DE for ; Sun, 9 Nov 2014 10:18:13 +0100 (CET) Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 839A6AABA; Sun, 9 Nov 2014 09:18:13 +0000 (UTC) Date: Sun, 09 Nov 2014 10:18:13 +0100 Message-ID: From: Takashi Iwai To: Damien Zammit In-Reply-To: <545E1C21.3090803@gmail.com> References: <1415059597-18344-1-git-send-email-damien@zamaudio.com> <1415059597-18344-3-git-send-email-damien@zamaudio.com> <545E1C21.3090803@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org, Clemens Ladisch Subject: Re: [alsa-devel] [PATCH 2/2] snd-usb-audio: Add duplex mode for Digidesign Mbox 1 and enable mixer 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP At Sun, 09 Nov 2014 00:35:29 +1100, Damien Zammit wrote: > > Hi Takashi, > > On 07/11/14 01:15, Takashi Iwai wrote: > > Hmm, can we achieve this without introducing the new audioformats > > thing, e.g. with COMPOSITE, instead? > > I don't think COMPOSITE will work because the same interface has > multiple endpoints. My code provides a framework for other devices with > the same issue. I was told previously that this was the problem with > getting my previous attempt into the kernel. Or is this doable without > adding a struct? I think the only point is the check in create_composite_quirk(), where it marks the iface as claimed and skips the next entry that has been already claimed. However, the current code looks inconsistent -- it allows multiple entries only if the iface matches with the current one. Fixing it like below would make things working. It's a quick idea, so a bit more reviews would be needed, though. Clemens, what do you think? BTW, I won't take a look at you v2 series. If the change above really works, I'll brush up the patch below properly, so that you can include in your new patch series. Last but not least, please add maintainers to Cc when you post patches for reviewing. thanks, Takashi Reviewed-by: Clemens Ladisch --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -58,9 +58,17 @@ static int create_composite_quirk(struct snd_usb_audio *chip, err = snd_usb_create_quirk(chip, iface, driver, quirk); if (err < 0) return err; - if (quirk->ifnum != probed_ifnum) + } + + for (quirk = quirk->data; quirk->ifnum >= 0; ++quirk) { + iface = usb_ifnum_to_if(chip->dev, quirk->ifnum); + if (!iface) + continue; + if (quirk->ifnum != probed_ifnum && + !usb_interface_claimed(iface)) usb_driver_claim_interface(driver, iface, (void *)-1L); } + return 0; }