Re: [PATCH net-next 5/5] igc: Export LEDs
From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-07-18 22:33:57
On Mon, Jul 19, 2021 at 12:10:52AM +0200, Heiner Kallweit wrote:
On 16.07.2021 23:56, Andrew Lunn wrote:quoted
On Fri, Jul 16, 2021 at 02:24:27PM -0700, Tony Nguyen wrote:quoted
From: Kurt Kanzenbach <kurt@linutronix.de> Each i225 has three LEDs. Export them via the LED class framework. Each LED is controllable via sysfs. Example: $ cd /sys/class/leds/igc_led0 $ cat brightness # Current Mode $ cat max_brightness # 15 $ echo 0 > brightness # Mode 0 $ echo 1 > brightness # Mode 1 The brightness field here reflects the different LED modes ranging from 0 to 15.What do you mean by mode? Do you mean blink mode? Like On means 1G link, and it blinks for packet TX?Supposedly mode refers to a 4-bit bitfield in a LED control register where each value 0 .. 15 stands for a different blink mode. So you would need the datasheet to know which value to set.
If the brightness is being abused to represent the blink mode, this patch is going to get my NACK. Unfortunately, i cannot find a datasheet for this chip to know what the LED control register actually does. So i'm waiting for a reply to my question. There is a broad agreement between the LED maintainers and the PHYLIB maintainers how Ethernet LEDs should be described with the hardware blinking the LED for different reasons. The LED trigger mechanisms should be used, one trigger per mode, and the trigger is then offloaded to the hardware. Andrew