diff options
author | Daniel Mack <zonque@gmail.com> | 2013-04-10 15:55:47 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-05-28 12:22:24 -0400 |
commit | 2cc65feab2f18dfa4297209829ce228989c7356b (patch) | |
tree | 83666f8e5a3a445e11cf891dab4458588df52ed5 /drivers/usb/musb/musb_host.c | |
parent | b7b741ea38a32336b45870b76aaec1abe57badd0 (diff) |
usb: musb: add musb_host_setup() and musb_host_cleanup()
This patch re-introduces the bits that are necessary to use the musb
controller in host mode.
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.c')
-rw-r--r-- | drivers/usb/musb/musb_host.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index e6ece8a4e8b6..6057c2363e86 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -2640,6 +2640,27 @@ void musb_host_free(struct musb *musb) | |||
2640 | usb_put_hcd(musb->hcd); | 2640 | usb_put_hcd(musb->hcd); |
2641 | } | 2641 | } |
2642 | 2642 | ||
2643 | int musb_host_setup(struct musb *musb, int power_budget) | ||
2644 | { | ||
2645 | int ret; | ||
2646 | struct usb_hcd *hcd = musb->hcd; | ||
2647 | |||
2648 | MUSB_HST_MODE(musb); | ||
2649 | musb->xceiv->otg->default_a = 1; | ||
2650 | musb->xceiv->state = OTG_STATE_A_IDLE; | ||
2651 | |||
2652 | otg_set_host(musb->xceiv->otg, &hcd->self); | ||
2653 | hcd->self.otg_port = 1; | ||
2654 | musb->xceiv->otg->host = &hcd->self; | ||
2655 | hcd->power_budget = 2 * (power_budget ? : 250); | ||
2656 | |||
2657 | ret = usb_add_hcd(hcd, 0, 0); | ||
2658 | if (ret < 0) | ||
2659 | return ret; | ||
2660 | |||
2661 | return 0; | ||
2662 | } | ||
2663 | |||
2643 | void musb_host_resume_root_hub(struct musb *musb) | 2664 | void musb_host_resume_root_hub(struct musb *musb) |
2644 | { | 2665 | { |
2645 | usb_hcd_resume_root_hub(musb->hcd); | 2666 | usb_hcd_resume_root_hub(musb->hcd); |