Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796462379; b=3MdMAay6YKvTpuxgwi6urQUAD4oAzfcZvJU7ViCwbUCUj2hwVfdjePcDt1mPG69BKoBB BBOG9uAMD7lEjAGEJ3VQOI2fuEkBt5bZxA/KIG1CCZruxZBTjldBGonQhr3/cZOMm0PIx 4BdYVUN5Oh1icdvdnk6lvCO3GWDr1ry7hwHwwF9jSJ+xceSzwCs4VSp9yRarOfjUDUuL9 CX70MGe0hLnVTKvkkMdVMt9uPiR4ws3ZzhS9dqT3W5sBC5QJsk1cU9WVEvbU0JdpHm9kk 3Pz4z0SBjzTdgN+jlwuPs4mVMj/kfYMqASPW+Q9nL8PHQdTP2Hef7UDQdUZEpIyn7rQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796462379; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=x3Sv+iUzayV9teKutMBWnit+Fx7CYM4SNtgJYDfYTF4=; b=qc+hJggjf+zxZQwujdRuwlArKKu7E3+gP1k9g7N+Ge9MhmxH7fFktecv/GysHEFh86gh tlquNIAB8uJaCjQk8mjk1IJCXKdm81+q7WzoRZCtJCN3adp/y0NOtvk8EZc5mOaJBgK7C S9lKA0N0b8zYnmZ1WGSXMYEQRYi5drnJPZjtfqyXmiqIsIgZixNj2NPSyaBjCLO1IqliI UAgnsXDtlZmQ8Vv6/SkUirLwlrJNJjcm+3HwAi0tqphpgPKO9aZHlgVxoCCCaMn0xsd4A SB4ibwGKf0iPma3IFwHmXoUvZcNqAdeeYeNg2JEY8Zd/d7A9GDbeHB6R8e9bpuOrvlQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cLWwf7X+; arc=none smtp.remote-ip=209.85.167.54 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DE14606A322 for ; Sat, 5 Dec 2026 09:19:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5DE14606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cLWwf7X+ Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-5c126f80426so1706978e87.1 for ; Sat, 05 Dec 2026 01:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796462377; x=1797067177; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=x3Sv+iUzayV9teKutMBWnit+Fx7CYM4SNtgJYDfYTF4=; b=cLWwf7X+9BGqR+b3MlinvWYE2i6cI//mTyzr4RE8GBF2FARi227XTXA18UjCWwhT2n extfzaUmIqckvoqNJx/E/q/p7z+mNWfbTFpOHeYV4FcSZTK86UKHUCSD5gRRq5t21QOj CBPLXYpvvSdrNzh19JQEudzJ0+vZjJA1WsAXnhXIGDOl/RAurTh3aPk5Dirf5W6e2awd IoFbYVenOCdMN7p1Bs/11B5Ayrqw/hBJsoqUasTQQQXhQaF88p0t4i8p8rE9JJ6ptQ1N xP3pv6GnPiXT7MUR3PCCaIEyazcde2V77NuMIodVbKxSiIn+jcRhSb87XfU1LNEMOHt0 T6Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796462377; x=1797067177; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=x3Sv+iUzayV9teKutMBWnit+Fx7CYM4SNtgJYDfYTF4=; b=Oi27PQudIAeuj2Xed9G5Dcu/Js3piGlp/nCCaiRdbG1EQoJoujpLlJ2Hyu2PoMhB+L sOronAqnBWch329GVLI97MoINpmifh4pE4n2cGunAW4GMsvgH0S72c3L37l3NWVRdH4X 8m3uIn6Iyq5ivG8g6UPAGwOQvCsGp63VoEje6Xn3/rXfbnSbLarGSi7rVdAXc213Tt+I acQqYHV+WqG2quoAfZXI94qJMTlV3dShSQ5CJTIgOEWZIG4G1MZPGTgXP6Si2rVht6jZ iBiAdV76LEOs0d6Q1qfmP9jVI3kkiZMW85wpvVZQ0E5CmL5AtJGjrMci0Ft0e/8ORupZ CG3Q== X-Forwarded-Encrypted: i=1; AL+hErFWSfMoqnbBo4lzP8aBcTrU1d3qOhivAG7LqdxYCGxnyLdaq1OQ26VH4TRREvOf/Q1WhhdubdZQFQIv@vger.kernel.org X-Gm-Message-State: AB4q+uFT1Ec5OE+cEXbcPPWCnYc8p26mLW3IvMQQRJjUImECKafzxwSJ n+tihKTu3+hxRaw5PnsylAggl9VoRjTIPRCTkV6DKGZNPHHdJOqO/6vf X-Gm-Gg: AZFdTZe6er7VO7Evw4i6YgHfMyLMVzz+gz6wwV2z6o4lmIFt6oUeF1uoDH0Jy6DWGUS XMleZ7XiD6BAGg7SrSF2kk74gGifSbdKDykanJVZB3Y0upTxWxMYAo0sYjF0n4aQFrTAvwRU1ty eze0hs81q6iPfSZVr0iKzYcsstpNceccnGrmCi99vyBD3xRWQqvyJGd26PkB8YBA67xGYfcQun0 1uguhqmYZATAbwbHdG4MpnM25gy/4XFYlQIVYWjXkDMdMOUjPFgMEbo4E52PjMkWDL0f5MNqJYe g0H6v9rVIDwiTOD445vo1Ls4ve+IqLoXXpB0dhHLlW3RVRSV5xAmW/xlVSbgaZHInPau3jlsNTC 56qZVvlJlXxOVBKxAZk/sbdsgOQu63L6y7VaqhZybDXsuQXy7MNg0Iu6i4LF07CM6zzTi4jDwaS X828Ia7Xp03DmVETuD1DrTxM0VjrM0ggHLw4Pw8kL7bdpBRwytxqbryZADS6kfqdYVqptapLLRi xYkLmmdp6D3rptl7ulJ0LmenhhR+MBum6utuzXb94wZzX+GF+JC8QoWOQqjChCoxqNnxf/akio0 BC72SANZRHPHrlm0d4LrTzaFmEg1E0ZhQB5qDs3XXVOjU6Q= X-Received: by 2002:a05:6512:1242:b0:5c1:6065:40d with SMTP id 2adb3069b0e04-5c38616feb2mr1033015e87.38.1796462376467; Sat, 05 Dec 2026 01:19:36 -0800 (PST) Received: from NB-6746.corp.yadro.com ([188.243.183.76]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5c384aa29c8sm1290667e87.63.2026.12.05.01.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 01:19:36 -0800 (PST) From: Artem Shimko To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, maxime.chevallier@bootlin.com, pavel@ucw.cz Cc: Artem Shimko , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next v10 0/2] net: phy: dap8211r: add LED control support Date: Sat, 5 Dec 2026 12:19:29 +0300 Message-ID: <20261205091933.3244976-1-a.shimko.dev@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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