summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/musb_host.h
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2013-04-10 21:55:45 +0200
committerFelipe Balbi <balbi@ti.com>2013-05-28 19:22:23 +0300
commit74c2e93600581d80695604126a3725a157d0ab72 (patch)
treef1cf1d021097255eaecb85219f372e012982d632 /drivers/usb/musb/musb_host.h
parent69ae2a70bfabbd6af6309bf723ec76493512dba1 (diff)
usb: musb: factor out hcd initalization
The musb struct is currently allocated along with the hcd, which makes it difficult to build a driver that only acts as gadget device. Fix this by allocating musb directly, and keep the hcd around as a pointer in the musb struct. struct hc_driver musb_hc_driver can now also be static to musb_host.c, and the macro musb_to_hcd() is just a pointer dereferencer for now, and will be eliminated later. 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.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h
index c63e5853df03..e47035e1e3c9 100644
--- a/drivers/usb/musb/musb_host.h
+++ b/drivers/usb/musb/musb_host.h
@@ -37,15 +37,9 @@
#include <linux/scatterlist.h>
-static inline struct usb_hcd *musb_to_hcd(struct musb *musb)
-{
- return container_of((void *) musb, struct usb_hcd, hcd_priv);
-}
+#define musb_to_hcd(MUSB) ((MUSB)->hcd)
-static inline struct musb *hcd_to_musb(struct usb_hcd *hcd)
-{
- return (struct musb *) (hcd->hcd_priv);
-}
+extern struct musb *hcd_to_musb(struct usb_hcd *);
/* stored in "usb_host_endpoint.hcpriv" for scheduled endpoints */
struct musb_qh {
@@ -85,10 +79,15 @@ static inline struct musb_qh *first_qh(struct list_head *q)
}
extern irqreturn_t musb_h_ep0_irq(struct musb *);
+extern int musb_host_alloc(struct musb *);
+extern void musb_host_tx(struct musb *, u8);
+extern void musb_host_rx(struct musb *, u8);
+extern void musb_root_disconnect(struct musb *musb);
+extern void musb_host_free(struct musb *);
+extern void musb_host_cleanup(struct musb *);
extern void musb_host_tx(struct musb *, u8);
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);
@@ -99,8 +98,6 @@ extern int musb_hub_control(struct usb_hcd *hcd,
u16 typeReq, u16 wValue, u16 wIndex,
char *buf, u16 wLength);
-extern const struct hc_driver musb_hc_driver;
-
static inline struct urb *next_urb(struct musb_qh *qh)
{
struct list_head *queue;