Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757444AbbBEMgr (ORCPT ); Thu, 5 Feb 2015 07:36:47 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:9051 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757366AbbBEMgQ (ORCPT ); Thu, 5 Feb 2015 07:36:16 -0500 X-AuditID: cbfec7f5-b7fc86d0000066b7-d3-54d3632b657a From: Andrzej Hajda To: linux-samsung-soc@vger.kernel.org Cc: Andrzej Hajda , Marek Szyprowski , Kyungmin Park , Kukjin Kim , javier.martinez@collabora.co.uk, Liquid.Acid@gmx.net, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC PATCH 2/3] arm/exynos/pm_domains: add support for async-bridge clocks Date: Thu, 05 Feb 2015 13:35:38 +0100 Message-id: <1423139739-19881-3-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1423139739-19881-1-git-send-email-a.hajda@samsung.com> References: <1423139739-19881-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgluLIzCtJLcpLzFFi42I5/e/4FV3t5MshBu/2ClncWneO1WL+ESBx 5et7Noujvwss+h+/ZrY42/SG3eLyrjlsFjPO72Oy6Pr5k81i7ZG77A5cHn+fX2fxWLxpP5vH plWdbB73u48zefRtWcXo8XmTXABbFJdNSmpOZllqkb5dAlfG6sdKBXuEK+4ebmdtYDzB38XI ySEhYCIx69UvFghbTOLCvfVsXYxcHEICSxklFr2YyATh9DFJdB+czQpSxSagKfF38002EFtE QFXic9sCdpAiZoGdTBKnPq1nAkkIC4RKzOu7xQxiswAVrf25DizOK+AssXD/LnaIdXISJ49N BhvKKeAiMe/pY6AzOIC2OUvMPFUxgZF3ASPDKkbR1NLkguKk9FwjveLE3OLSvHS95PzcTYyQ 0Pu6g3HpMatDjAIcjEo8vDe8LocIsSaWFVfmHmKU4GBWEuHdAhLiTUmsrEotyo8vKs1JLT7E yMTBKdXAyHXjQJkc63fuhnKpR00X4wMM1rDzZet1CEcHLSw4x9K3fdXZ8vd5ibJs878dFJ5c +qHu6v3zC2ZHOmz4+eBR/zTnTUo7Yo7/msj0qrTn/GKvNaLzYx4eN21dxR5nmcV3OJjdRVxz wuryMjXOQJuGRYf6uVyFD4bJ7b19R8Iw9OR/Tz7GD3ZHlViKMxINtZiLihMB0YrsnxsCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2652 Lines: 90 Since Exynos5420 there are async-bridges (ASB) between different IPs. These bridges must be operational during power domain on/off, ie. clocks used by these bridges should be enabled. This patch enabled these clocks during domain on/off. Signed-off-by: Andrzej Hajda --- arch/arm/mach-exynos/pm_domains.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index 0e2bc36..ecff522 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -37,6 +37,7 @@ struct exynos_pm_domain { struct clk *oscclk; struct clk *clk[MAX_CLK_PER_DOMAIN]; struct clk *pclk[MAX_CLK_PER_DOMAIN]; + struct clk *asb_clk[MAX_CLK_PER_DOMAIN]; }; static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) @@ -45,14 +46,19 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) void __iomem *base; u32 timeout, pwr; char *op; + int i; pd = container_of(domain, struct exynos_pm_domain, pd); base = pd->base; + for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { + if (IS_ERR(pd->asb_clk[i])) + break; + clk_prepare_enable(pd->asb_clk[i]); + } + /* Set oscclk before powering off a domain*/ if (!power_on) { - int i; - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { if (IS_ERR(pd->clk[i])) break; @@ -81,8 +87,6 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) /* Restore clocks after powering on a domain*/ if (power_on) { - int i; - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { if (IS_ERR(pd->clk[i])) break; @@ -92,6 +96,12 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) } } + for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { + if (IS_ERR(pd->asb_clk[i])) + break; + clk_disable_unprepare(pd->asb_clk[i]); + } + return 0; } @@ -137,6 +147,15 @@ static __init int exynos4_pm_init_power_domain(void) pd->pd.power_off = exynos_pd_power_off; pd->pd.power_on = exynos_pd_power_on; + for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { + char clk_name[8]; + + snprintf(clk_name, sizeof(clk_name), "asb%d", i); + pd->asb_clk[i] = clk_get(dev, clk_name); + if (IS_ERR(pd->asb_clk[i])) + break; + } + pd->oscclk = clk_get(dev, "oscclk"); if (IS_ERR(pd->oscclk)) goto no_clk; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/