devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net: dsa: realtek: fix LED support for rtl8366
@ 2024-03-10  4:51 Luiz Angelo Daros de Luca
  2024-03-10  4:51 ` [PATCH net-next 1/4] dt-bindings: net: dsa: realtek: describe LED usage Luiz Angelo Daros de Luca
  0 siblings, 1 reply; 15+ messages in thread
From: Luiz Angelo Daros de Luca @ 2024-03-10  4:51 UTC (permalink / raw)
  To: Linus Walleij, Alvin Šipraga, Andrew Lunn, Florian Fainelli,
	Vladimir Oltean, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: netdev, linux-kernel, Luiz Angelo Daros de Luca, devicetree

This series fixes the LED support for rtl8366. The existing code was not
tested in a device with switch LEDs and it was using a flawed logic.

The driver now keeps the default LED configuration if nothing requests a
different behavior. This may be enough for most devices. This can be
achieved either by omitting the LED from the device-tree or configuring
all LEDs in a group with the default state set to "keep".

The hardware trigger for LEDs in Realtek switches is shared among all
LEDs in a group. This behavior doesn't align well with the Linux LED
API, which controls LEDs individually. Once the OS changes the
brightness of a LED in a group still triggered by the hardware, the
entire group switches to software-controlled LEDs. This shared behavior
also prevents offloading the trigger to the hardware as it would require
an orchestration between LEDs in a group, not currently present in the
LED API.

The assertion of device hardware reset during driver removal was removed
because it was causing an issue with the LED release code. Devres
devices are released after the driver's removal is executed. Asserting
the reset at that point was causing timeout errors during LED release
when it attempted to turn off the LED.
 

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
---
Changes in v1:
- Rebased on new relatek DSA drivers
- Improved commit messages
- Added commit to remove the reset assert during .remove
- Link to RFC: https://lore.kernel.org/r/20240106184651.3665-1-luizluca@gmail.com

---
Luiz Angelo Daros de Luca (4):
      dt-bindings: net: dsa: realtek: describe LED usage
      net: dsa: realtek: keep default LED state in rtl8366rb
      net: dsa: realtek: do not assert reset on remove
      net: dsa: realtek: add LED drivers for rtl8366rb

 .../devicetree/bindings/net/dsa/realtek.yaml       |  46 +++
 drivers/net/dsa/realtek/rtl8366rb.c                | 341 ++++++++++++++++-----
 drivers/net/dsa/realtek/rtl83xx.c                  |   7 +-
 3 files changed, 306 insertions(+), 88 deletions(-)
---
base-commit: d7e14e534493328cc5f67baaff2b0c23d32b0a57
change-id: 20240212-realtek-led-a665ae39a9c5

Best regards,
-- 
Luiz Angelo Daros de Luca <luizluca@gmail.com>


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-03-25  7:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-10  4:51 [PATCH net-next 0/4] net: dsa: realtek: fix LED support for rtl8366 Luiz Angelo Daros de Luca
2024-03-10  4:51 ` [PATCH net-next 1/4] dt-bindings: net: dsa: realtek: describe LED usage Luiz Angelo Daros de Luca
2024-03-10  8:34   ` Krzysztof Kozlowski
2024-03-21 11:56     ` Luiz Angelo Daros de Luca
2024-03-21 12:18       ` Krzysztof Kozlowski
2024-03-24  2:10         ` Luiz Angelo Daros de Luca
2024-03-25  7:41           ` Krzysztof Kozlowski
2024-03-10 18:02   ` Andrew Lunn
2024-03-21 12:03     ` Luiz Angelo Daros de Luca
2024-03-10 18:31   ` Linus Walleij
2024-03-21 11:57     ` Luiz Angelo Daros de Luca
2024-03-10 18:52   ` Andrew Lunn
2024-03-21 11:58     ` Luiz Angelo Daros de Luca
2024-03-10 23:08   ` Rob Herring
2024-03-21 12:00     ` Luiz Angelo Daros de Luca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).