1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/dsa
Luiz Angelo Daros de Luca 5edc6585aa net: dsa: realtek: keep default LED state in rtl8366rb
This switch family supports four LEDs for each of its six ports. Each
LED group is composed of one of these four LEDs from all six ports. LED
groups can be configured to display hardware information, such as link
activity, or manually controlled through a bitmap in registers
RTL8366RB_LED_0_1_CTRL_REG and RTL8366RB_LED_2_3_CTRL_REG.

After a reset, the default LED group configuration for groups 0 to 3
indicates, respectively, link activity, link at 1000M, 100M, and 10M, or
RTL8366RB_LED_CTRL_REG as 0x5432. These configurations are commonly used
for LED indications. However, the driver was replacing that
configuration to use manually controlled LEDs (RTL8366RB_LED_FORCE)
without providing a way for the OS to control them. The default
configuration is deemed more useful than fixed, uncontrollable turned-on
LEDs.

The driver was enabling/disabling LEDs during port_enable/disable.
However, these events occur when the port is administratively controlled
(up or down) and are not related to link presence. Additionally, when a
port N was disabled, the driver was turning off all LEDs for group N,
not only the corresponding LED for port N in any of those 4 groups. In
such cases, if port 0 was brought down, the LEDs for all ports in LED
group 0 would be turned off. As another side effect, the driver was
wrongly warning that port 5 didn't have an LED ("no LED for port 5").
Since showing the administrative state of ports is not an orthodox way
to use LEDs, it was not worth it to fix it and all this code was
dropped.

The code to disable LEDs was simplified only changing each LED group to
the RTL8366RB_LED_OFF state. Registers RTL8366RB_LED_0_1_CTRL_REG and
RTL8366RB_LED_2_3_CTRL_REG are only used when the corresponding LED
group is configured with RTL8366RB_LED_FORCE and they don't need to be
cleaned. The code still references an LED controlled by
RTL8366RB_INTERRUPT_CONTROL_REG, but as of now, no test device has
actually used it. Also, some magic numbers were replaced by macros.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-04-29 13:35:40 +01:00
..
b53 net: dsa: b53: provide own phylink MAC operations 2024-04-25 11:46:38 -07:00
hirschmann net: dsa: hellcreek: Convert to gettimex64() 2024-03-29 10:44:17 +00:00
microchip net: dsa: microchip: drop unneeded MODULE_ALIAS 2024-04-16 17:13:15 -07:00
mv88e6xxx Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-25 12:41:37 -07:00
ocelot net: dsa: felix: flower: validate control flags 2024-04-18 17:08:30 -07:00
qca net: dsa: qca8k: provide own phylink MAC operations 2024-04-16 10:23:38 +02:00
realtek net: dsa: realtek: keep default LED state in rtl8366rb 2024-04-29 13:35:40 +01:00
sja1105 net: dsa: sja1105: flower: validate control flags 2024-04-18 17:08:37 -07:00
xrs700x net: dsa: xrs700x: fix missing initialisation of ds->phylink_mac_ops 2024-04-19 12:11:17 +01:00
bcm_sf2.c net: dsa: bcm_sf2: provide own phylink MAC operations 2024-04-17 18:27:42 -07:00
bcm_sf2.h net: dsa: bcm_sf2: drop priv->master_mii_dn 2024-01-05 11:56:36 +00:00
bcm_sf2_cfp.c net: dsa: Use conduit and user terms 2023-10-24 13:08:14 -07:00
bcm_sf2_regs.h net: dsa: bcm_sf2: refactor LED regs access 2021-12-30 17:28:32 -08:00
dsa_loop.c net: dsa: dsa_loop: add phylink capabilities 2023-10-11 10:06:05 +01:00
dsa_loop.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsa_loop_bdinfo.c net: fill in MODULE_DESCRIPTION()s for dsa_loop_bdinfo 2024-02-09 14:12:02 -08:00
Kconfig net: dsa: mt7530: select MEDIATEK_GE_PHY for NET_DSA_MT7530_MDIO 2024-01-26 20:31:52 -08:00
lan9303-core.c net: dsa: lan9303: use ethtool_puts() for lan9303_get_strings() 2024-04-26 12:37:02 -07:00
lan9303.h net: dsa: be compatible with masters which unregister on shutdown 2021-09-19 12:08:37 +01:00
lan9303_i2c.c net: dsa: Switch i2c drivers back to use .probe() 2023-05-31 09:52:55 +01:00
lan9303_mdio.c net: dsa: lan9303: consequently nested-lock physical MDIO 2023-11-02 10:48:09 +01:00
lantiq_gswip.c net: dsa: lantiq_gswip: provide own phylink MAC operations 2024-04-16 10:23:51 +02:00
lantiq_pce.h net: dsa: Use the correct style for SPDX License Identifier 2019-09-22 15:25:08 -07:00
Makefile net: dsa: mt7530: introduce driver for MT7988 built-in switch 2023-04-03 10:13:01 +01:00
mt7530-mdio.c net: dsa: mt7530-mdio: read PHY address of switch from device tree 2024-04-23 10:32:40 +02:00
mt7530-mmio.c net: dsa: mt7530: Convert to platform remove callback returning void 2023-09-20 10:25:57 +01:00
mt7530.c net: dsa: mt7530: explain exposing MDIO bus of MT7531AE better 2024-04-24 11:57:03 +01:00
mt7530.h net: dsa: mt7530: get rid of mac_port_validate member of mt753x_info 2024-04-24 11:57:03 +01:00
mv88e6060.c net: dsa: mv88e6060: add phylink_get_caps implementation 2023-08-14 18:57:17 -07:00
mv88e6060.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rzn1_a5psw.c net: dsa: rzn1_a5psw: provide own phylink MAC operations 2024-04-17 18:29:30 -07:00
rzn1_a5psw.h net: dsa: rzn1-a5psw: add vlan support 2023-08-11 11:58:36 +01:00
vitesse-vsc73xx-core.c net: dsa: vsc73xx: Add define for max num of ports 2024-04-22 14:21:32 -07:00
vitesse-vsc73xx-platform.c net: dsa: vitesse-vsc73xx: Convert to platform remove callback returning void 2023-09-20 10:25:58 +01:00
vitesse-vsc73xx-spi.c net: dsa: vitesse-vsc73xx: remove unnecessary set_drvdata() 2022-09-22 19:30:39 -07:00
vitesse-vsc73xx.h net: dsa: vsc73xx: add structure descriptions 2024-04-22 14:21:32 -07:00