Re: [PATCH net-next v2 3/3] net: phy: mscc: Add support for PHY LED control

From: Andrew Lunn

Date: Mon Nov 10 2025 - 21:53:52 EST


On Fri, Nov 07, 2025 at 08:12:32PM +0000, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
>
> Add support for the PHY LED controller in the MSCC VSC85xx driver. The
> implementation provides LED brightness and hardware control through the
> LED subsystem and integrates with the standard 'netdev' trigger.
>
> Introduce new register definitions for the LED behavior register
> (MSCC_PHY_LED_BEHAVIOR = 30) and the LED combine disable bits, which
> control whether LEDs indicate link-only or combined link and activity
> status. Implement a helper, vsc8541_led_combine_disable_set(), to update
> these bits safely using phy_modify().
>
> Add support for LED brightness control and hardware mode configuration.
> The new callbacks implement the standard LED class operations, allowing
> user control through sysfs. The brightness control maps to PHY LED force
> on/off modes. The hardware control get and set functions translate
> between the PHY-specific LED mode encodings and the LED subsystem
> TRIGGER_NETDEV_* rules.
>
> The combine feature is managed automatically based on the selected
> rules. When both RX and TX activity are disabled, the combine feature is
> turned off, causing LEDs to indicate link-only status. When either RX or
> TX activity is enabled, the combine feature remains active and LEDs
> indicate combined link and activity.
>
> Register the LED callbacks for all VSC85xx PHY variants so that the LED
> subsystem can manage their indicators consistently. Existing device tree
> LED configuration and default behavior are preserved.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew