[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250328210233.1077035-6-elder@riscstar.com>
Date: Fri, 28 Mar 2025 16:02:30 -0500
From: Alex Elder <elder@...cstar.com>
To: p.zabel@...gutronix.de,
mturquette@...libre.com,
sboyd@...nel.org,
dlan@...too.org
Cc: robh@...nel.org,
krzk+dt@...nel.org,
conor+dt@...nel.org,
heylenay@....org,
guodong@...cstar.com,
paul.walmsley@...ive.com,
palmer@...belt.com,
aou@...s.berkeley.edu,
spacemit@...ts.linux.dev,
devicetree@...r.kernel.org,
linux-clk@...r.kernel.org,
linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 5/7] clk: spacemit: make clocks optional
There are some syscon devices that support both clocks and resets,
but for now only their reset functionality is required. Make
defining clocks optional for a SpacemiT CCU, though at least one
clock or at least one reset controller must be defined.
Signed-off-by: Alex Elder <elder@...cstar.com>
---
v2: - Comment explains constraints on match data
drivers/clk/spacemit/ccu-k1.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/spacemit/ccu-k1.c b/drivers/clk/spacemit/ccu-k1.c
index f837d2c2f31fc..6885fea81f6f3 100644
--- a/drivers/clk/spacemit/ccu-k1.c
+++ b/drivers/clk/spacemit/ccu-k1.c
@@ -1821,6 +1821,10 @@ static int spacemit_ccu_register(struct device *dev,
const struct spacemit_ccu_clk *clk;
int i, ret, max_id = 0;
+ /* Clocks are optional */
+ if (!clks)
+ return 0;
+
for (clk = clks; clk->hw; clk++)
max_id = max(max_id, clk->id);
@@ -1926,7 +1930,7 @@ static int k1_ccu_probe(struct platform_device *pdev)
return 0;
}
-/* The match data is required to be non-null, and have a non-null clk pointer */
+/* The match data is required, and its clk or reset_data field must not be null */
static const struct of_device_id of_k1_ccu_match[] = {
{
.compatible = "spacemit,k1-pll",
--
2.45.2
Powered by blists - more mailing lists