[PATCH net-next v2 06/12] net: dsa: rzn1-a5psw: Add support for optional timestamp clock
From: Prabhakar
Date: Thu Oct 01 2026 - 12:01:16 EST
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
Add support for an optional "ts" (timestamp) clock to the RZN1 A5PSW
driver. Some SoC variants provide a dedicated clock source for
timestamping or time synchronization features within the Ethernet
switch IP.
Request and enable this clock during probe if defined in the device tree.
If the clock is not present, the driver continues to operate normally.
This change prepares the driver for Renesas RZ/T2H and RZ/N2H SoCs, where
the Ethernet switch includes a timestamp clock input.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
---
v1->v2:
- No change
---
drivers/net/dsa/rzn1_a5psw.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 9daa5d8245df..846216f22bc3 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -1212,6 +1212,7 @@ static int a5psw_probe(struct platform_device *pdev)
struct device_node *mdio;
struct dsa_switch *ds;
struct a5psw *a5psw;
+ struct clk *ts;
int ret;
a5psw = devm_kzalloc(dev, sizeof(*a5psw), GFP_KERNEL);
@@ -1245,6 +1246,13 @@ static int a5psw_probe(struct platform_device *pdev)
goto free_pcs;
}
+ ts = devm_clk_get_optional_enabled(dev, "ts");
+ if (IS_ERR(ts)) {
+ ret = PTR_ERR(ts);
+ dev_err_probe(dev, ret, "failed get ts clock\n");
+ goto free_pcs;
+ }
+
reset = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
if (IS_ERR(reset)) {
ret = PTR_ERR(reset);
--
2.55.0