From patchwork Tue Nov 13 13:08:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 1733871 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 209213FCAE for ; Tue, 13 Nov 2012 13:09:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752973Ab2KMNJd (ORCPT ); Tue, 13 Nov 2012 08:09:33 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:30115 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752959Ab2KMNJc (ORCPT ); Tue, 13 Nov 2012 08:09:32 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDF0072EGJRRJF0@mailout3.samsung.com>; Tue, 13 Nov 2012 22:09:31 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-fa-50a2468be26c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 97.C1.01231.B8642A05; Tue, 13 Nov 2012 22:09:31 +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 <0MDF007RLGI5YYA0@mmp1.samsung.com>; Tue, 13 Nov 2012 22:09:31 +0900 (KST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kyungmin.park@samsung.com, kgene.kim@samsung.com, thomas.abraham@linaro.org, rjw@sisk.pl, m.szyprowski@samsung.com, t.figa@samsung.com, tomasz.figa@gmail.com Subject: [PATCH v3 1/4] ARM: EXYNOS: pm_domain: Detect domain state on registration from DT Date: Tue, 13 Nov 2012 14:08:24 +0100 Message-id: <1352812107-8777-2-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1352812107-8777-1-git-send-email-t.figa@samsung.com> References: <1352812107-8777-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBJMWRmVeSWpSXmKPExsVy+t9jAd1ut0UBBstn6ll87j3CaDHj/D4m ByaPz5vkAhijuGxSUnMyy1KL9O0SuDIeb1vEXvBJoOL7/gnsDYx/eLsYOTkkBEwkXtz7ywZh i0lcuLceyObiEBJYxCgxe+JTKKeLSeLJ5OuMIFVsAmoSnxsegXWICKhKfG5bwA5SxCzwnFGi b8EzFpCEsECsxJH1Z8EaWICKtvw7yQpi8wo4SrTtnssEsU5e4un9PrBBnAJOEsdfLQCrFwKq aVx6gG0CI+8CRoZVjKKpBckFxUnpuYZ6xYm5xaV56XrJ+bmbGMH+fya1g3Flg8UhRgEORiUe 3hsuCwOEWBPLiitzDzFKcDArifAaSC0KEOJNSaysSi3Kjy8qzUktPsQozcGiJM7b7JESICSQ nliSmp2aWpBaBJNl4uCUamDMP/hjXbv/7SNti0ykHEs8V6XePHP3V8pUN2W2db+nTz6bv/Zd wOIFIv6rGpUrVCNf14vNjmPk3//RWXdhC/+tshmt2mcXJLK+Ei5Rz1zW86eifVa2WWmTq47m /4XvmJ7r8HrvPm7AzsR9W2Tx0pNfV0tyum5/UdBzqm6L8f1dwvs6p0Q+WvlGiaU4I9FQi7mo OBEAUsLMBfsBAAA= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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; }