linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 0/2] Add LED mode behavior/select properties and handle
       [not found] <20201209140501.17415-1-i.mikhaylov@yadro.com>
@ 2020-12-16 22:41 ` Pavel Machek
  2024-11-12  8:10   ` Alexander Wilhelm
  2024-11-12  8:19   ` Alexander Wilhelm
  0 siblings, 2 replies; 5+ messages in thread
From: Pavel Machek @ 2020-12-16 22:41 UTC (permalink / raw)
  To: Ivan Mikhaylov, marek.behun, linux-leds
  Cc: David S . Miller, Jakub Kicinski, Rob Herring, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King, netdev,
	devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

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
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Add LED mode behavior/select properties and handle
  2020-12-16 22:41 ` [PATCH 0/2] Add LED mode behavior/select properties and handle Pavel Machek
@ 2024-11-12  8:10   ` Alexander Wilhelm
  2024-11-12  8:19   ` Alexander Wilhelm
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Wilhelm @ 2024-11-12  8:10 UTC (permalink / raw)
  To: pavel
  Cc: andrew, davem, devicetree, f.fainelli, hkallweit1, i.mikhaylov,
	kuba, linux-kernel, linux-leds, linux, marek.behun, netdev,
	robh+dt



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Add LED mode behavior/select properties and handle
  2020-12-16 22:41 ` [PATCH 0/2] Add LED mode behavior/select properties and handle Pavel Machek
  2024-11-12  8:10   ` Alexander Wilhelm
@ 2024-11-12  8:19   ` Alexander Wilhelm
  2024-11-12  8:49     ` Marek Behún
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Wilhelm @ 2024-11-12  8:19 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Ivan Mikhaylov, marek.behun, linux-leds, David S . Miller,
	Jakub Kicinski, Rob Herring, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Russell King, netdev, devicetree, linux-kernel

Am Wed, Dec 16, 2020 at 11:41:19PM +0100 schrieb Pavel Machek:
> 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.

Hi Pavel,

I would also like to control the LEDs via subsystem interface, but how I can
configure those to be visible in 'sys/class/leds'? My LEDs are connected
directly to KSZ9131RNX phy device and not to any of GPIO available on the CPU.
Am I missing some DTS entries therefore?


Best regards
Alexander Wilhelm

> 
> Best regards,
> 									Pavel
> -- 
> http://www.livejournal.com/~pavelmachek



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Add LED mode behavior/select properties and handle
  2024-11-12  8:19   ` Alexander Wilhelm
@ 2024-11-12  8:49     ` Marek Behún
  2024-11-12  9:10       ` Alexander Wilhelm
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Behún @ 2024-11-12  8:49 UTC (permalink / raw)
  To: Alexander Wilhelm
  Cc: Pavel Machek, Ivan Mikhaylov, linux-leds, David S . Miller,
	Jakub Kicinski, Rob Herring, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Russell King, netdev, devicetree, linux-kernel

On Tue, Nov 12, 2024 at 09:19:59AM +0100, Alexander Wilhelm wrote:
> Am Wed, Dec 16, 2020 at 11:41:19PM +0100 schrieb Pavel Machek:
> > 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.
> 
> Hi Pavel,
> 
> I would also like to control the LEDs via subsystem interface, but how I can
> configure those to be visible in 'sys/class/leds'? My LEDs are connected
> directly to KSZ9131RNX phy device and not to any of GPIO available on the CPU.
> Am I missing some DTS entries therefore?

The KSZ9131RNX driver needs to implement some LED methods, like
.led_brightness_set(), .led_blink_set(), .led_hw_is_supported(),
.led_hw_control_set(), .led_hw_control_get().

Look for example at marvell.c driver, or broadcom.c.

Regarding DTS, look at linux/arch/arm/boot/dts/marvell/armada-370-rd.dts.
The ethernet-phy@0 node has leds subnode, describing the LEDs.

Marek

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Add LED mode behavior/select properties and handle
  2024-11-12  8:49     ` Marek Behún
@ 2024-11-12  9:10       ` Alexander Wilhelm
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Wilhelm @ 2024-11-12  9:10 UTC (permalink / raw)
  To: Marek Behún
  Cc: Pavel Machek, Ivan Mikhaylov, linux-leds, David S . Miller,
	Jakub Kicinski, Rob Herring, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Russell King, netdev, devicetree, linux-kernel

Am Tue, Nov 12, 2024 at 09:49:03AM +0100 schrieb Marek Behún:
> On Tue, Nov 12, 2024 at 09:19:59AM +0100, Alexander Wilhelm wrote:
> > Am Wed, Dec 16, 2020 at 11:41:19PM +0100 schrieb Pavel Machek:
> > > 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.
> > 
> > Hi Pavel,
> > 
> > I would also like to control the LEDs via subsystem interface, but how I can
> > configure those to be visible in 'sys/class/leds'? My LEDs are connected
> > directly to KSZ9131RNX phy device and not to any of GPIO available on the CPU.
> > Am I missing some DTS entries therefore?
> 
> The KSZ9131RNX driver needs to implement some LED methods, like
> .led_brightness_set(), .led_blink_set(), .led_hw_is_supported(),
> .led_hw_control_set(), .led_hw_control_get().
> 
> Look for example at marvell.c driver, or broadcom.c.
> 
> Regarding DTS, look at linux/arch/arm/boot/dts/marvell/armada-370-rd.dts.
> The ethernet-phy@0 node has leds subnode, describing the LEDs.
> 
> Marek

Hi Marek,

thank you a lot. I think I got the main idea how the LED interface intended to
work. The current linux master does not implement those callbacks for the micrel
phy. I will look into implementing these functions if I am given enough time to
do so.


Best regards
Alexander Wilhelm

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-12  9:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20201209140501.17415-1-i.mikhaylov@yadro.com>
2020-12-16 22:41 ` [PATCH 0/2] Add LED mode behavior/select properties and handle Pavel Machek
2024-11-12  8:10   ` Alexander Wilhelm
2024-11-12  8:19   ` Alexander Wilhelm
2024-11-12  8:49     ` Marek Behún
2024-11-12  9:10       ` Alexander Wilhelm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).