realtek: rtl930x: Allow to overwrite LED portmask
authorHarshal Gohel <[email protected]>
Fri, 11 Jul 2025 14:50:37 +0000 (14:50 +0000)
committerHauke Mehrtens <[email protected]>
Mon, 6 Oct 2025 22:13:43 +0000 (00:13 +0200)
commitebb79d0f846a957b3046825ed644b8b936451431
tree8c614547d5a553de79af4d14aae1e05809038327
parent78df0493d37421ce802c0b92747507b970d8cb0e
realtek: rtl930x: 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.

Signed-off-by: Harshal Gohel <[email protected]>
Co-developed-by: Sven Eckelmann <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20300
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c