On Wed, May 27, 2015 at 07:50:01PM +0800, Li Jun wrote: > From: Macpaul Lin <macpaul@xxxxxxxxx> > > Add CONFIG_USB_OTG_VERSION to identify the OTG and EH supplement release number > with which the OTG device is compliant, also update the usb_otg_descriptor for > OTG 2.0 and later release to include this OTG version number. > > Signed-off-by: Macpaul Lin <macpaul@xxxxxxxxx> > Signed-off-by: Li Jun <jun.li@xxxxxxxxxxxxx> > --- > drivers/usb/core/Kconfig | 11 +++++++++++ > include/uapi/linux/usb/ch9.h | 7 ++++++- > 2 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig > index cc0ced0..566a6c6 100644 > --- a/drivers/usb/core/Kconfig > +++ b/drivers/usb/core/Kconfig > @@ -55,6 +55,17 @@ config USB_OTG > Select this only if your board has Mini-AB/Micro-AB > connector. > > +config USB_OTG_VERSION > + int "OTG and EH supplement release version number" > + depends on USB_OTG > + default 13 > + range 0 30 > + help > + OTG and EH supplement release number(e.g. 13 is for OTG 1.3, 20 is > + for OTG 2.0). This field will be converted to be bcdOTG in binary-coded > + decimal of otg descriptor and identifies the release of the OTG and EH > + supplement with which the device and its descriptors are compliant. > + Hi Jun, Per previous discussion, in order to support multi-platform, we should not use Kconfig entry for different otg versions, instead we need to define several otg descriptor definitions, and choose one of them according to platform parameters. > config USB_OTG_WHITELIST > bool "Rely on OTG and EH Targeted Peripherals List" > depends on USB > diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h > index aa33fd1..67204f1 100644 > --- a/include/uapi/linux/usb/ch9.h > +++ b/include/uapi/linux/usb/ch9.h > @@ -666,12 +666,17 @@ struct usb_qualifier_descriptor { > > /*-------------------------------------------------------------------------*/ > > -/* USB_DT_OTG (from OTG 1.0a supplement) */ > +/* USB_DT_OTG */ > struct usb_otg_descriptor { > __u8 bLength; > __u8 bDescriptorType; > > __u8 bmAttributes; /* support for HNP, SRP, etc */ > +#ifdef CONFIG_USB_OTG_VERSION > +#if CONFIG_USB_OTG_VERSION >= 20 > + __le16 bcdOTG; /* USB OTG version number */ > +#endif > +#endif > } __attribute__ ((packed)); > > /* from usb_otg_descriptor.bmAttributes */ > -- > 1.9.1 > -- Best Regards, Peter Chen -- 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