From patchwork Mon Nov 3 03:53:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 5213921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 954039F380 for ; Mon, 3 Nov 2014 04:06:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3D7720204 for ; Mon, 3 Nov 2014 04:06:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3665201E4 for ; Mon, 3 Nov 2014 04:06:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xl8rr-0000MT-B5; Mon, 03 Nov 2014 04:03:47 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xl8rm-0008S1-VD for linux-arm-kernel@lists.infradead.org; Mon, 03 Nov 2014 04:03:44 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEG000K439LUQ00@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 03 Nov 2014 13:03:21 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.124]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 72.DF.18484.98EF6545; Mon, 03 Nov 2014 13:03:21 +0900 (KST) X-AuditID: cbfee68f-f791c6d000004834-3e-5456fe89c4da Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D1.39.20081.98EF6545; Mon, 03 Nov 2014 13:03:21 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NEG00BUJ320LR40@mmp2.samsung.com>; Mon, 03 Nov 2014 13:03:21 +0900 (KST) From: Amit Daniel Kachhap To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 08/12] soc: samsung: pm_domain: Add a new parameter for power configuration Date: Mon, 03 Nov 2014 09:23:06 +0530 Message-id: <1414986790-11940-9-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1414986790-11940-1-git-send-email-amit.daniel@samsung.com> References: <1414986790-11940-1-git-send-email-amit.daniel@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsWyRsSkRrfzX1iIweZzWhYNV0MsehdcZbPY 9Pgaq8Xn3iOMFjPO72OyWLT1C7sDm8fmJfUefVtWMXp83iQXwBzFZZOSmpNZllqkb5fAlfH0 9BuWgiaZiseT5rA2MH4U62Lk5JAQMJG43v+LCcIWk7hwbz1bFyMXh5DAUkaJ9afusMAUXZ7e xQqRmM4oMW1NNyOEM4FJYtXUc2BVbALGEj937mcHsUUE0iXWLNrNBmIzC6QAdXeArRAWiJU4 0NsIVsMioCqxoPUimM0r4C6xZx5IPQfQNgWJOZNsQMKcAh4SJ/uus4LYQkAlk949ZwLZKyHw m03iau9vZog5AhLfJh9igeiVldh0gBniaEmJgytusExgFF7AyLCKUTS1ILmgOCm9yFivODG3 uDQvXS85P3cTIzCIT/971r+D8e4B60OMAhyMSjy8BdvDQoRYE8uKK3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Jk3tX+96LfvF6Qn+ 4k4xpxmqFu2/vSZeiaU4I9FQi7moOBEAjoTcdacCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141102_200343_260290_4DA97498 X-CRM114-Status: GOOD ( 12.14 ) X-Spam-Score: -5.6 (-----) Cc: pankaj.dubey@samsung.com, Amit Daniel Kachhap , kgene.kim@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a new optional parameter "pd-power-conf" to fetch the correct power configuration value. In exynos7 soc, this field is different from previous exynos soc's. Cc: Kukjin Kim Reviewed-by: Pankaj Dubey Signed-off-by: Amit Daniel Kachhap --- .../bindings/arm/exynos/power_domain.txt | 3 +++ drivers/soc/samsung/pm_domains.c | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt index 7250a5c..07e4ffe 100644 --- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt +++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt @@ -24,6 +24,8 @@ Optional Properties: - pclkN, clkN: Pairs of parent of input clock and input clock to the devices in this power domain. Maximum of 4 pairs (N = 0 to 3) are supported currently. +- pd-power-conf: This optional parameter provides the local power configuration + value for the power domain. Node of a device using power domains must have a samsung,power-domain property defined with a phandle to respective power domain. @@ -48,6 +50,7 @@ Example: mfc_pd: power-domain@10044060 { compatible = "samsung,exynos4210-pd", "samsung,exynos7-pd-mfc"; pd-offset = <0x4060>; + pd-power-conf = <0xf>; #power-domain-cells = <0>; }; diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index e63d129..84a3f1f 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -34,6 +34,7 @@ struct exynos_pm_domain { void __iomem *base; char const *name; bool is_off; + unsigned int pwr_conf_val; struct generic_pm_domain pd; struct clk *oscclk; struct clk *clk[MAX_CLK_PER_DOMAIN]; @@ -63,13 +64,13 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) } } - pwr = power_on ? INT_LOCAL_PWR_EN : 0; + pwr = power_on ? pd->pwr_conf_val : 0; __raw_writel(pwr, base); /* Wait max 1ms */ timeout = 10; - while ((__raw_readl(base + 0x4) & INT_LOCAL_PWR_EN) != pwr) { + while ((__raw_readl(base + 0x4) & pd->pwr_conf_val) != pwr) { if (!timeout) { op = (power_on) ? "enable" : "disable"; pr_err("Power domain %s %s failed\n", domain->name, op); @@ -111,7 +112,7 @@ static int exynos_power_domain_probe(struct platform_device *pdev) struct device_node *np; struct pmu_dev_client_data *pdata = NULL; void __iomem *pmu_base_addr; - unsigned int offset; + unsigned int offset, pwr_conf; pdata = pdev->dev.platform_data; if (!pdata) { @@ -141,9 +142,13 @@ static int exynos_power_domain_probe(struct platform_device *pdev) __func__); return -EINVAL; } + if (of_property_read_u32(np, "pd-power-conf", &pwr_conf)) + pwr_conf = INT_LOCAL_PWR_EN; + pd->base = pmu_base_addr + offset; pd->pd.power_off = exynos_pd_power_off; pd->pd.power_on = exynos_pd_power_on; + pd->pwr_conf_val = pwr_conf; pd->oscclk = of_clk_get_by_name(np, "oscclk"); if (IS_ERR(pd->oscclk)) @@ -169,7 +174,7 @@ static int exynos_power_domain_probe(struct platform_device *pdev) clk_put(pd->oscclk); no_clk: - on = __raw_readl(pd->base + 0x4) & INT_LOCAL_PWR_EN; + on = __raw_readl(pd->base + 0x4) & pwr_conf; pm_genpd_init(&pd->pd, NULL, !on); of_genpd_add_provider_simple(np, &pd->pd);