Hi On Thu, Apr 04, 2013 at 09:50:10PM +0200, Daniel Mack wrote: > 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_core.c | 1 - > drivers/usb/musb/musb_gadget.h | 21 +++++++++++++++++++++ > drivers/usb/musb/musb_host.h | 29 +++++++++++++++++++++++++++-- > 5 files changed, 85 insertions(+), 5 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 > + > +choice > prompt "Platform Glue Layer" > > config USB_MUSB_DAVINCI > diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile > index 3b85871..6b13a53 100644 > --- a/drivers/usb/musb/Makefile > +++ b/drivers/usb/musb/Makefile > @@ -6,10 +6,16 @@ obj-$(CONFIG_USB_MUSB_HDRC) += musb_hdrc.o > > musb_hdrc-y := musb_core.o > > -musb_hdrc-y += musb_gadget_ep0.o musb_gadget.o > -musb_hdrc-y += musb_virthub.o musb_host.o > musb_hdrc-$(CONFIG_DEBUG_FS) += musb_debugfs.o > > +ifneq ($(filter y,$(CONFIG_USB_MUSB_HOST) $(CONFIG_USB_MUSB_DUAL_ROLE)),) > + musb_hdrc-y += musb_virthub.o musb_host.o > +endif > + > +ifneq ($(filter y,$(CONFIG_USB_MUSB_GADGET) $(CONFIG_USB_MUSB_DUAL_ROLE)),) > + musb_hdrc-y += musb_gadget_ep0.o musb_gadget.o > +endif > + > # Hardware Glue Layer > obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o > obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o > diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c > index d5e9794..c637d36 100644 > --- a/drivers/usb/musb/musb_core.c > +++ b/drivers/usb/musb/musb_core.c > @@ -1958,7 +1958,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) > } > > status = musb_gadget_setup(musb); > - trailing change. -- balbi
Attachment:
signature.asc
Description: Digital signature