Re: [PATCH net-next] net: phy: intel-xway: add support for PHY LEDs

From: Andrew Lunn
Date: Wed Oct 09 2024 - 08:16:56 EST


> +static int xway_gphy_led_polarity_set(struct phy_device *phydev, int index,
> + unsigned long modes)
> +{
> + bool active_low = false;
> + u32 mode;
> +
> + if (index >= XWAY_GPHY_MAX_LEDS)
> + return -EINVAL;
> +
> + for_each_set_bit(mode, &modes, __PHY_LED_MODES_NUM) {
> + switch (mode) {
> + case PHY_LED_ACTIVE_LOW:
> + active_low = true;
> + break;
> + case PHY_LED_ACTIVE_HIGH:
> + break;
> + default:
> + return -EINVAL;
> + }
> + }
> +
> + return phy_modify(phydev, XWAY_MDIO_LED, XWAY_GPHY_LED_INV(index),
> + active_low ? XWAY_GPHY_LED_INV(index) : 0);

This does not appear to implement the 'leave it alone' option.

Andrew