]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl930x: give some calibration functions meaningful names
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 27 Jun 2026 17:25:02 +0000 (17:25 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 28 Jun 2026 21:38:36 +0000 (23:38 +0200)
Adapted from the SDK, the calibration functions are just named after
their sequential logic and with a numbering scheme. This doesn't help
understanding what the code is doing. Instead, give some of them
meaningful names where possible, revealing kind of a logical structure.

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

index 8f0902e8fb90574527211ce419fb01d6456ce480..9f03e6bd5c8620992dc89c7a6eede7a7975b9a4d 100644 (file)
@@ -2491,7 +2491,7 @@ static void rtpcs_930x_sds_do_rx_calibration_1(struct rtpcs_serdes *sds,
        /* --- 1.1.5 */
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_2(struct rtpcs_serdes *sds)
+static void rtpcs_930x_sds_rxcal_fgcal(struct rtpcs_serdes *sds)
 {
        struct rtpcs_serdes *even_sds = rtpcs_sds_get_even(sds);
        u32 fgcal_binary, fgcal_gray;
@@ -2618,7 +2618,7 @@ static void rtpcs_930x_sds_do_rx_calibration_3(struct rtpcs_serdes *sds,
        /* --- 1.3.2 */
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_4(struct rtpcs_serdes *sds)
+static void rtpcs_930x_sds_rxcal_vth_tap0_adapt_lock(struct rtpcs_serdes *sds)
 {
        u32 tap0_list[4] = {0};
        u32 vth_list[2] = {0};
@@ -2639,7 +2639,7 @@ static void rtpcs_930x_sds_do_rx_calibration_4(struct rtpcs_serdes *sds)
        rtpcs_930x_sds_rxcal_tap_manual(sds, 0, true, tap0_list);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_5(struct rtpcs_serdes *sds)
+static void rtpcs_930x_sds_rxcal_dfe_taps_adapt(struct rtpcs_serdes *sds)
 {
        u32 tap1_list[4] = {0};
        u32 tap2_list[4] = {0};
@@ -2655,7 +2655,7 @@ static void rtpcs_930x_sds_do_rx_calibration_5(struct rtpcs_serdes *sds)
        mdelay(30);
 }
 
-static void rtpcs_930x_sds_do_rx_calibration_dfe_disable(struct rtpcs_serdes *sds)
+static void rtpcs_930x_sds_rxcal_dfe_disable(struct rtpcs_serdes *sds)
 {
        u32 tap1_list[4] = {0};
        u32 tap2_list[4] = {0};
@@ -2676,21 +2676,21 @@ static void rtpcs_930x_sds_do_rx_calibration(struct rtpcs_serdes *sds,
        u32 latch_sts;
 
        rtpcs_930x_sds_do_rx_calibration_1(sds, hw_mode);
-       rtpcs_930x_sds_do_rx_calibration_2(sds);
-       rtpcs_930x_sds_do_rx_calibration_4(sds);
+       rtpcs_930x_sds_rxcal_fgcal(sds);
+       rtpcs_930x_sds_rxcal_vth_tap0_adapt_lock(sds);
 
        /* Do this only for 10GR mode */
        if (hw_mode == RTPCS_SDS_MODE_10GBASER) {
-               rtpcs_930x_sds_do_rx_calibration_5(sds);
+               rtpcs_930x_sds_rxcal_dfe_taps_adapt(sds);
                mdelay(20);
 
                latch_sts = rtpcs_sds_read_bits(sds, PAGE_TGR_STD_0, 1, 2, 2);
                mdelay(1);
                latch_sts = rtpcs_sds_read_bits(sds, PAGE_TGR_STD_0, 1, 2, 2);
                if (latch_sts) {
-                       rtpcs_930x_sds_do_rx_calibration_dfe_disable(sds);
-                       rtpcs_930x_sds_do_rx_calibration_4(sds);
-                       rtpcs_930x_sds_do_rx_calibration_5(sds);
+                       rtpcs_930x_sds_rxcal_dfe_disable(sds);
+                       rtpcs_930x_sds_rxcal_vth_tap0_adapt_lock(sds);
+                       rtpcs_930x_sds_rxcal_dfe_taps_adapt(sds);
                }
        }
 }