RE: [PATCH 06/41] usb: gadget: add max_speed to usb_composite_driver

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

 



Hi Alan

> > > @@ -165,6 +165,11 @@ static struct usb_composite_driver
> audio_driver = {
> > >  	.name		= "g_audio",
> > >  	.dev		= &device_desc,
> > >  	.strings	= audio_strings,
> > > +#ifdef CONFIG_USB_GADGET_DUALSPEED
> > > +	.max_speed		= USB_SPEED_HIGH,
> > > +#else
> > > +	.max_speed		= USB_SPEED_FULL,
> > > +#endif /* CONFIG_USB_GADGET_DUALSPEED */
> >
> > Really?
> >
> > Come on, this is a mess, we don't want #ifdefs in .c files for a
> reason,
> > and this is an example of that.
> 
> This was discussed in a recent email exchange.  Those #ifdefs are
> completely unnecessary: max_speed is supposed to be the maximum speed
> supported by the driver, regardless of what the hardware allows.
> 
> In this example, the code should simply say:
> 
> 	.max_speed	= USB_SPEED_HIGH,
> 
> The other drivers should be handled similarly.
> 

I've started fixing the gadget drivers and removing the above ifdef as we
discussed but it seems to me that the change is a bit more complicated. All
gadget drivers provide hs discriptors if gadget_is_dual_speed() returns
true, in other words - if CONFIG_USB_GADGET_DUALSPEED is defined. So if we
remove the #ifdef above we also need to update the gadget drivers to provide
HS descriptors without stipulating their addition on the
gadget_is_dual_speed().
The above seems to me like the complete solution.

Felipe - what do you think?

Thanks,
Tanya Brokhman
---
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.





--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux