igc: Export LEDs
authorKurt Kanzenbach <kurt@linutronix.de>
Tue, 29 Jun 2021 04:43:32 +0000 (21:43 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 16 Jul 2021 21:08:12 +0000 (14:08 -0700)
commitcf8331825a8d10e46fa574fdf015a65cb5a6db86
treeb0366fa2c2c1f21958168612f4cbce1cfd86137d
parent73744262210c4560efb2d89385c6219739d16bbd
igc: Export LEDs

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.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/Kconfig
drivers/net/ethernet/intel/igc/igc.h
drivers/net/ethernet/intel/igc/igc_defines.h
drivers/net/ethernet/intel/igc/igc_main.c
drivers/net/ethernet/intel/igc/igc_regs.h