devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Marangi <ansuelsmth@gmail.com>
To: Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Felix Fietkau <nbd@nbd.name>,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Christian Marangi <ansuelsmth@gmail.com>
Subject: [PATCH v2 08/10] clk: en7523: add support for probing SCU child
Date: Tue, 17 Jun 2025 15:04:51 +0200	[thread overview]
Message-ID: <20250617130455.32682-9-ansuelsmth@gmail.com> (raw)
In-Reply-To: <20250617130455.32682-1-ansuelsmth@gmail.com>

On new Airoha SoC in the SCU register space additional pheriperal might
be present aside from the clock/reset. The Airoha AN7583 SoC is an
example of this where 2 MDIO controller are present.

Introduce a bool "probe_child" to trigger probe of child node of the SCU
node.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/clk/clk-en7523.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
index 5236119bca83..00c80221a274 100644
--- a/drivers/clk/clk-en7523.c
+++ b/drivers/clk/clk-en7523.c
@@ -5,6 +5,7 @@
 #include <linux/clk-provider.h>
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
@@ -83,6 +84,7 @@ struct en_rst_data {
 };
 
 struct en_clk_soc_data {
+	bool probe_child;
 	u32 num_clocks;
 	const struct en_clk_desc *base_clks;
 	const struct clk_ops pcie_ops;
@@ -900,8 +902,19 @@ static int en7523_clk_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
-				      clk_data);
+	err = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
+				     clk_data);
+	if (err)
+		return err;
+
+	if (soc_data->probe_child) {
+		err = of_platform_populate(dev->of_node, NULL, NULL,
+					   dev);
+		if (err)
+			return err;
+	}
+
+	return 0;
 }
 
 static const struct en_clk_soc_data en7523_data = {
-- 
2.48.1


  parent reply	other threads:[~2025-06-17 13:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17 13:04 [PATCH v2 00/10] clk: add support for Airoha AN7583 clock Christian Marangi
2025-06-17 13:04 ` [PATCH v2 01/10] clk: en7523: convert driver to regmap API Christian Marangi
2025-06-17 13:04 ` [PATCH v2 02/10] clk: en7523: generalize register clocks function Christian Marangi
2025-06-17 13:04 ` [PATCH v2 03/10] clk: en7523: convert to full clk_hw implementation Christian Marangi
2025-06-17 13:04 ` [PATCH v2 04/10] clk: en7523: add support for .set_rate Christian Marangi
2025-06-17 13:04 ` [PATCH v2 05/10] clk: en7523: permit to reference Chip SCU from phandle Christian Marangi
2025-06-17 13:04 ` [PATCH v2 06/10] dt-bindings: clock: airoha: Document new property airoha,chip-scu Christian Marangi
2025-06-27  7:59   ` Krzysztof Kozlowski
2025-06-27  8:20     ` Christian Marangi
2025-07-16 14:29       ` Krzysztof Kozlowski
2025-07-21 19:06         ` Christian Marangi
2025-06-17 13:04 ` [PATCH v2 07/10] clk: en7523: reword and clean clk_probe variables Christian Marangi
2025-06-17 13:04 ` Christian Marangi [this message]
2025-06-17 13:04 ` [PATCH v2 09/10] dt-bindings: clock: airoha: Document support for AN7583 clock Christian Marangi
2025-06-27  8:00   ` Krzysztof Kozlowski
2025-06-17 13:04 ` [PATCH v2 10/10] clk: en7523: add support for Airoha " Christian Marangi

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=20250617130455.32682-9-ansuelsmth@gmail.com \
    --to=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nbd@nbd.name \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /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).