diff options
| author | Jonas Jelonek | 2025-12-20 20:40:12 +0000 |
|---|---|---|
| committer | Robert Marko | 2025-12-29 16:06:19 +0000 |
| commit | f67d9ed9b44b1838dd2cabbc48b228be5a8ff434 (patch) | |
| tree | 9d6825dc6f6c06ea7ec3eefa0a9733a418edf677 | |
| parent | 6614fcb95ef71c666cf3c169754f39c14a03921b (diff) | |
| download | openwrt-f67d9ed9b44b1838dd2cabbc48b228be5a8ff434.tar.gz | |
realtek: pcs: rtl931x: merge helper into mode setting
Merge the 'rtpcs_931x_sds_disable' helper into the MII mode setting and
use that instead. The helper was essentially doing same just with a
value for OFF state.
Moreover, the name of the helper was confusing. It implied it disables
the whole SerDes. However, this is used in Fiber mode setting and thus,
cannot completely disable the SerDes.
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
| -rw-r--r-- | target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 12 |
1 files changed, 4 insertions, 8 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 48b890114f..2c49d90531 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 @@ -2384,6 +2384,9 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds, int shift = ((sds->id & 0x3) << 3); switch (mode) { + case PHY_INTERFACE_MODE_NA: + val = 0x1f; + break; case PHY_INTERFACE_MODE_QSGMII: val = 0x6; break; @@ -2407,12 +2410,6 @@ static void rtpcs_931x_sds_mii_mode_set(struct rtpcs_serdes *sds, 0xff << shift, val << shift); } -static void rtpcs_931x_sds_disable(struct rtpcs_serdes *sds) -{ - regmap_write(sds->ctrl->map, - RTL931X_SERDES_MODE_CTRL + (sds->id >> 2) * 4, 0x9f); -} - static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds, phy_interface_t mode) { @@ -2420,8 +2417,7 @@ static void rtpcs_931x_sds_fiber_mode_set(struct rtpcs_serdes *sds, /* clear symbol error count before changing mode */ rtpcs_931x_sds_clear_symerr(sds, mode); - - rtpcs_931x_sds_disable(sds); + rtpcs_931x_sds_mii_mode_set(sds, PHY_INTERFACE_MODE_NA); switch (mode) { case PHY_INTERFACE_MODE_SGMII: |