[openwrt/openwrt] realtek: pcs: add init_serdes_common hook
LEDE Commits
lede-commits at lists.infradead.org
Mon Dec 8 15:29:32 PST 2025
hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/328b970ecd8d43fe7ce73e23e584c984ee820a03
commit 328b970ecd8d43fe7ce73e23e584c984ee820a03
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Fri Nov 7 12:16:45 2025 +0000
realtek: pcs: add init_serdes_common hook
Add a new hook called 'init_serdes_common' to be able to perform
initialisations or anything else subject to all SerDes. This hook is
called in the end of 'rtpcs_probe' after everything else is done.
This is meant primarily to support the transition of RTL83XX from PHY
driver to PCS driver. Thus, it may be removed later again or kept if
there is sufficient need for this.
Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20876
Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 2f0ff0ce03..2fa500396a 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -122,6 +122,7 @@ struct rtpcs_config {
int mac_rx_pause_sts;
int mac_tx_pause_sts;
const struct phylink_pcs_ops *pcs_ops;
+ int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
int (*setup_serdes)(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode);
};
@@ -2769,6 +2770,12 @@ static int rtpcs_probe(struct platform_device *pdev)
ctrl->tx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-tx");
}
+ if (ctrl->cfg->init_serdes_common) {
+ ret = ctrl->cfg->init_serdes_common(ctrl);
+ if (ret)
+ return ret;
+ }
+
/*
* rtpcs_create() relies on that fact that data is attached to the platform device to
* determine if the driver is ready. Do this after everything is initialized properly.
More information about the lede-commits
mailing list