diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-05-25 15:51:42 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-25 15:51:41 -0700 |
| commit | 3b0f0430c6fa1a63ff7cf0db652e543ee6d489e4 (patch) | |
| tree | 3cf3551a6ea7f19b93d782a35da01f71c75a2b00 /drivers/usb | |
| parent | c1a961ce2fb4bf74bc051a46d911b99fa9e56d92 (diff) | |
| parent | 5980a4dca56a22cda56e99f4a1b9e4c7e5b59f46 (diff) | |
Merge "ARM: dts: msm: Add USB2 device node for SDM660"
Diffstat (limited to 'drivers/usb')
| -rw-r--r-- | drivers/usb/dwc3/core.h | 2 | ||||
| -rw-r--r-- | drivers/usb/dwc3/dwc3-msm.c | 11 | ||||
| -rw-r--r-- | drivers/usb/phy/phy-msm-qusb.c | 3 |
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 453eee734b23..1b4fb562ce4b 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -840,6 +840,7 @@ struct dwc3_scratchpad_array { * @irq: irq number * @bh: tasklet which handles the interrupt * @irq_cnt: total irq count + * @last_irq_cnt: last irq count * @bh_completion_time: time taken for taklet completion * @bh_handled_evt_cnt: no. of events handled by tasklet per interrupt * @bh_dbg_index: index for capturing bh_completion_time and bh_handled_evt_cnt @@ -1028,6 +1029,7 @@ struct dwc3 { /* IRQ timing statistics */ int irq; unsigned long irq_cnt; + unsigned long last_irq_cnt; unsigned long ep_cmd_timeout_cnt; unsigned bh_completion_time[MAX_INTR_STATS]; unsigned bh_handled_evt_cnt[MAX_INTR_STATS]; diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index ad9d6cc4e23f..4ed46d9ca279 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -3321,16 +3321,19 @@ static void msm_dwc3_perf_vote_work(struct work_struct *w) struct dwc3_msm *mdwc = container_of(w, struct dwc3_msm, perf_vote_work.work); struct dwc3 *dwc = platform_get_drvdata(mdwc->dwc3); - static unsigned long last_irq_cnt; bool in_perf_mode = false; + int latency = mdwc->pm_qos_latency; + + if (!latency) + return; - if (dwc->irq_cnt - last_irq_cnt >= PM_QOS_THRESHOLD) + if (dwc->irq_cnt - dwc->last_irq_cnt >= PM_QOS_THRESHOLD) in_perf_mode = true; pr_debug("%s: in_perf_mode:%u, interrupts in last sample:%lu\n", - __func__, in_perf_mode, (dwc->irq_cnt - last_irq_cnt)); + __func__, in_perf_mode, (dwc->irq_cnt - dwc->last_irq_cnt)); - last_irq_cnt = dwc->irq_cnt; + dwc->last_irq_cnt = dwc->irq_cnt; msm_dwc3_perf_vote_update(mdwc, in_perf_mode); schedule_delayed_work(&mdwc->perf_vote_work, msecs_to_jiffies(1000 * PM_QOS_SAMPLE_SEC)); diff --git a/drivers/usb/phy/phy-msm-qusb.c b/drivers/usb/phy/phy-msm-qusb.c index 5867c6c204c9..6a2529ec1511 100644 --- a/drivers/usb/phy/phy-msm-qusb.c +++ b/drivers/usb/phy/phy-msm-qusb.c @@ -752,6 +752,9 @@ static int qusb_phy_set_suspend(struct usb_phy *phy, int suspend) writel_relaxed(0x00, qphy->base + QUSB2PHY_PORT_INTR_CTRL); + /* Disable PHY */ + writel_relaxed(POWER_DOWN, + qphy->base + QUSB2PHY_PORT_POWERDOWN); /* Make sure that above write is completed */ wmb(); |
