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, s.nawrocki@samsung.com
Subject: [PATCH v7 3/6] PM / devfreq: exynos-bus: Add registration of interconnect child device
Date: Fri, 30 Oct 2020 13:51:46 +0100 [thread overview]
Message-ID: <20201030125149.8227-4-s.nawrocki@samsung.com> (raw)
In-Reply-To: <20201030125149.8227-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.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
Changes for 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
next prev parent reply other threads:[~2020-10-30 12:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20201030125221eucas1p14e525f75c4b8dadae04144ce7684d776@eucas1p1.samsung.com>
2020-10-30 12:51 ` [PATCH v7 0/6] Exynos: Simple QoS for exynos-bus using interconnect Sylwester Nawrocki
[not found] ` <CGME20201030125257eucas1p29c6b018cfcdda337b2b3d2a496f0c830@eucas1p2.samsung.com>
2020-10-30 12:51 ` [PATCH v7 1/6] dt-bindings: devfreq: Add documentation for the interconnect properties Sylwester Nawrocki
2020-10-31 12:12 ` Krzysztof Kozlowski
2020-11-03 9:40 ` Chanwoo Choi
[not found] ` <CGME20201030125301eucas1p218b0e654cb4c826b05280f28836da8d9@eucas1p2.samsung.com>
2020-10-30 12:51 ` [PATCH v7 2/6] interconnect: Add generic interconnect driver for Exynos SoCs Sylwester Nawrocki
2020-10-31 12:17 ` Krzysztof Kozlowski
2020-11-02 12:23 ` Sylwester Nawrocki
2020-11-03 8:11 ` Georgi Djakov
2020-11-03 9:37 ` Chanwoo Choi
2020-11-03 11:32 ` Sylwester Nawrocki
2020-11-03 14:12 ` Chanwoo Choi
2020-11-03 17:30 ` Sylwester Nawrocki
[not found] ` <CGME20201030125303eucas1p14a9de4111ffafc1870527abdea0994c9@eucas1p1.samsung.com>
2020-10-30 12:51 ` Sylwester Nawrocki [this message]
2020-10-31 12:40 ` [PATCH v7 3/6] PM / devfreq: exynos-bus: Add registration of interconnect child device Krzysztof Kozlowski
2020-11-02 4:28 ` Chanwoo Choi
2020-11-03 10:45 ` Chanwoo Choi
2020-11-03 12:32 ` Sylwester Nawrocki
2020-11-03 13:11 ` Krzysztof Kozlowski
2020-11-03 14:07 ` Chanwoo Choi
[not found] ` <CGME20201030125305eucas1p2d61ba397d77a72e0d1dce8d30b278e16@eucas1p2.samsung.com>
2020-10-30 12:51 ` [PATCH v7 4/6] ARM: dts: exynos: Add interconnect properties to Exynos4412 bus nodes Sylwester Nawrocki
[not found] ` <CGME20201030125307eucas1p14afc8cc8828f2bc838e769b77d7e9c95@eucas1p1.samsung.com>
2020-10-30 12:51 ` [PATCH v7 5/6] ARM: dts: exynos: Add interconnects to Exynos4412 mixer Sylwester Nawrocki
[not found] ` <CGME20201030125308eucas1p14ae969ae1d5549d422c478aa54d3311e@eucas1p1.samsung.com>
2020-10-30 12:51 ` [PATCH v7 6/6] drm: exynos: mixer: Add interconnect support Sylwester Nawrocki
2020-10-31 12:44 ` Krzysztof Kozlowski
2020-10-31 12:47 ` Krzysztof Kozlowski
2020-11-02 12:40 ` Sylwester Nawrocki
2020-11-03 7:54 ` [PATCH v7 0/6] Exynos: Simple QoS for exynos-bus using interconnect Chanwoo Choi
2020-11-03 8:29 ` Georgi Djakov
2020-11-03 8:53 ` Chanwoo Choi
2020-11-03 10:12 ` Sylwester Nawrocki
2020-11-03 10:37 ` 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=20201030125149.8227-4-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-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).