From patchwork Mon Feb 26 12:53:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10242201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A453605FC for ; Mon, 26 Feb 2018 12:54:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B42129FCD for ; Mon, 26 Feb 2018 12:54:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FA8229FD1; Mon, 26 Feb 2018 12:54:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D833B29FDD for ; Mon, 26 Feb 2018 12:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752726AbeBZMyR (ORCPT ); Mon, 26 Feb 2018 07:54:17 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:39395 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbeBZMyI (ORCPT ); Mon, 26 Feb 2018 07:54:08 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180226125406euoutp0146993bd93ffed451b4eb4a0d02b174ce~W4U1vPRHI1566615666euoutp01O; Mon, 26 Feb 2018 12:54:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180226125406euoutp0146993bd93ffed451b4eb4a0d02b174ce~W4U1vPRHI1566615666euoutp01O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1519649647; bh=Bgbkobz3+Jy97HYKNm2qnFl14Qy/o9VOsJa2Z4p/vwk=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=hCmzK5gupqM2sTwRIcVBT8NoJ0wTE/CL1HYjthNTs8uyC5bbNke/6EKtEPAEYZ2hz mtAbrqN3P6HEnh2XshXrMblITPV2SgXj/RYQXeODy+pvduSZW3OtOLVs3tJ/6w3Zg5 7bzE4U4ZRniDosoRwr7HIh/QV0IqVxjFFs0jB53Y= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125405eucas1p2f8975095e763224aa98d7b7f4b8bc4c7~W4U0P0W6Z0417104171eucas1p2d; Mon, 26 Feb 2018 12:54:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id BD.12.17380.C63049A5; Mon, 26 Feb 2018 12:54:04 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8~W4UyvG0Gt0417104171eucas1p2a; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) X-AuditID: cbfec7f4-b4fc79c0000043e4-b4-5a94036c59ce Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 02.0D.04183.B63049A5; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P4R0055KD5X67D0@eusync3.samsung.com>; Mon, 26 Feb 2018 12:54:03 +0000 (GMT) From: Marek Szyprowski To: linux-clk@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Chanwoo Choi , Inki Dae , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 5/6] soc: samsung: pm_domains: Deprecate support for clocks Date: Mon, 26 Feb 2018 13:53:54 +0100 Message-id: <20180226125355.9052-6-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.15.0 In-reply-to: <20180226125355.9052-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsWy7djPc7o5zFOiDLoWq1lsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAlfGn6M+BVfMKiau3sHWwNim08XIySEhYCLR/XoSC4gtJLCCUeJVi3wXIxeQ /ZlR4s6Zm8wwRT+6VjNDFC1jlDjx1RmiqIFJYv+CaWwgCTYBQ4mut11gtoiAg8TnT68ZQYqY BdqYJM4e2M8EkhAWCJCY9Oo0K4jNIqAqsefJRkYQm1fARuJOxz5WiG3yEou/7wQbxClgK9F5 C2QBF1D8L6vEuasfWCCKXCS+3nsHZQtLvDq+hR3ClpG4PLmbBaKhn1Hi3/+XTBDODEaJ9R9b oaqsJQ4fvwi2jlmAT2LStulAz3EAxXklOtqEIEo8JCbvuc4EYTtKNJ9cxQ7x8wRGieadG5km MEotYGRYxSieWlqcm55abJSXWq5XnJhbXJqXrpecn7uJERiPp/8d/7KDcdefpEOMAhyMSjy8 P+5MjhJiTSwrrsw9xCjBwawkwrtyMVCINyWxsiq1KD++qDQntfgQozQHi5I4b5xGXZSQQHpi SWp2ampBahFMlomDU6qBcaf/3z8mGSG+xx5FbEjY3cN67Bzz8nmuq8wilEI1uP5PEXySfsb0 SOl0z499777qCix+KmWiZrDwkYMAo1PdBildF+5JrZHnD1ru5t5deELKfWtKPFPG9PUZnKs2 f7VY1ferNFzrxu8PDE/7rhyMt/Oz8OU4udRj0qpTqwW9Be98jsrpy3XXV2Ipzkg01GIuKk4E AEjC0qHDAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4Vd1s5ilRBtMXqVtsnLGe1eL6l+es FpPuT2CxOH9+A7vFx557rBYzzu9jslh75C67xeE37awOHB6bVnWyefRtWcXo8XmTXABzFJdN SmpOZllqkb5dAlfGn6M+BVfMKiau3sHWwNim08XIySEhYCLxo2s1cxcjF4eQwBJGiaYlb9kg nCYmid1bZzKBVLEJGEp0ve1iA7FFBBwkPn96zQhSxCzQwSSxZ+9DsISwgJ/EsZlbWUFsFgFV iT1PNjKC2LwCNhJ3OvaxQqyTl1j8fSdYPaeArUTnrWlgthBQzfZ/W5gmMPIsYGRYxSiSWlqc m55bbKRXnJhbXJqXrpecn7uJERgy24793LKDsetd8CFGAQ5GJR7eBT8nRQmxJpYVV+YeYpTg YFYS4V25eHKUEG9KYmVValF+fFFpTmrxIUZpDhYlcd7zBpVRQgLpiSWp2ampBalFMFkmDk6p BsaC4zyL3aoKTzqqbV7TKDeF+yOXk6bW3nKTmap+aQV3D0xeeHRJNPdCBlctwV12b31TPavC nlhLP1l+gHOJ0q7vd8sk+u6tmcpQcnnrSrbSTfVPjwVfSHw0v+y23MtFu9uWXhdvO1zv9/0L 89TFr+c95Z+2QuE98zHGc19fC/00OMv58+NVVT4hJZbijERDLeai4kQA1HZyhBUCAAA= X-CMS-MailID: 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8 X-RootMTR: 20180226125403eucas1p27d32d02417f3cda5b809e62bf894bef8 References: <20180226125355.9052-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Handling of special clock operations on power domain on/off sequences has been moved to respective Exynos clock controller drivers, so there is no need to keep the duplicated (and conflicting) code in Exynos power domain driver. Mark clock related properties in Exynos power domain bindings as deprecated. This change has no inpact on backwards-compatibility, as the new drivers properly work with old DTBs (deprecated properties are ignored). Signed-off-by: Marek Szyprowski --- .../devicetree/bindings/power/pd-samsung.txt | 20 +---- drivers/soc/samsung/pm_domains.c | 90 +--------------------- 2 files changed, 5 insertions(+), 105 deletions(-) diff --git a/Documentation/devicetree/bindings/power/pd-samsung.txt b/Documentation/devicetree/bindings/power/pd-samsung.txt index 549f7dee9b9d..92ef355e8f64 100644 --- a/Documentation/devicetree/bindings/power/pd-samsung.txt +++ b/Documentation/devicetree/bindings/power/pd-samsung.txt @@ -15,23 +15,13 @@ Required Properties: Optional Properties: - label: Human readable string with domain name. Will be visible in userspace to let user to distinguish between multiple domains in SoC. -- clocks: List of clock handles. The parent clocks of the input clocks to the - devices in this power domain are set to oscclk before power gating - and restored back after powering on a domain. This is required for - all domains which are powered on and off and not required for unused - domains. -- clock-names: The following clocks can be specified: - - oscclk: Oscillator clock. - - clkN: Input clocks to the devices in this power domain. These clocks - will be reparented to oscclk before switching power domain off. - Their original parent will be brought back after turning on - the domain. Maximum of 4 clocks (N = 0 to 3) are supported. - - asbN: Clocks required by asynchronous bridges (ASB) present in - the power domain. These clock should be enabled during power - domain on/off operations. - power-domains: phandle pointing to the parent power domain, for more details see Documentation/devicetree/bindings/power/power_domain.txt +Deprecated Properties: +- clocks +- clock-names + Node of a device using power domains must have a power-domains property defined with a phandle to respective power domain. @@ -47,8 +37,6 @@ Example: mfc_pd: power-domain@10044060 { compatible = "samsung,exynos4210-pd"; reg = <0x10044060 0x20>; - clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>; - clock-names = "oscclk", "clk0"; #power-domain-cells = <0>; label = "MFC"; }; diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index caf45cf7aa8e..ab8582971bfc 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -13,14 +13,11 @@ #include #include #include -#include #include #include #include #include -#define MAX_CLK_PER_DOMAIN 4 - struct exynos_pm_domain_config { /* Value for LOCAL_PWR_CFG and STATUS fields for each domain */ u32 local_pwr_cfg; @@ -33,10 +30,6 @@ struct exynos_pm_domain { void __iomem *base; bool is_off; struct generic_pm_domain pd; - 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]; u32 local_pwr_cfg; }; @@ -46,29 +39,10 @@ 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) { - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - if (IS_ERR(pd->clk[i])) - break; - pd->pclk[i] = clk_get_parent(pd->clk[i]); - if (clk_set_parent(pd->clk[i], pd->oscclk)) - pr_err("%s: error setting oscclk as parent to clock %d\n", - domain->name, i); - } - } - pwr = power_on ? pd->local_pwr_cfg : 0; writel_relaxed(pwr, base); @@ -86,26 +60,6 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on) usleep_range(80, 100); } - /* Restore clocks after powering on a domain*/ - if (power_on) { - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - if (IS_ERR(pd->clk[i])) - break; - - if (IS_ERR(pd->pclk[i])) - continue; /* Skip on first power up */ - if (clk_set_parent(pd->clk[i], pd->pclk[i])) - pr_err("%s: error setting parent to clock%d\n", - domain->name, i); - } - } - - 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; } @@ -147,12 +101,6 @@ static __init const char *exynos_get_domain_name(struct device_node *node) return kstrdup_const(name, GFP_KERNEL); } -static const char *soc_force_no_clk[] = { - "samsung,exynos5250-clock", - "samsung,exynos5420-clock", - "samsung,exynos5800-clock", -}; - static __init int exynos4_pm_init_power_domain(void) { struct device_node *np; @@ -161,7 +109,7 @@ static __init int exynos4_pm_init_power_domain(void) for_each_matching_node_and_match(np, exynos_pm_domain_of_match, &match) { const struct exynos_pm_domain_config *pm_domain_cfg; struct exynos_pm_domain *pd; - int on, i; + int on; pm_domain_cfg = match->data; @@ -189,42 +137,6 @@ static __init int exynos4_pm_init_power_domain(void) pd->pd.power_on = exynos_pd_power_on; pd->local_pwr_cfg = pm_domain_cfg->local_pwr_cfg; - for (i = 0; i < ARRAY_SIZE(soc_force_no_clk); i++) - if (of_find_compatible_node(NULL, NULL, - soc_force_no_clk[i])) - goto no_clk; - - 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] = of_clk_get_by_name(np, clk_name); - if (IS_ERR(pd->asb_clk[i])) - break; - } - - pd->oscclk = of_clk_get_by_name(np, "oscclk"); - if (IS_ERR(pd->oscclk)) - goto no_clk; - - for (i = 0; i < MAX_CLK_PER_DOMAIN; i++) { - char clk_name[8]; - - snprintf(clk_name, sizeof(clk_name), "clk%d", i); - pd->clk[i] = of_clk_get_by_name(np, clk_name); - if (IS_ERR(pd->clk[i])) - break; - /* - * Skip setting parent on first power up. - * The parent at this time may not be useful at all. - */ - pd->pclk[i] = ERR_PTR(-EINVAL); - } - - if (IS_ERR(pd->clk[0])) - clk_put(pd->oscclk); - -no_clk: on = readl_relaxed(pd->base + 0x4) & pd->local_pwr_cfg; pm_genpd_init(&pd->pd, NULL, !on);