mmc: sdhci-esdhc-imx: restore the per_clk rate in PM_RUNTIME
authorHaibo Chen <haibo.chen@nxp.com>
Wed, 19 Feb 2020 08:22:43 +0000 (16:22 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Mar 2020 13:35:41 +0000 (14:35 +0100)
commit5c11f1ffb02244e8cafd320fb130090a1d1db342
treebf4f3c7489e2910ea4438b0d0d204da9481f4a3c
parenta26a4f1baca55a05aecd8d7181802979a93e3d46
mmc: sdhci-esdhc-imx: restore the per_clk rate in PM_RUNTIME

When pm_runtime_suspend is run, a call to SCFW power off the SS (SS is a
power domain, usdhc belong to this SS power domain) in which the resource
resides is made. The SCFW can power off the SS if no other resource in
active in that SS. If so, all state associated with all the resources within
the SS that is powered off is lost, this includes the clock rates, clock state
etc. When pm_runtime_resume is called, the SS associated with that resource
is powered up. But the clocks are left in the default state.

This patch restore clock rate in pm_runtime_resume, make sure the
clock is right rather than depending on the default state setting
by SCFW.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/1582100563-20555-5-git-send-email-haibo.chen@nxp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-esdhc-imx.c