Skip to content

Commit

Permalink
usb: musb: call musb_port_suspend from musb_bus_suspend
Browse files Browse the repository at this point in the history
Make musb_port_suspend() externally available, and call it when to host
goes into suspend. This allows the core to go into suspend while a
device is connected.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Daniel Mack authored and Felipe Balbi committed Nov 26, 2013
1 parent c338412 commit 94f7213
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions drivers/usb/musb/musb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -2433,6 +2433,8 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
struct musb *musb = hcd_to_musb(hcd);
u8 devctl;

musb_port_suspend(musb, true);

if (!is_host_active(musb))
return 0;

Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/musb/musb_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ 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);
extern void musb_port_suspend(struct musb *musb, bool do_suspend);
#else
static inline struct musb *hcd_to_musb(struct usb_hcd *hcd)
{
Expand Down Expand Up @@ -121,6 +122,7 @@ 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) {}
static inline void musb_port_suspend(struct musb *musb, bool do_suspend) {}
#endif

struct usb_hcd;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/musb/musb_virthub.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#include "musb_core.h"

static void musb_port_suspend(struct musb *musb, bool do_suspend)
void musb_port_suspend(struct musb *musb, bool do_suspend)
{
struct usb_otg *otg = musb->xceiv->otg;
u8 power;
Expand Down

0 comments on commit 94f7213

Please sign in to comment.