]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: add setup_serdes callback to rtpcs_cfg 20352/head
authorJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 8 Oct 2025 19:37:30 +0000 (19:37 +0000)
committerRobert Marko <robimarko@gmail.com>
Fri, 10 Oct 2025 09:00:15 +0000 (11:00 +0200)
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>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c

index 72b37ba8e2a9fee71cd703bd95bde7b4be91f420..594bdecd61c6c04489ee6a79f16e2d1acff66388 100644 (file)
@@ -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)