Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Takashi Iwai <tiwai@suse.de>, Damien Zammit <damien.zammit@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 2/2] snd-usb-audio: Add duplex mode for	Digidesign Mbox 1 and enable mixer
Date: Sun, 09 Nov 2014 15:04:42 +0100	[thread overview]
Message-ID: <545F747A.7090002@ladisch.de> (raw)
In-Reply-To: <s5hk3343f6y.wl-tiwai@suse.de>

Takashi Iwai wrote:
> Damien Zammit wrote:
>> 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?

Reviewed-by: Clemens Ladisch <clemens@ladisch.de>

> ---
> --- 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;
>  }
>

  reply	other threads:[~2014-11-09 14:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  0:06 [PATCH 0/2] Digidesign Mbox 1 duplex mode and mixer Damien Zammit
2014-11-04  0:06 ` [PATCH 1/2] snd-usb-audio: Add mixer control for Digidesign Mbox 1 clock source Damien Zammit
2014-11-06 14:12   ` Takashi Iwai
2014-11-08 13:30     ` Damien Zammit
2014-11-09  9:02       ` Takashi Iwai
2014-11-04  0:06 ` [PATCH 2/2] snd-usb-audio: Add duplex mode for Digidesign Mbox 1 and enable mixer Damien Zammit
2014-11-06 14:15   ` Takashi Iwai
2014-11-08 13:35     ` Damien Zammit
2014-11-09  9:18       ` Takashi Iwai
2014-11-09 14:04         ` Clemens Ladisch [this message]
2014-11-09 17:27           ` Takashi Iwai
2014-11-09 23:45             ` Damien Zammit
2014-11-10  1:33               ` Damien Zammit
2014-11-10  6:47               ` Takashi Iwai
2014-11-10  7:34                 ` Damien Zammit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545F747A.7090002@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=damien.zammit@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox