summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Jelonek2025-10-08 19:37:30 +0000
committerRobert Marko2025-10-10 09:00:15 +0000
commit5b527704b15c14ef4d41cd48d26292758c9281aa (patch)
treeb3cbdfaf21a0bf8e8d8bb73d8591a0ce1e9b7c59
parent3cf04d2e0b95b853c09af7f709a81ee1a2ca6480 (diff)
downloadopenwrt-5b527704b15c14ef4d41cd48d26292758c9281aa.tar.gz
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@gmail.com> Link: https://github.com/openwrt/openwrt/pull/20352 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c7
1 files changed, 7 insertions, 0 deletions
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)