[alsa-devel] [PATCH v2 08/10] ALSA: usb-audio: conditional interface altsetting
Eldad Zack
eldad at fogrefinery.com
Thu Aug 22 20:00:20 CEST 2013
On Thu, 22 Aug 2013, Clemens Ladisch wrote:
> Eldad Zack wrote:
> > This patch moves all of the alternate setting operations for pcm
> > ops to one function which checks if we can do so.
>
> > +static int get_cur_altset_idx(struct usb_device *dev, int ifnum)
> > +{
> > + ...
> > + return altsd->bAlternateSetting;
>
> Please note that there are two methods to identify alternate settings:
> the number, which is the value in bAlternateSetting, and the index,
> which is the index in the descriptor array. There might be some wording
> in the USB spec that these two values must be the same, but in reality,
> [insert standard rant about firmware writers], and bAlternateSetting
Yes, the size of mixer_quirks says it all...
> must be treated as a random ID value.
>
> In struct audioformat, both values are stored in the altsetting and
> altset_idx fields; struct usb_substream has only altset_idx.
>
> As far as I can see, you code always uses the name altset_idx for the
> number.
You are right of course. I meant the ID - I'll change the name to
"altsetting". And I'll have to change patch #10 as well, because it
actually wrong there.
Thanks again, Clemens!
Cheers,
Eldad
More information about the Alsa-devel
mailing list