[PATCH net-next 4/4] net: phy: mxl-gpy: correctly describe LED polarity

From: Daniel Golle
Date: Sat Oct 05 2024 - 12:28:57 EST


According the datasheet covering the LED (0x1b) register:
0B Active High LEDx pin driven high when activated
1B Active Low LEDx pin driven low when activated

Make use of the now available 'active-high' property and correctly
reflect the polarity setting which was previously inverted.

Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
---
drivers/net/phy/mxl-gpy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/mxl-gpy.c b/drivers/net/phy/mxl-gpy.c
index 1c9cd00c7bee..f50697f35160 100644
--- a/drivers/net/phy/mxl-gpy.c
+++ b/drivers/net/phy/mxl-gpy.c
@@ -1013,13 +1013,15 @@ static int gpy_led_polarity_set(struct phy_device *phydev, int index,
case PHY_LED_ACTIVE_LOW:
active_low = true;
break;
+ case PHY_LED_ACTIVE_HIGH:
+ break;
default:
return -EINVAL;
}
}

return phy_modify(phydev, PHY_LED, PHY_LED_POLARITY(index),
- active_low ? 0 : PHY_LED_POLARITY(index));
+ active_low ? PHY_LED_POLARITY(index) : 0);
}

static struct phy_driver gpy_drivers[] = {
--
2.46.2