[openwrt/openwrt] realtek: pcs: add setup_serdes callback to rtpcs_cfg
LEDE Commits
lede-commits at lists.infradead.org
Fri Oct 10 02:00:20 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5b527704b15c14ef4d41cd48d26292758c9281aa
commit 5b527704b15c14ef4d41cd48d26292758c9281aa
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Wed Oct 8 19:37:30 2025 +0000
realtek: pcs: add setup_serdes callback to rtpcs_cfg
Add a callback for a serdes setup function to rtpcs_cfg to allow each
SoC variant to define its own SerDes setup routine.
Call the setup_serdes operation in pcs_config if it is defined.
Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20352
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
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 72b37ba8e2..594bdecd61 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
@@ -78,6 +78,7 @@ struct rtpcs_config {
int mac_tx_pause_sts;
const struct phylink_pcs_ops *pcs_ops;
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);
};
static int rtpcs_sds_to_mmd(int sds_page, int sds_regnum)
@@ -254,6 +255,12 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
mutex_lock(&ctrl->lock);
+ if (ctrl->cfg->setup_serdes) {
+ ret = ctrl->cfg->setup_serdes(ctrl, link->sds, interface);
+ if (ret < 0)
+ goto out;
+ }
+
if (ctrl->cfg->set_autoneg) {
ret = ctrl->cfg->set_autoneg(ctrl, link->sds, neg_mode);
if (ret < 0)
More information about the lede-commits
mailing list