Re: [PATCH RFC net-next] net: phy: always set polarity_modes if op is supported

From: Andrew Lunn
Date: Fri Oct 04 2024 - 17:00:08 EST


On Fri, Oct 04, 2024 at 04:46:33PM +0100, Daniel Golle wrote:
> Some PHYs drive LEDs active-low by default and polarity needs to be
> configured in case the 'active-low' property is NOT set.
> One way to achieve this without introducing an additional 'active-high'
> property would be to always call the led_polarity_set operation if it
> is supported by the phy driver.

It is a good idea to state why it is RFC. What comments do you want?

So this potentially causes regressions/change in behaviour. Strapping
or the bootloader could set the polarity, and Linux leaves it alone up
until this patch.

The device tree binding says:

active-low:
type: boolean
description:
Makes LED active low. To turn the LED ON, line needs to be
set to low voltage instead of high.

There is no mention that the absence of this property means it is
active-high.

In effect, i think we have a tristate, active-low, active-high, don't
touch.

I think adding an active-high property is probably the safest bet,
even if it is more work.

Andrew