]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: rtl931x: Allow to overwrite LED portmask 20300/head
authorHarshal Gohel <hg@simonwunderlich.de>
Tue, 15 Jul 2025 17:53:07 +0000 (19:53 +0200)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 6 Oct 2025 22:13:43 +0000 (00:13 +0200)
commit9f5e43b8da7dad8d5e3ba5786d0810d25a0de384
tree826c2c29e9064ddf44baa6b67c89bfc225480396
parent254c9ac40bdb93f8b015e42039ca597bc9bde57f
realtek: rtl931x: Allow to overwrite LED portmask

There are switches which share the same overall hardware design but remove
just a couple of components for the low cost variant. For example, a 8+2
(ethernet+SFP) switch might have a low cost variant which only has 8
ethernet ports. In this case, the PCB will be shared but components for SFP
will just be dropped.

The LED shift registers will be the same between the two switches but the
ports are different. But since the rtl930x_led_init code is trying to
calculate the number of LEDs using the LED ports, the ethernet status ports
will then suddenly be shifted by two ports.

It is therefore necessary to have a mechanism to overwrite the detection of
the ethernet ports in the LED initialization and force some ports to
"virtually there" for the LED controller.

This functionality was already implemented for Plasma Cloud PSX8 (RTL930x)
but some devices using RTL931x might also benefit from a similar feature.

Signed-off-by: Harshal Gohel <hg@simonwunderlich.de>
Co-developed-by: Sven Eckelmann <se@simonwunderlich.de>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20300
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c