]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: pcs: introduce per-variant SerDes deactivate helpers
authorJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 22 Apr 2026 13:26:11 +0000 (13:26 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 26 May 2026 06:37:59 +0000 (08:37 +0200)
commitc484f93a0bd7b38150ea557686715c92b9bafeb1
tree04662650fb92b22d8be1fb651969977cf29a78f7
parent81fde127a888913cf3501f2bb5607298a782ebf5
realtek: pcs: introduce per-variant SerDes deactivate helpers

Add rtpcs_{838x,930x,931x}_sds_deactivate() helpers that each encapsulate
the variant-specific "make SerDes inert before reconfigure" sequence, and
replace the inline calls at the start of each setup_serdes with a single
call to the new helper:

 - 838x: wraps rtpcs_838x_sds_power(sds, false)
 - 930x: wraps rtpcs_930x_sds_set_mode(sds, RTPCS_SDS_MODE_OFF)
 - 931x: rtpcs_931x_sds_power(sds, false) + rtpcs_931x_sds_set_mode(sds,
         RTPCS_SDS_MODE_OFF)

RTL839x has no deactivate step to factor out and is left unchanged.

This is a pure refactor: same register writes, same order, same return-
value handling at the call site. The helpers give each variant a named
hook for the deactivate phase and prepare for a subsequent commit that
promotes it to an rtpcs_sds_ops entry and hoists the call site into
rtpcs_pcs_config.

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