From patchwork Tue Nov 13 12:51:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1733831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 9658ADF280 for ; Tue, 13 Nov 2012 12:55:08 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYFzE-0006Xd-6z; Tue, 13 Nov 2012 12:53:04 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYFyx-0006Ry-65 for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2012 12:52:51 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDF00I11FRMXJC0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2012 21:52:44 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-87-50a2429cc9ba Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id C8.1F.01231.C9242A05; Tue, 13 Nov 2012 21:52:44 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MDF00872FQUGE30@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 13 Nov 2012 21:52:44 +0900 (KST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 1/4] ARM: EXYNOS: pm_domain: Detect domain state on registration from DT Date: Tue, 13 Nov 2012 13:51:52 +0100 Message-id: <1352811115-1198-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1352811115-1198-1-git-send-email-t.figa@samsung.com> References: <1352811115-1198-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jAd05TosCDK48lLbY9PgaqwOjx+Yl 9QGMUVw2Kak5mWWpRfp2CVwZj7ctYi/4JFDxff8E9gbGP7xdjJwcEgImEhMOXmWEsMUkLtxb z9bFyMUhJLCIUWLdif9MEM5mJollTS+ZQKrYBNQkPjc8YgOxRQRUJT63LWAHKWIWeM4o0bfg GQtIQlggVuLI+rNgY1mAipb+nA5m8wo4SmzbcIAVYp28xNP7fWCDOAWcJC6u/wAU5wDa5ijx u4N7AiPvAkaGVYyiqQXJBcVJ6bmGesWJucWleel6yfm5mxjBPn8mtYNxZYPFIUYBDkYlHt4b LgsDhFgTy4orcw8xSnAwK4nwGkgtChDiTUmsrEotyo8vKs1JLT7EKM3BoiTO2+yREiAkkJ5Y kpqdmlqQWgSTZeLglGpgXDLXNvP5GgF3x5tnQvtb9W8qH8+78PsP55IDevcuP78oJXzPsH29 /v5fO6ekBvqvWXvlXfQspUjevSbM+pV1jhXSJ/7XreK/sjp1q+mV3TUVB9Y6v5Urm1a2+2/q Rzsb5j8qtzM3vNYO9FwULPN+zq+mnb9CFKVPv+P/uo67MWNn8Lk6/9dfE5VYijMSDbWYi4oT AfbG5zH1AQAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121113_075247_724097_2E94B189 X-CRM114-Status: GOOD ( 11.07 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, linux-pm@vger.kernel.org, t.figa@samsung.com, tomasz.figa@gmail.com, rjw@sisk.pl, kyungmin.park@samsung.com, thomas.abraham@linaro.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Initial state of power domains might vary on different boards and with different bootloaders. This patch adds detection of initial state of power domains when being registered from DT. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park --- Documentation/devicetree/bindings/arm/exynos/power_domain.txt | 4 ---- arch/arm/mach-exynos/pm_domains.c | 8 +++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt index 6528e21..843b546 100644 --- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt +++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt @@ -9,10 +9,6 @@ Required Properties: - reg: physical base address of the controller and length of memory mapped region. -Optional Properties: -- samsung,exynos4210-pd-off: Specifies that the power domain is in turned-off - state during boot and remains to be turned-off until explicitly turned-on. - Example: lcd0: power-domain-lcd0 { diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c index c0bc83a..d1abc1a 100644 --- a/arch/arm/mach-exynos/pm_domains.c +++ b/arch/arm/mach-exynos/pm_domains.c @@ -89,6 +89,7 @@ static __init int exynos_pm_dt_parse_domains(void) for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") { struct exynos_pm_domain *pd; + int on; pd = kzalloc(sizeof(*pd), GFP_KERNEL); if (!pd) { @@ -97,14 +98,15 @@ static __init int exynos_pm_dt_parse_domains(void) return -ENOMEM; } - if (of_get_property(np, "samsung,exynos4210-pd-off", NULL)) - pd->is_off = true; pd->name = np->name; pd->base = of_iomap(np, 0); pd->pd.power_off = exynos_pd_power_off; pd->pd.power_on = exynos_pd_power_on; pd->pd.of_node = np; - pm_genpd_init(&pd->pd, NULL, false); + + on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN; + + pm_genpd_init(&pd->pd, NULL, !on); } return 0; }