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: 1733791 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9B5EEDF280 for ; Tue, 13 Nov 2012 12:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754159Ab2KMMwq (ORCPT ); Tue, 13 Nov 2012 07:52:46 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:18376 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753481Ab2KMMwp (ORCPT ); Tue, 13 Nov 2012 07:52:45 -0500 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>; Tue, 13 Nov 2012 21:52:44 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-88-50a2429c84ba Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D8.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>; Tue, 13 Nov 2012 21:52:44 +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 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+NgFnrOJMWRmVeSWpSXmKPExsVy+t9jAd05TosCDP7+l7H43HuE0WLG+X1M DkwenzfJBTBGcdmkpOZklqUW6dslcGU83raIveCTQMX3/RPYGxj/8HYxcnJICJhIHF3xlBnC FpO4cG89WxcjF4eQwCJGiceT10I5XUwSu26dZgWpYhNQk/jc8IgNxBYRUJX43LaAHaSIWeA5 o0TfgmcsIAlhgViJI+vPMoLYLEBFS39OB7N5BRwltm04wAqxTl7i6f0+sEGcAk4SF9d/AIpz AG1zlPjdwT2BkXcBI8MqRtHUguSC4qT0XEO94sTc4tK8dL3k/NxNjGDvP5PawbiyweIQowAH oxIP7w2XhQFCrIllxZW5hxglOJiVRHgNpBYFCPGmJFZWpRblxxeV5qQWH2KU5mBREudt9kgJ EBJITyxJzU5NLUgtgskycXBKNTAKmWyJesmjOuH6lglmCpsDD33+H/rxcOisDlsT6/BtZoUC F96f7Ni/Ti9BPnCHrrZpu7V3mN2hi5//3AvbWTjztVj+7ssFbpt8XrdpFfNdO7v+xROeKR0n p6gn8zS7dlhWr8hgPZQ4T0K3Zkn9wi0Bcpf4ivm+/GB7fG/a9EuKJTcuXZLPbJRWYinOSDTU Yi4qTgQADU0hNPoBAAA= 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; }