From patchwork Thu Nov 12 14:09:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 11900349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4131C2D0A3 for ; Thu, 12 Nov 2020 14:12:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5341E216FD for ; Thu, 12 Nov 2020 14:12:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yjbGoM7q"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="CVhjmb+0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5341E216FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=A8bCcq9l9qzO6xvpOzD5g3DM45lOzkwpGcPoMKvuJXA=; b=yjbGoM7qHlRoUIkyBT+CBodZiJ RrEpyBN1y5LwDvlTkHP72i/VwRi2QYJubWkD1+qrj+6rSGGwMxVcytlG0bFVeZqT+5/a6qQjE1uvB 0x6FKUmLT3MghPB4OYIYWzUuTB8Mzge5adv21W5XRFu+28LkOWYeBJ4zJMdR+CeQETJ/D03naEmHv gwLqm08ywBcvfifJ0Wxf8HH+e2hwCGIHgZMcE0XHiseVyDT6i+942+WkB6ovImjPuc6nxeWVGSFyP HUYKcojMnaxW0ChNSNLbWoT4ydClygSbd5+oW/I7/S8+5eCND/JzFw8e+TBfR8ap+uKK9s7dENrYx vFaLIOCg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdDK6-00084E-Vf; Thu, 12 Nov 2020 14:11:39 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdDJo-0007xD-Mh for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 14:11:24 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201112141104euoutp01da531ec978461d5f8ef04fb62e8906f5~GyAp-tILF1537215372euoutp01G for ; Thu, 12 Nov 2020 14:11:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201112141104euoutp01da531ec978461d5f8ef04fb62e8906f5~GyAp-tILF1537215372euoutp01G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1605190264; bh=6lyGsyIQRnO1IuwTnq84kfoSzkYQ7Jyzkt3YSw6gXik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CVhjmb+0ARYjVz5a65PsAo1GY40Ljus93il00MBmcKxEUEQycNgUlnyK/HaYAiwLz zO9d60n8iRf+mcx0UrD9Dk9ChGOvvOQMaO7FsO1WHU8tsJnArjkD++RhWzZjnnJ3SF 4UMs74/XWZseEbuMVfR94rPuJNLhcfbAJTE9ONBQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201112141054eucas1p11b681db57da737607808876e69a9be7e~GyAgIlRlc1698416984eucas1p1p; Thu, 12 Nov 2020 14:10:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 0E.B9.44805.D624DAF5; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed~GyAfrs9KX2134621346eucas1p1v; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201112141053eusmtrp17516099eb5d554838d6d8ee262db638c~GyAfq1Cbo1178311783eusmtrp1C; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) X-AuditID: cbfec7f4-b37ff7000000af05-6b-5fad426dfb5f Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 89.0F.16282.D624DAF5; Thu, 12 Nov 2020 14:10:53 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201112141052eusmtip2ccc917644c7d599c11291d61b2753502~GyAe7MJLF2828528285eusmtip2s; Thu, 12 Nov 2020 14:10:52 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, inki.dae@samsung.com Subject: [PATCH v9 4/5] PM / devfreq: exynos-bus: Add registration of interconnect child device Date: Thu, 12 Nov 2020 15:09:30 +0100 Message-Id: <20201112140931.31139-5-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201112140931.31139-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKKsWRmVeSWpSXmKPExsWy7djPc7q5TmvjDS4ct7C4P6+V0WLjjPWs Fte/PGe1mH/kHKvFla/v2Sym793EZjHp/gQWi/PnN7BbbHp8jdXi8q45bBafe48wWsw4v4/J Yu2Ru+wWtxtXsFm07j3CbnH4TTurxYzJL9kcBD02repk87hzbQ+bx/3u40wem5fUe/RtWcXo 8XmTXABbFJdNSmpOZllqkb5dAlfGr7332QoeCFbsn7GBuYHxCl8XIyeHhICJxIL3i1m6GLk4 hARWMEqcWLACyvnCKNHbtp0RwvnMKLG68TQTTMv3hpPsEInljBL7uhYwwbWs37GdBaSKTcBQ ovdoH1A7B4eIgKfEyQZ9kBpmgWZmiYbmTYwgNcICiRK3JjwHm8oioCrR8u4TG4jNK2AtcWD5 ZnaIbfISqzccYAaxOQVsJOY+bWUDGSQh8IZDYtXtF6wQRS4SB2bdYYGwhSVeHd8C1SwjcXpy DwtEQzOjRM/u2+wQzgRGifvHFzBCVFlL3Dn3iw3kVGYBTYn1u/Qhwo4Sb5o3s4KEJQT4JG68 FQQJMwOZk7ZNZ4YI80p0tAlBVKtI/F41HRpCUhLdT/6zQJR4SCy5kwkJn35GiXPr/jBPYJSf hbBrASPjKkbx1NLi3PTUYqO81HK94sTc4tK8dL3k/NxNjMCUdPrf8S87GJe/+qh3iJGJg/EQ owQHs5IIr7LDmngh3pTEyqrUovz4otKc1OJDjNI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M5r cgSoSSA9sSQ1OzW1ILUIpo+Jg1OqgWl5+MrfJ6pvT1u5UehBzaWYexIxTLPM52pevrOU2ZW3 WaD9LTPbErdecae/919t3touLjrTd/6yNL76iPRPx1vtIz4XJetE7bK4/rRS7sYZtcwPfznq Z67cwd4weZ/ko7bza2Y4Fl8J8pzEaqivuWbO0dNu7dvzf76fdDxylbtspuQRVY0nG5/3C0V3 x1ROv1I/7/WRXQVp3vmW0UKLdP9YiLd3Zu7U67l+oV9FbKble63lT36s8HjlljSR6W0a87Zk 51KHwOs8+87/dr619biG7Zv95du+3Vn7wTq9Oen98qTdonNXr5j36eK3ZbH61ge6bgZt+/p+ x+KNq/ll3V/qLt3T4nWoZs4GOa6DM9zClViKMxINtZiLihMBWxn57hgDAAA= X-CMS-MailID: 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed X-Msg-Generator: CA X-RootMTR: 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed References: <20201112140931.31139-1-s.nawrocki@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_091121_852608_A3EE74C8 X-CRM114-Status: GOOD ( 19.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, sw0312.kim@samsung.com, a.swigon@samsung.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com, krzk@kernel.org, s.nawrocki@samsung.com, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch adds registration of a child platform device for the exynos interconnect driver. It is assumed that the interconnect provider will only be needed when #interconnect-cells property is present in the bus DT node, hence the child device will be created only when such a property is present. Acked-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Signed-off-by: Sylwester Nawrocki --- Changes for v9: - whitespace (indentation) corrections. Changes for v8...v6: - none. Changes for v5: - new patch. --- drivers/devfreq/exynos-bus.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c index 1e684a4..20447a4 100644 --- a/drivers/devfreq/exynos-bus.c +++ b/drivers/devfreq/exynos-bus.c @@ -24,6 +24,7 @@ struct exynos_bus { struct device *dev; + struct platform_device *icc_pdev; struct devfreq *devfreq; struct devfreq_event_dev **edev; @@ -156,6 +157,8 @@ static void exynos_bus_exit(struct device *dev) if (ret < 0) dev_warn(dev, "failed to disable the devfreq-event devices\n"); + platform_device_unregister(bus->icc_pdev); + dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); if (bus->opp_table) { @@ -168,6 +171,8 @@ static void exynos_bus_passive_exit(struct device *dev) { struct exynos_bus *bus = dev_get_drvdata(dev); + platform_device_unregister(bus->icc_pdev); + dev_pm_opp_of_remove_table(dev); clk_disable_unprepare(bus->clk); } @@ -432,6 +437,18 @@ static int exynos_bus_probe(struct platform_device *pdev) if (ret < 0) goto err; + /* Create child platform device for the interconnect provider */ + if (of_get_property(dev->of_node, "#interconnect-cells", NULL)) { + bus->icc_pdev = platform_device_register_data( + dev, "exynos-generic-icc", + PLATFORM_DEVID_AUTO, NULL, 0); + + if (IS_ERR(bus->icc_pdev)) { + ret = PTR_ERR(bus->icc_pdev); + goto err; + } + } + max_state = bus->devfreq->profile->max_state; min_freq = (bus->devfreq->profile->freq_table[0] / 1000); max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000);