RE: [PATCH] usbcore: Select UAC3 configuration for audio if present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Oliver,

> -----Original Message-----
> From: linux-usb-owner@xxxxxxxxxxxxxxx [mailto:linux-usb-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Oliver Neukum
> Sent: Thursday, September 13, 2018 4:37 PM
> To: Gopal, Saranya <saranya.gopal@xxxxxxxxx>; linux-usb@xxxxxxxxxxxxxxx
> Cc: K V, Abhilash <abhilash.k.v@xxxxxxxxx>; Balaji, M <m.balaji@xxxxxxxxx>;
> Regupathy, Rajaram <rajaram.regupathy@xxxxxxxxx>;
> felipe.balbi@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] usbcore: Select UAC3 configuration for audio if present
> 
> On Di, 2018-09-11 at 23:36 +0530, saranya.gopal@xxxxxxxxx wrote:
> > @@ -121,6 +132,23 @@ int usb_choose_configuration(struct usb_device
> *udev)
> >  #endif
> >                 }
> >
> > +               /*
> > +                * Select first configuration as default for audio so that
> > +                * devices that don't comply with UAC3 protocol are supported.
> > +                * But, still iterate through other configurations and
> > +                * select UAC3 compliant config if present.
> > +                */
> > +               if (i == 0 && num_configs > 1 && desc && is_audio(desc)) {
> > +                       best = c;
> > +                       continue;
> > +               }
> > +
> > +               if (i > 0 && desc && is_audio(desc)) {
> > +                       if (is_uac3_config(desc))
> > +                               best = c;
> > +                               break;
> > +               }
> 
> Hi,
> 
> that looks like a special case. Couldn't we do
> 
> for (all configuration) {
> 
> 1. take first
> 2. if this configuration is generic and the current is specific change
> current
> 3. if if this configuration is the same interface class as current and
> protocol is higher, change current
> 

I have followed the same style used for Ethernet case in this function.
Do you foresee benefits with your approach over the existing one?

Thanks,
Saranya

> }
> 	Regards
> 		Oliver





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux