From 9dfea8de0a3e9154f0d2ef4f08990c02acfb0240 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Wed, 10 Aug 2016 13:41:05 -0700 Subject: 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 --- drivers/usb/dwc3/dwc3-msm.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/usb') 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); /* -- cgit v1.2.3