On Thu, Mar 26, 2015 at 03:38:38AM +0800, Macpaul Lin wrote:
> add supports OTG 2.0 for multi.c
> 
> Signed-off-by: Macpaul Lin <macp...@gmail.com>
> ---
>  drivers/usb/gadget/legacy/multi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/gadget/legacy/multi.c 
> b/drivers/usb/gadget/legacy/multi.c
> index 39d27bb..0f4005e 100644
> --- a/drivers/usb/gadget/legacy/multi.c
> +++ b/drivers/usb/gadget/legacy/multi.c
> @@ -89,6 +89,9 @@ static const struct usb_descriptor_header *otg_desc[] = {
>                * it would not be called "OTG" ...
>                */
>               .bmAttributes =         USB_OTG_SRP | USB_OTG_HNP,
> +#ifdef       CONFIG_USB_OTG20
> +             .bcdOTG =               cpu_to_le16(0x0200),
> +#endif
>       },
>       NULL,
>  };
> -- 
> 1.8.3.2
> 

Would you consider abstract most your changes for composite.c as API, like
usb_gadget_customize_otg_desc, and call it at here and other gadget
driver which needs to change.

At composite.c, you only need to copy configuration descriptor[0]
to request buffer.

It can align otg descriptor at two places as well as customize otg
descriptor according to platforms.

One more thing, the code in condition gadget_is_otg(usb_gadget) may
need for otg v2.0 device too, you may consider using gadget_is_otg
for all otg devices, and using gadget_is_otg13 and gadget_is_otg20
only for differences.

-- 

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

Reply via email to