Re: [PATCH net-next v2] net: phy: marvell: add support for PHY LEDs polarity modes

From: Andrew Lunn

Date: Wed Sep 23 2026 - 17:07:57 EST


On Wed, Sep 23, 2026 at 10:45:24PM +0200, Aleksander Jan Bajkowski wrote:
> Add the led_polarity_set callback for setting LED polarity. Implement
> this callback for the 88E1318 and 88E1510 PHYs. This should also work on
> other Marvell PHYs, but I don't have access to the TRM or the hardware.
>
> Tested on Adapteva Paralella board with Marvell 88E1318 PHY.
>
> Signed-off-by: Aleksander Jan Bajkowski <olek2@xxxxx>
> ---
> Changes in v2:
> - add suppoer for PHY_LED_INACTIVE_HIGH_IMPEDANCE mode
> ---
> drivers/net/phy/marvell.c | 39 ++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
> index f71cffa88406..d57fcabfec2b 100644
> --- a/drivers/net/phy/marvell.c
> +++ b/drivers/net/phy/marvell.c
> @@ -149,6 +149,9 @@
> #define MII_88E1318S_PHY_LED_FUNC_ON (0x9)
> #define MII_88E1318S_PHY_LED_FUNC_HI_Z (0xa)
> #define MII_88E1318S_PHY_LED_FUNC_BLINK (0xb)
> +#define MII_88E1318S_PHY_LED_POL 0x11
> +#define MII_88E1318S_PHY_LED_POL_ACT_HIGH(idx) BIT(2 * (idx))
> +#define MII_88E1318S_PHY_LED_POL_HIGH_IMP(idx) BIT(2 * (idx) + 1)
> #define MII_88E1318S_PHY_LED_TCR 0x12
> #define MII_88E1318S_PHY_LED_TCR_FORCE_INT BIT(15)
> #define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE BIT(7)
> @@ -304,6 +307,8 @@
> #define NB_FIBER_STATS 1
> #define NB_STAT_MAX 3
>
> +#define M88E1318S_MAX_LEDS 3

Why the M88E1318S prefix?

The naming is a bit odd in this file, but maybe NB_MAX_LEDS?

Andrew