From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: georgi.djakov@linaro.org, cw00.choi@samsung.com, inki.dae@samsung.com
Cc: krzk@kernel.org, devicetree@vger.kernel.org, robh+dt@kernel.org,
a.swigon@samsung.com, myungjoo.ham@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 v9 4/5] PM / devfreq: exynos-bus: Add registration of interconnect child device
Date: Thu, 12 Nov 2020 15:09:30 +0100 [thread overview]
Message-ID: <20201112140931.31139-5-s.nawrocki@samsung.com> (raw)
In-Reply-To: <20201112140931.31139-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 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);
--
2.7.4
next prev parent reply other threads:[~2020-11-12 14:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20201112141041eucas1p1a29130955afd4ec1d5d94cf17183920c@eucas1p1.samsung.com>
2020-11-12 14:09 ` [PATCH v9 0/5] Exynos: Simple QoS for exynos-bus using interconnect Sylwester Nawrocki
[not found] ` <CGME20201112141047eucas1p1f4294148c61b778bbb321863b8ef0092@eucas1p1.samsung.com>
2020-11-12 14:09 ` [PATCH v9 1/5] dt-bindings: devfreq: Add documentation for the interconnect properties Sylwester Nawrocki
[not found] ` <CGME20201112141050eucas1p250f62d09adf38b97c521ef67b4b540f0@eucas1p2.samsung.com>
2020-11-12 14:09 ` [PATCH v9 2/5] interconnect: Add generic interconnect driver for Exynos SoCs Sylwester Nawrocki
[not found] ` <CGME20201112141051eucas1p1c94de8fd6032e0a9966cbff9e41c0f2f@eucas1p1.samsung.com>
2020-11-12 14:09 ` [PATCH v9 3/5] MAINTAINERS: Add entry for Samsung interconnect drivers Sylwester Nawrocki
2020-11-12 16:21 ` Krzysztof Kozlowski
[not found] ` <CGME20201112141053eucas1p1acf592a7ece14104a408b77afebb9eed@eucas1p1.samsung.com>
2020-11-12 14:09 ` Sylwester Nawrocki [this message]
[not found] ` <CGME20201112141055eucas1p10bb68467fbb8c481b1275433f5f5f467@eucas1p1.samsung.com>
2020-11-12 14:09 ` [PATCH v9 5/5] drm: exynos: mixer: Add interconnect support Sylwester Nawrocki
2020-11-13 8:48 ` [PATCH v9 0/5] Exynos: Simple QoS for exynos-bus using interconnect Georgi Djakov
2020-11-13 9:07 ` Chanwoo Choi
2020-11-13 9:02 ` Georgi Djakov
2020-11-13 10:32 ` Sylwester Nawrocki
2020-11-13 11:00 ` Marek Szyprowski
2020-11-23 6:59 ` 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=20201112140931.31139-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).