mbox series

[0/2] Add LED mode behavior/select properties and handle

Message ID 20201209140501.17415-1-i.mikhaylov@yadro.com
Headers show
Series Add LED mode behavior/select properties and handle | expand

Message

Ivan Mikhaylov Dec. 9, 2020, 2:04 p.m. UTC
In KSZ9131 PHY it is possible to control LEDs blink behavior via
LED mode behavior and select registers. Add DTS properties plus handles
of them inside micrel PHY driver.

I've some concerns about passing raw register values into LED mode
select and behavior. It can be passed via array like in microchip
driver(Documentation/devicetree/bindings/net/microchip,lan78xx.txt).
There is the problem in this particular driver - there is a lot of other PHYs
and led mode behavior/select states may intersect, that's the reason why
I did it this way. Is there any good ways to make it look more properly?

Ivan Mikhaylov (2):
  net: phy: micrel: add LED control on KSZ9131
  dt-bindings: net: phy: micrel: add LED mode behavior and select
    properties

 .../devicetree/bindings/net/micrel.txt        |  7 ++
 drivers/net/phy/micrel.c                      | 69 ++++++++++++++++++-
 2 files changed, 75 insertions(+), 1 deletion(-)

Comments

Pavel Machek Dec. 16, 2020, 10:41 p.m. UTC | #1
Hi!

> In KSZ9131 PHY it is possible to control LEDs blink behavior via
> LED mode behavior and select registers. Add DTS properties plus handles
> of them inside micrel PHY driver.
> 
> I've some concerns about passing raw register values into LED mode
> select and behavior. It can be passed via array like in microchip
> driver(Documentation/devicetree/bindings/net/microchip,lan78xx.txt).
> There is the problem in this particular driver - there is a lot of other PHYs
> and led mode behavior/select states may intersect, that's the reason why
> I did it this way. Is there any good ways to make it look more
> properly?

Lets... not do this?

We have a LED subsystem which should probably control the LEDs... so
user can specify behaviours at run-time, instead of them being
hard-coded in the device tree.

Plus, LED subsystem will use same interface for networks LEDs as for
... other LEDs.

Best regards,
									Pavel