aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_host.h
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-04-10 15:55:46 -0400
committerFelipe Balbi <balbi@ti.com>2013-05-28 12:22:23 -0400
commitb7b741ea38a32336b45870b76aaec1abe57badd0 (patch)
tree10d48d17c988e5f6b6743bd3d6eb97f9bc0e0679 /drivers/usb/musb/musb_host.h
parent74c2e93600581d80695604126a3725a157d0ab72 (diff)
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 e47035e1e3c9..1ce6e4ec9021 100644
--- a/drivers/usb/musb/musb_host.h
+++ b/drivers/usb/musb/musb_host.h
@@ -39,8 +39,6 @@
39 39
40#define musb_to_hcd(MUSB) ((MUSB)->hcd) 40#define musb_to_hcd(MUSB) ((MUSB)->hcd)
41 41
42extern struct musb *hcd_to_musb(struct usb_hcd *);
43
44/* stored in "usb_host_endpoint.hcpriv" for scheduled endpoints */ 42/* stored in "usb_host_endpoint.hcpriv" for scheduled endpoints */
45struct musb_qh { 43struct musb_qh {
46 struct usb_host_endpoint *hep; /* usbcore info */ 44 struct usb_host_endpoint *hep; /* usbcore info */
@@ -78,6 +76,9 @@ static inline struct musb_qh *first_qh(struct list_head *q)
78 return list_entry(q->next, struct musb_qh, ring); 76 return list_entry(q->next, struct musb_qh, ring);
79} 77}
80 78
79
80#if IS_ENABLED(CONFIG_USB_MUSB_HOST) || IS_ENABLED(CONFIG_USB_MUSB_DUAL_ROLE)
81extern struct musb *hcd_to_musb(struct usb_hcd *);
81extern irqreturn_t musb_h_ep0_irq(struct musb *); 82extern irqreturn_t musb_h_ep0_irq(struct musb *);
82extern int musb_host_alloc(struct musb *); 83extern int musb_host_alloc(struct musb *);
83extern void musb_host_tx(struct musb *, u8); 84extern void musb_host_tx(struct musb *, u8);
@@ -90,6 +91,30 @@ extern void musb_host_rx(struct musb *, u8);
90extern void musb_root_disconnect(struct musb *musb); 91extern void musb_root_disconnect(struct musb *musb);
91extern void musb_host_resume_root_hub(struct musb *musb); 92extern void musb_host_resume_root_hub(struct musb *musb);
92extern void musb_host_poke_root_hub(struct musb *musb); 93extern void musb_host_poke_root_hub(struct musb *musb);
94#else
95static inline struct musb *hcd_to_musb(struct usb_hcd *hcd)
96{
97 return NULL;
98}
99
100static inline irqreturn_t musb_h_ep0_irq(struct musb *musb)
101{
102 return 0;
103}
104
105static inline int musb_host_alloc(struct musb *musb)
106{
107 return 0;
108}
109
110static inline void musb_host_free(struct musb *musb) {}
111static inline void musb_host_tx(struct musb *musb, u8 epnum) {}
112static inline void musb_host_rx(struct musb *musb, u8 epnum) {}
113static inline void musb_root_disconnect(struct musb *musb) {}
114static inline void musb_host_resume_root_hub(struct musb *musb) {}
115static inline void musb_host_poll_rh_status(struct musb *musb) {}
116static inline void musb_host_poke_root_hub(struct musb *musb) {}
117#endif
93 118
94struct usb_hcd; 119struct usb_hcd;
95 120