diff options
author | Daniel Mack <zonque@gmail.com> | 2013-04-10 23:55:46 +0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-05-28 20:22:23 +0400 |
commit | b7b741ea38a32336b45870b76aaec1abe57badd0 (patch) | |
tree | 10d48d17c988e5f6b6743bd3d6eb97f9bc0e0679 /drivers/usb/musb/musb_gadget.h | |
parent | 74c2e93600581d80695604126a3725a157d0ab72 (diff) | |
download | linux-b7b741ea38a32336b45870b76aaec1abe57badd0.tar.xz |
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@gmail.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_gadget.h')
-rw-r--r-- | drivers/usb/musb/musb_gadget.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h index 75f821cc3d98..0314dfc770c7 100644 --- a/drivers/usb/musb/musb_gadget.h +++ b/drivers/usb/musb/musb_gadget.h @@ -37,6 +37,7 @@ #include <linux/list.h> +#if IS_ENABLED(CONFIG_USB_MUSB_GADGET) || IS_ENABLED(CONFIG_USB_MUSB_DUAL_ROLE) extern irqreturn_t musb_g_ep0_irq(struct musb *); extern void musb_g_tx(struct musb *, u8); extern void musb_g_rx(struct musb *, u8); @@ -48,6 +49,26 @@ extern void musb_g_disconnect(struct musb *); extern void musb_gadget_cleanup(struct musb *); extern int musb_gadget_setup(struct musb *); +#else +static inline irqreturn_t musb_g_ep0_irq(struct musb *musb) +{ + return 0; +} + +static inline void musb_g_tx(struct musb *musb, u8 epnum) {} +static inline void musb_g_rx(struct musb *musb, u8 epnum) {} +static inline void musb_g_reset(struct musb *musb) {} +static inline void musb_g_suspend(struct musb *musb) {} +static inline void musb_g_resume(struct musb *musb) {} +static inline void musb_g_wakeup(struct musb *musb) {} +static inline void musb_g_disconnect(struct musb *musb) {} +static inline void musb_gadget_cleanup(struct musb *musb) {} +static inline int musb_gadget_setup(struct musb *musb) +{ + return 0; +} +#endif + enum buffer_map_state { UN_MAPPED = 0, PRE_MAPPED, |