summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorHemant Kumar <hemantk@codeaurora.org>2016-08-10 13:41:05 -0700
committerHemant Kumar <hemantk@codeaurora.org>2016-08-10 14:08:12 -0700
commit9dfea8de0a3e9154f0d2ef4f08990c02acfb0240 (patch)
treec704ae1dca4695e8b93db7e0f1bc5c2b878d4e28 /drivers/usb/dwc3
parente94b446eac88a43e42ecde105275d48b677ea5b3 (diff)
usb: dwc3: Use clock API to control the memory power states
GDSC driver is removing control for USB memory power states. DWC driver need to explicitly call clk_set_flag() API to turn off both memory core and periphery upon vbus off. When core clock is turned on both of them will be turn on automatically. Change-Id: I7e442daf51c6ece39b8fe5cc8a38d3405163c9b5 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/dwc3-msm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c
index 4d35de1c14c5..da6b177bfcb5 100644
--- a/drivers/usb/dwc3/dwc3-msm.c
+++ b/drivers/usb/dwc3/dwc3-msm.c
@@ -1927,6 +1927,12 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc)
clk_disable_unprepare(mdwc->bus_aggr_clk);
clk_disable_unprepare(mdwc->utmi_clk);
+ /* Memory core: OFF, Memory periphery: OFF */
+ if (!mdwc->in_host_mode && !mdwc->vbus_active) {
+ clk_set_flags(mdwc->core_clk, CLKFLAG_NORETAIN_MEM);
+ clk_set_flags(mdwc->core_clk, CLKFLAG_NORETAIN_PERIPH);
+ }
+
clk_set_rate(mdwc->core_clk, 19200000);
clk_disable_unprepare(mdwc->core_clk);
/*