On Mon, Nov 30, 2026 at 01:29:45PM +0200, Cristian Ciocaltea wrote:
> On 11/30/26 5:01 AM, Andrew Lunn wrote:
> >> + if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
> >> + return -EOPNOTSUPP;
> >> +
> >> return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> >> VEND1_LED_REG(index),
> >> VEND1_LED_REG_A_EVENT,
> >
> > This works, but maybe:
> >
> > for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
> > if (rules == as21xxx_led_supported_pattern[i].pattern) {
> > val = as21xxx_led_supported_pattern[i].val;
> > return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> > VEND1_LED_REG(index),
> > VEND1_LED_REG_A_EVENT,
> > FIELD_PREP(VEND1_LED_REG_A_EVENT,
> > val));
> >
> > }
> >
> > return -EOPNOTSUPP
> > }
>
> On upcoming Gen2 PHY the LEDs are meant to be driven by the firmware via IPC
> rather than by writing the vendor LED registers directly.
Why would a vendor implement an IPC, when MDIO is already an IPC?
It seems to me the quality of design of PHYs has gone down in recent
years.
Anyway...
> info = aeon_led_find_pattern(phydev, rules);
> if (!info)
> return -EOPNOTSUPP;
>
> return data->led_ops->set_event(phydev, index, info->val);
This is fine. I just did not like the:
if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
but that seems to be going away.
Reviewed-by: Andrew Lunn <andr…@lunn.ch>
Andrew