* [PATCH net-next v10 0/2] net: phy: dap8211r: add LED control support
@ 2026-12-05 9:18 Artem Shimko
0 siblings, 0 replies; 2+ messages in thread
From: Artem Shimko @ 2026-12-05 9:18 UTC (permalink / raw)
To: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, robh,
krzk+dt, conor+dt, maxime.chevallier, pavel
Cc: Artem Shimko, linux-kernel, devicetree, linux-leds, netdev
Hello,
This series adds support for LEDs on the DAP8211R
Gigabit Ethernet PHY.
The first patch fixes mistakes in function comments about locking mdio.
The second patch introduces a small helper to write extended
registers, since the LED registers are accessed indirectly via
EXT_ADD/EXT_DATA and implements the four LED callbacks
required by the PHY library.
Hardware verification notes:
Bit 13 (DAP8211R_LED_ACT_BLINK) in LED_x_CON enables blinking strictly
for the enabled TX/RX direction bits (bits 10/9) rather than blinking
unconditionally on any activity; without bit 13 set, the LED does not
blink on traffic.
Both genphy_soft_reset() and the device mode software reset
SW_RST_MODE in PHY_CON 0xA001) preserve LED_COMCON and LED_x_CON.
Required:
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_NETDEV=y
Testing:
$ ip link set eth1 up
$ ls /sys/class/leds/
stmmac-1:01:amber:lan stmmac-1:01:green:lan
$ echo netdev > /sys/class/leds/stmmac-1:01:green:lan/trigger
$ echo eth1 > /sys/class/leds/stmmac-1:01:green:lan/device_name
$ echo 1 > /sys/class/leds/stmmac-1:01:green:lan/link_1000
$ cat /sys/class/leds/stmmac-1:01:green:lan/offloaded
$ ip addr add 192.168.5.100/24 dev eth1
$ ping -I eth1 192.168.5.1
$ echo netdev > /sys/class/leds/stmmac-1:01:amber:lan/trigger
$ echo eth1 > /sys/class/leds/stmmac-1:01:amber:lan/device_name
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/tx
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/rx
$ cat /sys/class/leds/stmmac-1:01:amber:lan/offloaded
$ echo none > /sys/class/leds/stmmac-1:01:amber:lan/trigger
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/brightness
$ echo netdev > /sys/class/leds/stmmac-1:01:amber:lan/trigger
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/tx
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/rx
$ ip addr add 192.168.5.100/24 dev eth1
$ ping -I eth1 192.168.5.1
Best regards,
artem
ChangeLog:
v10:
- Check DAP8211R_LED_FORCE_EN(index) in dap8211r_led_hw_control_get()
and return -EOPNOTSUPP when force mode is active, as suggested by
Sashiko AI review.
v9:
- Drop the dt-bindings patch, as ethernet-phy.yaml already covers it.
v8:
- Reference /schemas/leds/common.yaml#
- Add unevaluatedProperties: false
- Drop items under reg in the led@[0-2] subnode of dptel,dap8211r.yaml
- Link: https://lore.kernel.org/all/CAOPX744wYc7JLrjcePWWpAyU_Uzbd37hsxBfjwAmUYRwu1nWow@mail.gmail.com/T/#u
v7:
- Add clear LED_x_CON in the dap8211r_led_brightness_set() function so
that stale settings do not interfere with clearing the FORCE_EN bit in
hw_control_set() when switching back to the `netdev` trigger.
- Link: https://lore.kernel.org/all/20261127063708.3074433-1-a.shimko.dev@gmail.com/T/#t
v6:
- Return -EOPNOTSUPP in dap8211r_led_hw_control_get() if DAP8211R_LED_ACT_BLINK
does not match the presence of DAP8211R_LED_RX or DAP8211R_LED_TX,
preventing incomplete rule reporting and register clobbering.
- Link: https://lore.kernel.org/all/CAOPX747OUSNbg2vqba3LL8r0chrTdpz6hOg1yf-n_wMX+fpQag@mail.gmail.com/T/#u
v5:
- Drop redundant $ref to common.yaml and inner unevaluatedProperties: false
from the led@[0-2] subnode, as they are already inherited from
ethernet-phy.yaml.
- Move write of LED_x_CON first and clear FORCE_EN afterwards in
dap8211r_led_hw_control_set().
- Report TRIGGER_NETDEV_LINK instead of individual speed flags in
dap8211r_led_hw_control_get() when all three link speed bits are set, as
netdev trigger rejects reporting them together. Based on [1].
- Add checking of DAP8211R_LED_ACT_BLINK alongside TX/RX bits in
dap8211r_led_hw_control_get().
- Add -EOPNOTSUPP in dap8211r_led_hw_control_get() if unsupported
hardware bits are set in LED_x_CON.
- Link: [1] https://lists.infradead.org/pipermail/linux-arm-kernel/2026-September/1172246.html
- Link: https://lore.kernel.org/all/179560033613.3135.13122318439070700886@kernel.org/T/#u
v4:
- squash extended register write helper into the LED control patch to
fix netdev/build_32bit, netdev/build_allmodconfig_warn, netdev/build_clang
fails (patchwork.kernel.org)
- add andrew+netdev@lunn.ch to Cc of dt-bindings patch to fix
netdev/cc_maintainers warning (patchwork.kernel.org)
v3:
- fix kernel-doc comment for DAP8211R_LED_FORCE_MODE_ON and
DAP8211R_LED_FORCE_MODE_MASK
- use FIELD_PREP() for DAP8211R_LED_FORCE_MODE_ON
- Link: https://lore.kernel.org/all/20261120081106.2919010-1-a.shimko.dev@gmail.com/T/#t
v2:
- add a commit fixing kernel-doc comments for dap8211r_read_ext() and dap8211r_modify_ext()
- move LED child node down below tx-internal-delay-ps in dptel,dap8211r.yaml
- add blank lines in dptel,dap8211r.yaml
- restrict LED reg index to 0..2 and fix schema properties in dptel,dap8211r.yaml
- fix kernel-doc comment for dap8211r_write_ext()
- add LED brightness (force mode) support to driver
- remove rules == 0 statement
- add TRIGGER_NETDEV_LINK to DAP8211R_LED_SUPPORTED_TRG for dap8211r_led_hw_is_supported()
- clean up switch (index) statements
- Link: https://lore.kernel.org/all/CAOPX74709XiLXLoioDJStTSzzhstC2sHpM4GieAO=3-37E18pw@mail.gmail.com/T/#u
v1:
- Link: https://lore.kernel.org/all/20261113110546.173624-1-a.shimko.dev@gmail.com/T/#t
Artem Shimko (2):
net: phy: dap8211r: fix kernel-doc comments for extended register
helpers
net: phy: dap8211r: add PHY LED control support
drivers/net/phy/dap8211r.c | 279 ++++++++++++++++++++++++++++++++++++-
1 file changed, 277 insertions(+), 2 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH net-next v10 0/2] net: phy: dap8211r: add LED control support
@ 2026-12-05 9:19 Artem Shimko
0 siblings, 0 replies; 2+ messages in thread
From: Artem Shimko @ 2026-12-05 9:19 UTC (permalink / raw)
To: andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni, robh,
krzk+dt, conor+dt, maxime.chevallier, pavel
Cc: Artem Shimko, linux-kernel, devicetree, linux-leds, netdev
Hello,
This series adds support for LEDs on the DAP8211R
Gigabit Ethernet PHY.
The first patch fixes mistakes in function comments about locking mdio.
The second patch introduces a small helper to write extended
registers, since the LED registers are accessed indirectly via
EXT_ADD/EXT_DATA and implements the four LED callbacks
required by the PHY library.
Hardware verification notes:
Bit 13 (DAP8211R_LED_ACT_BLINK) in LED_x_CON enables blinking strictly
for the enabled TX/RX direction bits (bits 10/9) rather than blinking
unconditionally on any activity; without bit 13 set, the LED does not
blink on traffic.
Both genphy_soft_reset() and the device mode software reset
SW_RST_MODE in PHY_CON 0xA001) preserve LED_COMCON and LED_x_CON.
Required:
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_NETDEV=y
Testing:
$ ip link set eth1 up
$ ls /sys/class/leds/
stmmac-1:01:amber:lan stmmac-1:01:green:lan
$ echo netdev > /sys/class/leds/stmmac-1:01:green:lan/trigger
$ echo eth1 > /sys/class/leds/stmmac-1:01:green:lan/device_name
$ echo 1 > /sys/class/leds/stmmac-1:01:green:lan/link_1000
$ cat /sys/class/leds/stmmac-1:01:green:lan/offloaded
$ ip addr add 192.168.5.100/24 dev eth1
$ ping -I eth1 192.168.5.1
$ echo netdev > /sys/class/leds/stmmac-1:01:amber:lan/trigger
$ echo eth1 > /sys/class/leds/stmmac-1:01:amber:lan/device_name
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/tx
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/rx
$ cat /sys/class/leds/stmmac-1:01:amber:lan/offloaded
$ echo none > /sys/class/leds/stmmac-1:01:amber:lan/trigger
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/brightness
$ echo netdev > /sys/class/leds/stmmac-1:01:amber:lan/trigger
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/tx
$ echo 1 > /sys/class/leds/stmmac-1:01:amber:lan/rx
$ ip addr add 192.168.5.100/24 dev eth1
$ ping -I eth1 192.168.5.1
Best regards,
artem
ChangeLog:
v10:
- Check DAP8211R_LED_FORCE_EN(index) in dap8211r_led_hw_control_get()
and return -EOPNOTSUPP when force mode is active, as suggested by
Sashiko AI review.
v9:
- Drop the dt-bindings patch, as ethernet-phy.yaml already covers it.
v8:
- Reference /schemas/leds/common.yaml#
- Add unevaluatedProperties: false
- Drop items under reg in the led@[0-2] subnode of dptel,dap8211r.yaml
- Link: https://lore.kernel.org/all/CAOPX744wYc7JLrjcePWWpAyU_Uzbd37hsxBfjwAmUYRwu1nWow@mail.gmail.com/T/#u
v7:
- Add clear LED_x_CON in the dap8211r_led_brightness_set() function so
that stale settings do not interfere with clearing the FORCE_EN bit in
hw_control_set() when switching back to the `netdev` trigger.
- Link: https://lore.kernel.org/all/20261127063708.3074433-1-a.shimko.dev@gmail.com/T/#t
v6:
- Return -EOPNOTSUPP in dap8211r_led_hw_control_get() if DAP8211R_LED_ACT_BLINK
does not match the presence of DAP8211R_LED_RX or DAP8211R_LED_TX,
preventing incomplete rule reporting and register clobbering.
- Link: https://lore.kernel.org/all/CAOPX747OUSNbg2vqba3LL8r0chrTdpz6hOg1yf-n_wMX+fpQag@mail.gmail.com/T/#u
v5:
- Drop redundant $ref to common.yaml and inner unevaluatedProperties: false
from the led@[0-2] subnode, as they are already inherited from
ethernet-phy.yaml.
- Move write of LED_x_CON first and clear FORCE_EN afterwards in
dap8211r_led_hw_control_set().
- Report TRIGGER_NETDEV_LINK instead of individual speed flags in
dap8211r_led_hw_control_get() when all three link speed bits are set, as
netdev trigger rejects reporting them together. Based on [1].
- Add checking of DAP8211R_LED_ACT_BLINK alongside TX/RX bits in
dap8211r_led_hw_control_get().
- Add -EOPNOTSUPP in dap8211r_led_hw_control_get() if unsupported
hardware bits are set in LED_x_CON.
- Link: [1] https://lists.infradead.org/pipermail/linux-arm-kernel/2026-September/1172246.html
- Link: https://lore.kernel.org/all/179560033613.3135.13122318439070700886@kernel.org/T/#u
v4:
- squash extended register write helper into the LED control patch to
fix netdev/build_32bit, netdev/build_allmodconfig_warn, netdev/build_clang
fails (patchwork.kernel.org)
- add andrew+netdev@lunn.ch to Cc of dt-bindings patch to fix
netdev/cc_maintainers warning (patchwork.kernel.org)
v3:
- fix kernel-doc comment for DAP8211R_LED_FORCE_MODE_ON and
DAP8211R_LED_FORCE_MODE_MASK
- use FIELD_PREP() for DAP8211R_LED_FORCE_MODE_ON
- Link: https://lore.kernel.org/all/20261120081106.2919010-1-a.shimko.dev@gmail.com/T/#t
v2:
- add a commit fixing kernel-doc comments for dap8211r_read_ext() and dap8211r_modify_ext()
- move LED child node down below tx-internal-delay-ps in dptel,dap8211r.yaml
- add blank lines in dptel,dap8211r.yaml
- restrict LED reg index to 0..2 and fix schema properties in dptel,dap8211r.yaml
- fix kernel-doc comment for dap8211r_write_ext()
- add LED brightness (force mode) support to driver
- remove rules == 0 statement
- add TRIGGER_NETDEV_LINK to DAP8211R_LED_SUPPORTED_TRG for dap8211r_led_hw_is_supported()
- clean up switch (index) statements
- Link: https://lore.kernel.org/all/CAOPX74709XiLXLoioDJStTSzzhstC2sHpM4GieAO=3-37E18pw@mail.gmail.com/T/#u
v1:
- Link: https://lore.kernel.org/all/20261113110546.173624-1-a.shimko.dev@gmail.com/T/#t
Artem Shimko (2):
net: phy: dap8211r: fix kernel-doc comments for extended register
helpers
net: phy: dap8211r: add PHY LED control support
drivers/net/phy/dap8211r.c | 279 ++++++++++++++++++++++++++++++++++++-
1 file changed, 277 insertions(+), 2 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-05 9:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05 9:18 [PATCH net-next v10 0/2] net: phy: dap8211r: add LED control support Artem Shimko
-- strict thread matches above, loose matches on Subject: below --
2026-12-05 9:19 Artem Shimko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox