Skip to content

Commit

Permalink
usb: musb: use new USB_RESUME_TIMEOUT
Browse files Browse the repository at this point in the history
Make sure we're using the new macro, so our
resume signaling will always pass certification.

Based on original work by Bin Liu <Bin Liu <b-liu@ti.com>>

Cc: Bin Liu <b-liu@ti.com>
Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Apr 7, 2015
1 parent b8fb6f7 commit 309be23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/usb.h>

#include "musb_core.h"

Expand Down Expand Up @@ -549,7 +550,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
(USB_PORT_STAT_C_SUSPEND << 16)
| MUSB_PORT_STAT_RESUME;
musb->rh_timer = jiffies
+ msecs_to_jiffies(20);
+ msecs_to_jiffies(USB_RESUME_TIMEOUT);
musb->need_finish_resume = 1;

musb->xceiv->otg->state = OTG_STATE_A_HOST;
Expand Down Expand Up @@ -2463,7 +2464,7 @@ static int musb_resume(struct device *dev)
if (musb->need_finish_resume) {
musb->need_finish_resume = 0;
schedule_delayed_work(&musb->finish_resume_work,
msecs_to_jiffies(20));
msecs_to_jiffies(USB_RESUME_TIMEOUT));
}

/*
Expand Down Expand Up @@ -2506,7 +2507,7 @@ static int musb_runtime_resume(struct device *dev)
if (musb->need_finish_resume) {
musb->need_finish_resume = 0;
schedule_delayed_work(&musb->finish_resume_work,
msecs_to_jiffies(20));
msecs_to_jiffies(USB_RESUME_TIMEOUT));
}

return 0;
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 @@ -136,7 +136,7 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)
/* later, GetPortStatus will stop RESUME signaling */
musb->port1_status |= MUSB_PORT_STAT_RESUME;
schedule_delayed_work(&musb->finish_resume_work,
msecs_to_jiffies(20));
msecs_to_jiffies(USB_RESUME_TIMEOUT));
}
}

Expand Down

0 comments on commit 309be23

Please sign in to comment.