From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: [PATCH v4 5/9] ARM: shmobile: R-Mobile: Enable module clocks if !CONFIG_PM_RUNTIME Date: Mon, 3 Nov 2014 16:34:52 +0100 Message-ID: <1415028896-9005-6-git-send-email-geert+renesas@glider.be> References: <1415028896-9005-1-git-send-email-geert+renesas@glider.be> Return-path: In-Reply-To: <1415028896-9005-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Rafael J. Wysocki" , Simon Horman , Magnus Damm Cc: Ulf Hansson , Kevin Hilman , Grygorii Strashko , Philipp Zabel , Tomasz Figa , linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Geert Uytterhoeven List-Id: devicetree@vger.kernel.org If CONFIG_PM_RUNTIME is not set, the clocks must be enabled before the devices can be used. Currently these clocks are enabled by the !CONFIG_PM_RUNTIME version of pm_clk_notify, activated by the hack in drivers/sh/pm_runtime.c, but this will go away soon (at least for DT). On detach, disabling the clocks is already handled by pm_clk_destroy(). On system suspend/resume, disabling/enabling clocks is already handled from the genpd->dev_ops.{start,stop}() callbacks. Signed-off-by: Geert Uytterhoeven --- v4: - New. --- arch/arm/mach-shmobile/pm-rmobile.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 068608d5f54a9a64..6fb86cdb9fa2b3a7 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c @@ -117,6 +117,14 @@ static int rmobile_pd_attach_dev(struct device *dev) goto fail; } + if (!IS_ENABLED(CONFIG_PM_RUNTIME)) { + error = pm_clk_resume(dev); + if (error) { + dev_err(dev, "pm_clk_resume failed %d\n", error); + goto fail; + } + } + return 0; fail: -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html