devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: georgi.djakov@linaro.org, cw00.choi@samsung.com, krzk@kernel.org
Cc: devicetree@vger.kernel.org, robh+dt@kernel.org,
	a.swigon@samsung.com, myungjoo.ham@samsung.com,
	inki.dae@samsung.com, sw0312.kim@samsung.com,
	b.zolnierkie@samsung.com, m.szyprowski@samsung.com,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org, s.nawrocki@samsung.com
Subject: [PATCH v8 4/7] PM / devfreq: exynos-bus: Add registration of interconnect child device
Date: Wed,  4 Nov 2020 11:36:54 +0100	[thread overview]
Message-ID: <20201104103657.18007-5-s.nawrocki@samsung.com> (raw)
In-Reply-To: <20201104103657.18007-1-s.nawrocki@samsung.com>

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 <krzk@kernel.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
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);
-- 
2.7.4


  parent reply	other threads:[~2020-11-04 10:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201104103713eucas1p2d21b6f936aa18725ae4b4878f3be0a8e@eucas1p2.samsung.com>
2020-11-04 10:36 ` [PATCH v8 0/7] Exynos: Simple QoS for exynos-bus using interconnect Sylwester Nawrocki
     [not found]   ` <CGME20201104103718eucas1p1c103f1a96499b03c72e5457ac2542c3d@eucas1p1.samsung.com>
2020-11-04 10:36     ` [PATCH v8 1/7] dt-bindings: devfreq: Add documentation for the interconnect properties Sylwester Nawrocki
2020-11-04 12:25       ` Krzysztof Kozlowski
2020-11-04 12:28       ` Chanwoo Choi
2020-11-10 14:26       ` Rob Herring
     [not found]   ` <CGME20201104103720eucas1p1014217e751a681796ed508af22c6bb12@eucas1p1.samsung.com>
2020-11-04 10:36     ` [PATCH v8 2/7] interconnect: Add generic interconnect driver for Exynos SoCs Sylwester Nawrocki
2020-11-04 12:28       ` Chanwoo Choi
2020-11-04 12:37       ` Krzysztof Kozlowski
2020-11-04 13:22         ` Sylwester Nawrocki
2020-11-04 14:06           ` Krzysztof Kozlowski
     [not found]   ` <CGME20201104103722eucas1p1db939995e60d0bf2cd581070c14379f5@eucas1p1.samsung.com>
2020-11-04 10:36     ` [PATCH v8 3/7] MAINTAINERS: Add entry for Samsung interconnect drivers Sylwester Nawrocki
2020-11-04 12:27       ` Krzysztof Kozlowski
2020-11-04 13:27         ` Sylwester Nawrocki
2020-11-04 12:30       ` Chanwoo Choi
     [not found]   ` <CGME20201104103726eucas1p2e8f7c32f13b4232d925e901284ada13d@eucas1p2.samsung.com>
2020-11-04 10:36     ` Sylwester Nawrocki [this message]
     [not found]   ` <CGME20201104103726eucas1p248b51b25f5ee42898bf03e9cb2229c5d@eucas1p2.samsung.com>
2020-11-04 10:36     ` [PATCH v8 5/7] ARM: dts: exynos: Add interconnect properties to Exynos4412 bus nodes Sylwester Nawrocki
2020-11-04 12:31       ` Chanwoo Choi
2020-11-10 18:11       ` Krzysztof Kozlowski
     [not found]   ` <CGME20201104103728eucas1p2f671f29ed9eb06d4c6c991b073be092e@eucas1p2.samsung.com>
2020-11-04 10:36     ` [PATCH v8 6/7] ARM: dts: exynos: Add interconnects to Exynos4412 mixer Sylwester Nawrocki
2020-11-10 18:12       ` Krzysztof Kozlowski
     [not found]   ` <CGME20201104103730eucas1p2964e5910a1319fc1c931db8f02a447de@eucas1p2.samsung.com>
2020-11-04 10:36     ` [PATCH v8 7/7] drm: exynos: mixer: Add interconnect support Sylwester Nawrocki
2020-11-04 12:31       ` Chanwoo Choi
2020-11-05  2:20   ` [PATCH v8 0/7] Exynos: Simple QoS for exynos-bus using interconnect Chanwoo Choi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201104103657.18007-5-s.nawrocki@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.swigon@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=georgi.djakov@linaro.org \
    --cc=inki.dae@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).