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 Jassi,

> >
> > 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.
> 
> Perhaps gadget drivers should rely on the 'is_dualspeed' flag provided
> by the UDC ?

You're right. Actually there is a comment in the implementation of gadget_is_dualspeed() that sais that "run time test should check g->is_dualspeed" although right now the return value from that function is according to #ifdef CONFIG_USB_GADGET_DUALSPEED. So what needs to be modified is the gadget_is_dualspeed() function and not the gadget drivers.

At the moment the CONFIG_USB_GADGET_DUALSPEED is defined for each UDC that supports HS, so the code will work. I'm not sure though that each of the existing UDCs update the is_dualspeed flag as they should. So I prefer not to change the implementation of gadget_is_dualspeed() since it requires to verify all the UDCs correct handling of it and it seems to me like a separate commit from what I'm doing now. 

> 
> IMHO that is the right thing to do - gadget driver declaring DUALSPEED
> support to host
> without the underlying UDC supporting it, is pointless.
> And the gadget driver should (must ?) support both speeds if UDC does
> so too.

According to the description of is_dualspeed  parameter in the gadget structure you're right: "True if the controller supports both high and full speed operations. If it does the gadget driver must also support both"

> Though that might mean some modifications to the gadget stack!

Hmmm... to the gadget stack? I would think that perhaps some modifications are required to gadget drivers that don't support HS at the moment, although I can't think of such. 
What modifications to the gadget stack do you have in mind?


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