]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl930x: decommission temporary helper
authorJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 23 Mar 2026 20:48:50 +0000 (21:48 +0100)
committerRobert Marko <robimarko@gmail.com>
Thu, 26 Mar 2026 09:53:46 +0000 (10:53 +0100)
Decommission a helper for applying config/patch sequences for even/odd
SerDes. Most of these sequences were squashed due to marginal
difference, sharing a lot of common parts. For the marginal differences,
testing showed that the different values were already present on
even/odd. Since those are no reset/trigger bits but just configuration
values, writing them for both should do no harm.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22582
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c

index 2bdc18a6a13c10327c6f9589457d980984c9ca3f..d1bbaa2ea0ce3af6ea1f2ae67084e37abc5d8a9b 100644 (file)
@@ -2818,9 +2818,6 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd
 
        apply_fn = is_xsgmii ? rtpcs_sds_apply_config_xsg : rtpcs_sds_apply_config;
 
-#define APPLY_EO(sds, is_even, e, o) \
-       apply_fn(sds, (is_even) ? (e) : (o), (is_even) ? ARRAY_SIZE(e) : ARRAY_SIZE(o))
-
        /* USXGMII-QX broken, rely on bootloader setup */
        if (hw_mode == RTPCS_SDS_MODE_USXGMII_10GQXGMII)
                return 0;
@@ -2895,12 +2892,16 @@ static int rtpcs_930x_sds_config_hw_mode(struct rtpcs_serdes *sds, enum rtpcs_sd
                return 0;
        }
 
-       APPLY_EO(sds, is_even_sds, rtpcs_930x_sds_cfg_final_even, rtpcs_930x_sds_cfg_final_odd);
+       if (is_even_sds)
+               apply_fn(sds, rtpcs_930x_sds_cfg_final_even,
+                        ARRAY_SIZE(rtpcs_930x_sds_cfg_final_even));
+       else
+               apply_fn(sds, rtpcs_930x_sds_cfg_final_odd,
+                        ARRAY_SIZE(rtpcs_930x_sds_cfg_final_odd));
 
        if (hw_mode == RTPCS_SDS_MODE_10GBASER && is_even_sds)
                rtpcs_sds_write(sds, 0x2F, 0x1D, 0x76E1);
 
-#undef APPLY_EO
        return 0;
 }