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>
This commit is contained in:
Daniel Mack
2013-04-10 21:55:46 +02:00
committed by Felipe Balbi
parent 74c2e93600
commit b7b741ea38
4 changed files with 79 additions and 4 deletions

View File

@@ -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,