diff mbox series

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

Message ID cb0ae5cc99225a1bd104fd044927df6cf8ab578f.1728145095.git.daniel@makrotopia.org
State New
Headers show
Series [net-next,1/4] dt-bindings: leds: add 'active-high' property | expand

Commit Message

Daniel Golle Oct. 5, 2024, 4:28 p.m. UTC
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@makrotopia.org>
---
 drivers/net/phy/mxl-gpy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

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[] = {