From patchwork Wed Nov 4 10:36:54 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: 11880321 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 9CECCC2D0A3 for ; Wed, 4 Nov 2020 10:39:41 +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 14A062072C for ; Wed, 4 Nov 2020 10:39:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CpNBAu5F"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="XSVTnpXv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 14A062072C 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=CZbyc5YHqnj7NIBPgRlbuzj3Hj+B3V2Kbt9jglEw2NM=; b=CpNBAu5Foi+SUmRxIModSraec5 jVL2TBfuXcwoHjrhvRnSzAe/GdEir5dU+UGb/uEHJ++MkjmGX6WfHR+1xamCwqWomYguEdMiURx8x FWJmyaGdStAocoHsPFmTPQQZx6ODJ7AGsakLGHrBYOA0xVlIlONzyaA1sRpqoqfejAGt7KVZdMZPc fuM2aZS8/SncKfSoFJUnUZF3MQGNX2+ISkOSpP/MsOoKxngkN6YA19B3WTnKIn//Rk3hm5sNldAgp rDhSsR2g6XRvdCwKVlHdEF6GClV01edfgBwHsJ3l9tA5F4Ak1YeXplfFi01fgvsCF5iJq6V58/kmx ZEitzs8g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaGBA-000266-JK; Wed, 04 Nov 2020 10:38:12 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaGAg-0001sY-RX for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 10:37:47 +0000 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201104103727euoutp02865bca69dfa5c1c7159aae1200546e1e~ER72hw8hK2966029660euoutp02e for ; Wed, 4 Nov 2020 10:37:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201104103727euoutp02865bca69dfa5c1c7159aae1200546e1e~ER72hw8hK2966029660euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604486247; bh=2a12Ishl6dROfsBuQFSa17sVXwF7PkvSSX4ixHc5NZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSVTnpXvVIMSvFgZmeqCF/B8VONTwLh4V0JaoQ83jNaWuoWkgKLGvmKLjIZNw+zaP LpNEe12z6OrBMc/olBConvkASSu8cfnBU2abKajKZ3ehTA4k5DKPC3nNoWj2TFbaF2 pRyitlNeI03e1ec1U+/quXbGGJiDbfdJ4AESRv8Y= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201104103726eucas1p2cd33ec5d3a164cc9c09a166fb136006b~ER72MDlCo1144911449eucas1p2q; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A7.8F.06456.66482AF5; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d~ER71udMfb1145811458eucas1p2n; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201104103726eusmtrp1e530e1fe73ff14deca6c32d24728480c~ER71tjWgu0613806138eusmtrp1Z; Wed, 4 Nov 2020 10:37:26 +0000 (GMT) X-AuditID: cbfec7f2-7efff70000001938-15-5fa28466ef04 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0F.75.06314.46482AF5; Wed, 4 Nov 2020 10:37:24 +0000 (GMT) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201104103724eusmtip2a27f0801494ca72c6885d4086cb9b9bc~ER7z97sjL1005710057eusmtip28; Wed, 4 Nov 2020 10:37:24 +0000 (GMT) From: Sylwester Nawrocki To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org Subject: [PATCH v8 4/7] PM / devfreq: exynos-bus: Add registration of interconnect child device Date: Wed, 4 Nov 2020 11:36:54 +0100 Message-Id: <20201104103657.18007-5-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WSfSzUcRzH973fw/2Ys59j8x2irtTUkB7mO25NTXV/NLX1RxuiKz8P447d D8XaKM+PJ1ouM+dpo7PCxWXEjMu1CUOoKMpzpZpjU1rl56f67/39fF7vz+e9z74UJm4kHKgo ZTyjUspjJKQlbuj7PuQenl4denglcz+arsgAqFnTSKCJtUUCaY2DBHq5/pVEpZ16EhVPF+Fo aKhJiPSz4wQabS8nkbnACJBmqEuAHhrfCtHkrXoSZXQahaj3cxaBNCXLpJ+NTK/LIWVT409J 2XSeSSB7XJsiK2zRAZlZ73yBDLSUhjExUYmMyvPEFcvItPefiLh2mxsb6gksFdRa5wILCtLH YM3SnCAXWFJiuh7AhZlVkn+sAXg/XQM4SkybAdTNXcwF1LZjuOksz9QBuKw2Yv8MrTXfSM5A 0l6w4FnhttmO9oeZ8xU4B2F0NgYNbcUY17Cl5TBtbAXnNE67wq43r4XcBhHtC1tzbvLxXGBD U/c2bkFL4bA5TcjNgXSPEPZO9uJ8In9Y3kfyvC38aGoR8toJ9pfk4zyfBmB+x+SOuQjAaVMl 4ClfODX4g+QGYbQbbGz35MsnYcvoXYyfbw1frdhwZWxLFhtKd8oimJ0p5ul9cFNXKuC1A8yb +72TTAZ/Nvvw51ED+KRBTRQBl7L/uyoB0AF7JoFVRDCsl5K57sHKFWyCMsLjWqxCD7a+Uf8v 02obWB+52gNoCkisRN2GqlAxIU9kkxQ9AFKYxE50aqA/RCwK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VF01zp5gX/mvXjtrD7fju2NPMKZ8r6 p60q3wu6WHcpsRRnJBpqMRcVJwIAyEniaKMCAAA= X-CMS-MailID: 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d X-Msg-Generator: CA X-RootMTR: 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d References: <20201104103657.18007-1-s.nawrocki@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_053744_153109_DBF64610 X-CRM114-Status: GOOD ( 19.52 ) 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, linux-pm@vger.kernel.org, sw0312.kim@samsung.com, a.swigon@samsung.com, robh+dt@kernel.org, linux-kernel@vger.kernel.org, inki.dae@samsung.com, myungjoo.ham@samsung.com, dri-devel@lists.freedesktop.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 v8, v7, 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..ee300ee 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);