Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 633dc339 authored by Hemant Kumar's avatar Hemant Kumar Committed by Mayank Rana
Browse files

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: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 78c7c287
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
#include <linux/irq.h>
#include <linux/extcon.h>
#include <linux/reset.h>
#include <linux/clk/qcom.h>

#include "power.h"
#include "core.h"
@@ -1919,6 +1920,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);
	/*