From patchwork Mon Jan 30 12:18:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9545123 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 1AAD160425 for ; Mon, 30 Jan 2017 12:32:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBC6325404 for ; Mon, 30 Jan 2017 12:32:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E09652711E; Mon, 30 Jan 2017 12:32:30 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 83CB025404 for ; Mon, 30 Jan 2017 12:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753381AbdA3McL (ORCPT ); Mon, 30 Jan 2017 07:32:11 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:23731 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753292AbdA3Mbe (ORCPT ); Mon, 30 Jan 2017 07:31:34 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKL00BN2E84IU50@mailout1.w1.samsung.com>; Mon, 30 Jan 2017 12:19:16 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170130121916eucas1p29c907dc6c0401afb36ca47ea23f485e3~ei_gdhpHM3189431894eucas1p2w; Mon, 30 Jan 2017 12:19:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 5B.E0.28517.34F2F885; Mon, 30 Jan 2017 12:19:15 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170130121915eucas1p23aa4f4be912bcd64f9521f6e6b51132f~ei_f2QyEi0678706787eucas1p2n; Mon, 30 Jan 2017 12:19:15 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-47-588f2f43baeb Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D2.24.06687.68F2F885; Mon, 30 Jan 2017 12:20:22 +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 <0OKL00IHCE7WJ0B0@eusync3.samsung.com>; Mon, 30 Jan 2017 12:19:15 +0000 (GMT) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Javier Martinez Canillas , Bartlomiej Zolnierkiewicz , Chanwoo Choi , Inki Dae , devicetree@vger.kernel.org, Rob Herring Subject: [PATCH v3 4/5] soc: samsung: pm_domains: Read domain name from the new label property Date: Mon, 30 Jan 2017 13:18:59 +0100 Message-id: <1485778740-30337-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485778740-30337-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsWy7djPc7rO+v0RBl3bTSw2zljPanH9y3NW i/lHzr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nAPVtK3S3DLuHydq+C4WMXs/xfYGhhPCXUxcnJICJhILLrdxgZh i0lcuLceyObiEBJYwigxe9svsISQQBOTRNsJMRCbTcBQouttF1hcRMBe4vaTZewgDcwCf5kk zuzcyAqSEBZIkNhx7CBjFyMHB4uAqsS+q5kgYV4BD4nDxzcxQyyTkzh5bDJYOaeAp8TX1ctY IXZ5SHy6ep55AiPvAkaGVYwiqaXFuem5xYZ6xYm5xaV56XrJ+bmbGIFhvu3Yz807GC9tDD7E KMDBqMTDe0O4L0KINbGsuDL3EKMEB7OSCO9J1f4IId6UxMqq1KL8+KLSnNTiQ4ymQDdNZJYS Tc4HxmBeSbyhiaG5paGRsYWFuZGRkjhvyYcr4UIC6YklqdmpqQWpRTB9TBycUg2MC5p4An44 Be9QYUmZ05kt3HfHee/bRs69XQ+lJvvtleRvPOzx4kCKJWvl70P52yL+PjrZJn/SNffvM2sj 93nZXSad64ye6PP96AhZGnznjtYzIYGFfScilALiRL5K/9/kdtE21L2w1327+ez6Vh2htT/f Ho67Vc0wc9/qN99lOQ5v3DyPWc5KiaU4I9FQi7moOBEAxBG6XokCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170130121915eucas1p23aa4f4be912bcd64f9521f6e6b51132f X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170130121915eucas1p23aa4f4be912bcd64f9521f6e6b51132f X-RootMTR: 20170130121915eucas1p23aa4f4be912bcd64f9521f6e6b51132f References: <1485778740-30337-1-git-send-email-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 Device tree nodes for each power domain should use generic "power-domain" name, so using it as a domain name doesn't give much benefits. This patch adds support for human readable names defined in 'label' property. Such names are visible to userspace and makes debugging much easier. When no 'label' property is found, driver keeps using the name constructed from full node name. Suggested-by: Krzysztof Kozlowski Signed-off-by: Marek Szyprowski --- Documentation/devicetree/bindings/power/pd-samsung.txt | 4 ++++ drivers/soc/samsung/pm_domains.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/power/pd-samsung.txt b/Documentation/devicetree/bindings/power/pd-samsung.txt index fb08c8d62733..549f7dee9b9d 100644 --- a/Documentation/devicetree/bindings/power/pd-samsung.txt +++ b/Documentation/devicetree/bindings/power/pd-samsung.txt @@ -13,6 +13,8 @@ Required Properties: must be 0. 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 @@ -39,6 +41,7 @@ Example: compatible = "samsung,exynos4210-pd"; reg = <0x10023C00 0x10>; #power-domain-cells = <0>; + label = "LCD0"; }; mfc_pd: power-domain@10044060 { @@ -47,6 +50,7 @@ Example: clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>; clock-names = "oscclk", "clk0"; #power-domain-cells = <0>; + label = "MFC"; }; See Documentation/devicetree/bindings/power/power_domain.txt for description diff --git a/drivers/soc/samsung/pm_domains.c b/drivers/soc/samsung/pm_domains.c index 5a0a46bcbe18..a6a5d807cc2b 100644 --- a/drivers/soc/samsung/pm_domains.c +++ b/drivers/soc/samsung/pm_domains.c @@ -142,6 +142,15 @@ static int exynos_pd_power_off(struct generic_pm_domain *domain) { }, }; +static __init const char *exynos_get_domain_name(struct device_node *node) +{ + const char *name; + + if (of_property_read_string(node, "label", &name) < 0) + name = strrchr(node->full_name, '/') + 1; + return kstrdup_const(name, GFP_KERNEL); +} + static __init int exynos4_pm_init_power_domain(void) { struct device_node *np; @@ -159,8 +168,7 @@ static __init int exynos4_pm_init_power_domain(void) of_node_put(np); return -ENOMEM; } - pd->pd.name = kstrdup_const(strrchr(np->full_name, '/') + 1, - GFP_KERNEL); + pd->pd.name = exynos_get_domain_name(np); if (!pd->pd.name) { kfree(pd); of_node_put(np);