]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: harmonize power functions for RTL8214FC 18707/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 4 May 2025 19:40:00 +0000 (15:40 -0400)
committerRobert Marko <robimarko@gmail.com>
Thu, 22 May 2025 08:34:18 +0000 (10:34 +0200)
commitd8ca43ccf18a5af3965b4b8de60aabcc78eabe0d
treea00b949e697f9d8be4ef386682a6a7325b498616
parentcc360fa54d83488346fa9a0ae6c71b5ddf2f4ec6
realtek: harmonize power functions for RTL8214FC

There are currently two power functions for the RTL8214FC in the driver

- rtl8380_rtl8214fc_on_off(): powers on/off both ports
- rtl8214fc_power_set(): powers on/off fibre or copper individually

While it seems obvious to merge these, one of them uses extended register
29 and the other register 30 to achieve the update. From looking at the
GPL source drops both methods exist with exactly the same operations. So
where to go from here? The descision was made based on:

- register 30 is only used during patching, 29 during normal operation
- Avoid raw page if possible to use function for RTL839x

So the attached patch was created. The result in the power down bits
was compared for the two old and the new implementation. Result is
always the same.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18707
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.6/drivers/net/phy/rtl83xx-phy.c