[PATCH net-next 02/10] net: dsa: microchip: add the number of periodic signals to chip infos
From: Bastien Curutchet (Schneider Electric)
Date: Mon Aug 31 2026 - 09:40:58 EST
The number of periodic signals available is hardcoded to 3 while
KSZ8463 can produce 12 different periodic signals.
Add an n_per_out attribute to the struct ksz_chip_data to make this
setting configurable.
Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@xxxxxxxxxxx>
---
drivers/net/dsa/microchip/ksz_common.c | 1 +
drivers/net/dsa/microchip/ksz_common.h | 1 +
drivers/net/dsa/microchip/ksz_ptp.c | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 55d1e3e3c529..194c88cdd00b 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -1195,6 +1195,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
.wr_table = &ksz8563_register_set,
.rd_table = &ksz8563_register_set,
.n_pins = 2,
+ .n_per_out = 3,
},
[KSZ8795] = {
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index c678fc6597dc..1155b39350c2 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -140,6 +140,7 @@ struct ksz_chip_data {
const struct regmap_access_table *wr_table;
const struct regmap_access_table *rd_table;
const u8 n_pins;
+ const u8 n_per_out;
};
struct ksz_irq {
diff --git a/drivers/net/dsa/microchip/ksz_ptp.c b/drivers/net/dsa/microchip/ksz_ptp.c
index c92936bf78d3..f80015250e5a 100644
--- a/drivers/net/dsa/microchip/ksz_ptp.c
+++ b/drivers/net/dsa/microchip/ksz_ptp.c
@@ -1051,7 +1051,7 @@ int ksz_ptp_clock_register(struct dsa_switch *ds)
ptp_data->caps.enable = ksz_ptp_enable;
ptp_data->caps.verify = ksz_ptp_verify_pin;
ptp_data->caps.n_pins = dev->info->n_pins;
- ptp_data->caps.n_per_out = 3;
+ ptp_data->caps.n_per_out = dev->info->n_per_out;
ret = ksz_ptp_start_clock(dev);
if (ret)
--
2.55.0