EHCI: HSIC: Fix GPT timer count values used for resume sequence
The counter value to be loaded into GPT timer represents the time
in micro seconds minus 1 for the timer duration. The current code
incorrectly programs the timer. Fix it.
CRs-Fixed: 449090
Change-Id: I53eddb6b4323bbfaf0e3a1d3aaa0fb9120c70647
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
diff --git a/drivers/usb/host/ehci-msm-hsic.c b/drivers/usb/host/ehci-msm-hsic.c
index 443bee0..0512381 100644
--- a/drivers/usb/host/ehci-msm-hsic.c
+++ b/drivers/usb/host/ehci-msm-hsic.c
@@ -1038,8 +1038,8 @@
}
#define RESUME_RETRY_LIMIT 3
-#define RESUME_SIGNAL_TIME_MS (21 * 999)
-#define RESUME_SIGNAL_TIME_SOF_MS (23 * 999)
+#define RESUME_SIGNAL_TIME_USEC (21 * 1000)
+#define RESUME_SIGNAL_TIME_SOF_USEC (23 * 1000)
static int msm_hsic_resume_thread(void *data)
{
struct msm_hsic_hcd *mehci = data;
@@ -1120,14 +1120,15 @@
if (ehci->resume_sof_bug && resume_needed) {
if (!tight_resume) {
mehci->resume_again = 0;
- ehci_writel(ehci, GPT_LD(RESUME_SIGNAL_TIME_MS),
+ ehci_writel(ehci, GPT_LD(RESUME_SIGNAL_TIME_USEC - 1),
&mehci->timer->gptimer0_ld);
ehci_writel(ehci, GPT_RESET | GPT_RUN,
&mehci->timer->gptimer0_ctrl);
ehci_writel(ehci, INTR_MASK | STS_GPTIMER0_INTERRUPT,
&ehci->regs->intr_enable);
- ehci_writel(ehci, GPT_LD(RESUME_SIGNAL_TIME_SOF_MS),
+ ehci_writel(ehci, GPT_LD(
+ RESUME_SIGNAL_TIME_SOF_USEC - 1),
&mehci->timer->gptimer1_ld);
ehci_writel(ehci, GPT_RESET | GPT_RUN,
&mehci->timer->gptimer1_ctrl);