summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/motorcomm/leds.c
AgeCommit message (Collapse)Author
2026-10-08net: dsa: motorcomm: Hoist type casting helper into chip.hDavid Yang
Rename and move dsa_to_yt921x_priv() and yt921x_priv_to_device() to chip.h so all files use one definition. Signed-off-by: David Yang <mmyangfl@gmail.com> Link: https://patch.msgid.link/20261004160622.948037-2-mmyangfl@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-10-05net: dsa: motorcomm: Fix register rollback in LED setupDavid Yang
The LED error path writes back a stale snapshot of the whole words taken before the class device registration, silently reverting LED2 state of sibling LED groups already registered and reachable from sysfs. Although the odds are very small, fix it by reverting this group's fields only for correctness. Fixes: 9af9a8168213 ("net: dsa: motorcomm: Add LED support") Signed-off-by: David Yang <mmyangfl@gmail.com> Link: https://patch.msgid.link/20260930141151.3973221-1-mmyangfl@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-25net: dsa: motorcomm: Hoist port_to_priv helper into chip.hDavid Yang
yt921x_poll_mib() open-codes the same container_of_const() expression that leds.c defines as to_yt921x_priv(). Move the macro to chip.h as yt921x_port_to_priv() so both files use one definition. Signed-off-by: David Yang <mmyangfl@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20260923021945.2203368-7-mmyangfl@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-21net: dsa: motorcomm: fix unused-function warningArnd Bergmann
gcc warns about an unused function here because the __maybe_unused attribute is in the wrong part of the prototype: drivers/net/dsa/motorcomm/leds.c:352:1: error: 'yt921x_cled_hw_control_get_device' defined but not used [-Werror=unused-function] 352 | yt921x_cled_hw_control_get_device(struct led_classdev *led_cdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Move the __maybe_unused attribute to refer to the function rather than the returned object. Fixes: 9af9a8168213 ("net: dsa: motorcomm: Add LED support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20260916082707.3973287-1-arnd@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-09net: dsa: motorcomm: Handle degenerated blink delaysDavid Yang
The LED core defines delay_on == 0 as steady off and delay_off == 0 as steady on, which was treated as a blink in our LED driver. Fix it. Fixes: 9af9a8168213 ("net: dsa: motorcomm: Add LED support") Signed-off-by: David Yang <mmyangfl@gmail.com> Link: https://patch.msgid.link/20260904134752.635133-1-mmyangfl@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-09-02net: dsa: motorcomm: Add LED supportDavid Yang
Each port has at most 3 LEDs connected and can be declared using the standard LEDs structure. Currently, only parallel mode and strict 1:1 mapping (i.e. the HW default) are supported. Signed-off-by: David Yang <mmyangfl@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/20260831044818.4103477-5-mmyangfl@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>