Daniel > Subject: [PATCH v2 07/11] usb: musb: add Kconfig options for HOST, GAGDET > or DUAL_ROLE modes > > This makes building the actual object files optional to the selected > mode, which saves users who know which kind of USB mode support they > need some binary size. > > Unimplemented functions are stubbed out with static inline functions. > > Signed-off-by: Daniel Mack <zonque@xxxxxxxxx> > --- > drivers/usb/musb/Kconfig | 29 +++++++++++++++++++++++++++++ > drivers/usb/musb/Makefile | 10 ++++++++-- > drivers/usb/musb/musb_gadget.h | 21 +++++++++++++++++++++ > drivers/usb/musb/musb_host.h | 29 +++++++++++++++++++++++++++-- > 4 files changed, 85 insertions(+), 4 deletions(-) > > diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig > index 47442d3..aab1568 100644 > --- a/drivers/usb/musb/Kconfig > +++ b/drivers/usb/musb/Kconfig > @@ -28,6 +28,35 @@ config USB_MUSB_HDRC > if USB_MUSB_HDRC > > choice > + bool "MUSB Mode Selection" > + default USB_MUSB_DUAL_ROLE if (USB && USB_GADGET) > + default USB_MUSB_HOST if (USB && !USB_GADGET) > + default USB_MUSB_GADGET if (!USB && USB_GADGET) > + > +config USB_MUSB_HOST > + bool "Host only mode" > + depends on USB > + help > + Select this when you want to use MUSB in host mode only, > + thereby the gadget feature will be regressed. > + > +config USB_MUSB_GADGET > + bool "Gadget only mode" > + depends on USB_GADGET > + help > + Select this when you want to use MUSB in gadget mode only, > + thereby the host feature will be regressed. > + > +config USB_MUSB_DUAL_ROLE > + bool "Dual Role mode" > + depends on (USB && USB_GADGET) > + help > + This is the default mode of working of MUSB controller where > + both host and gadget features are enabled. > + > +endchoice How do you cater for multi-instance support? Where one controller to force as host and other as device (similar to am33x beagle configuration). In general for all combination possible like <host, host> <host, device> <device, host> <dual, dual> etc. -- Ravi B -- 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