summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/musb_host.h
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-04-10 19:55:46 (GMT)
committerFelipe Balbi <balbi@ti.com>2013-05-28 16:22:23 (GMT)
commitb7b741ea38a32336b45870b76aaec1abe57badd0 (patch)
tree10d48d17c988e5f6b6743bd3d6eb97f9bc0e0679 /drivers/usb/musb/musb_host.h
parent74c2e93600581d80695604126a3725a157d0ab72 (diff)
downloadlinux-fsl-qoriq-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_host.h')
-rw-r--r--drivers/usb/musb/musb_host.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
index e47035e..1ce6e4e 100644
--- a/drivers/usb/musb/musb_host.h
+++ b/drivers/usb/musb/musb_host.h
@@ -39,8 +39,6 @@
#define musb_to_hcd(MUSB) ((MUSB)->hcd)
-extern struct musb *hcd_to_musb(struct usb_hcd *);
-
/* stored in "usb_host_endpoint.hcpriv" for scheduled endpoints */
struct musb_qh {
struct usb_host_endpoint *hep; /* usbcore info */
@@ -78,6 +76,9 @@ static inline struct musb_qh *first_qh(struct list_head *q)
return list_entry(q->next, struct musb_qh, ring);
}
+
+#if IS_ENABLED(CONFIG_USB_MUSB_HOST) || IS_ENABLED(CONFIG_USB_MUSB_DUAL_ROLE)
+extern struct musb *hcd_to_musb(struct usb_hcd *);
extern irqreturn_t musb_h_ep0_irq(struct musb *);
extern int musb_host_alloc(struct musb *);
extern void musb_host_tx(struct musb *, u8);
@@ -90,6 +91,30 @@ extern void musb_host_rx(struct musb *, u8);
extern void musb_root_disconnect(struct musb *musb);
extern void musb_host_resume_root_hub(struct musb *musb);
extern void musb_host_poke_root_hub(struct musb *musb);
+#else
+static inline struct musb *hcd_to_musb(struct usb_hcd *hcd)
+{
+ return NULL;
+}
+
+static inline irqreturn_t musb_h_ep0_irq(struct musb *musb)
+{
+ return 0;
+}
+
+static inline int musb_host_alloc(struct musb *musb)
+{
+ return 0;
+}
+
+static inline void musb_host_free(struct musb *musb) {}
+static inline void musb_host_tx(struct musb *musb, u8 epnum) {}
+static inline void musb_host_rx(struct musb *musb, u8 epnum) {}
+static inline void musb_root_disconnect(struct musb *musb) {}
+static inline void musb_host_resume_root_hub(struct musb *musb) {}
+static inline void musb_host_poll_rh_status(struct musb *musb) {}
+static inline void musb_host_poke_root_hub(struct musb *musb) {}
+#endif
struct usb_hcd;