From: Jonas Jelonek Date: Wed, 8 Oct 2025 19:37:30 +0000 (+0000) Subject: realtek: pcs: add setup_serdes callback to rtpcs_cfg X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F20352%2Fhead;p=thirdparty%2Fopenwrt.git 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 Link: https://github.com/openwrt/openwrt/pull/20352 Signed-off-by: Robert Marko --- 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 72b37ba8e2a..594bdecd61c 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)