Re: [PATCH 1/2] net: phy: motorcomm: add led_brightness_set for YT8521

From: Andrew Lunn

Date: Tue Nov 10 2026 - 12:04:17 EST


On Tue, Nov 10, 2026 at 06:00:00PM +0800, Chukun Pan wrote:
> Add support for manual brightness setting on YT8521/YT8531 PHY.

Has this been tested on real hardware? Have you had it blinking the
heartbeat? Shift-lock etc.

> --- a/drivers/net/phy/motorcomm.c
> +++ b/drivers/net/phy/motorcomm.c
> @@ -258,6 +258,10 @@
> #define YTPHY_WCR_INTR_SEL BIT(6)
> #define YTPHY_WCR_ENABLE BIT(3)
>
> +#define YTPHY_LED_GENERAL_CFG_REG 0xA00B
> +#define YTPHY_LED_FORCE_MODE(x) BIT((x) * 3)
> +#define YTPHY_LED_FORCE_EN(x) BIT((x) * 3 + 2)
> +
> /* 2b00 84ms
> * 2b01 168ms *default*
> * 2b10 336ms

I _think_ this is the wrong place to insert these. 2b00 84ms refers to
YTPHY_WCR_PULSE_WIDTH_MASK which is used with YTPHY_WOL_CONFIG_REG? So
you insert these in the middle of WOL bits.

The sorting of registers is a bit messed up in this driver, but i
think you need to insert before:

#define YTPHY_PAD_DRIVE_STRENGTH_REG 0xA010

Andrew

---
pw-bot: cr