well-known-leds.txt 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. -*- org -*-
  2. It is somehow important to provide consistent interface to the
  3. userland. LED devices have one problem there, and that is naming of
  4. directories in /sys/class/leds. It would be nice if userland would
  5. just know right "name" for given LED function, but situation got more
  6. complex.
  7. Anyway, if backwards compatibility is not an issue, new code should
  8. use one of the "good" names from this list, and you should extend the
  9. list where applicable.
  10. Legacy names are listed, too; in case you are writing application that
  11. wants to use particular feature, you should probe for good name, first,
  12. but then try the legacy ones, too.
  13. Notice there's a list of functions in include/dt-bindings/leds/common.h .
  14. * Gamepads and joysticks
  15. Game controllers may feature LEDs to indicate a player number. This is commonly
  16. used on game consoles in which multiple controllers can be connected to a system.
  17. The "player LEDs" are then programmed with a pattern to indicate a particular
  18. player. For example, a game controller with 4 LEDs, may be programmed with "x---"
  19. to indicate player 1, "-x--" to indicate player 2 etcetera where "x" means on.
  20. Input drivers can utilize the LED class to expose the individual player LEDs
  21. of a game controller using the function "player".
  22. Note: tracking and management of Player IDs is the responsibility of user space,
  23. though drivers may pick a default value.
  24. Good: "input*:*:player-{1,2,3,4,5}
  25. * Keyboards
  26. Good: "input*:*:capslock"
  27. Good: "input*:*:scrolllock"
  28. Good: "input*:*:numlock"
  29. Legacy: "shift-key-light" (Motorola Droid 4, capslock)
  30. Set of common keyboard LEDs, going back to PC AT or so.
  31. Legacy: "tpacpi::thinklight" (IBM/Lenovo Thinkpads)
  32. Legacy: "lp5523:kb{1,2,3,4,5,6}" (Nokia N900)
  33. Frontlight/backlight of main keyboard.
  34. Legacy: "button-backlight" (Motorola Droid 4)
  35. Some phones have touch buttons below screen; it is different from main
  36. keyboard. And this is their backlight.
  37. * Sound subsystem
  38. Good: "platform:*:mute"
  39. Good: "platform:*:micmute"
  40. LEDs on notebook body, indicating that sound input / output is muted.
  41. * System notification
  42. Good: "rgb:status"
  43. Legacy: "status-led:{red,green,blue}" (Motorola Droid 4)
  44. Legacy: "lp5523:{r,g,b}" (Nokia N900)
  45. Phones usually have multi-color status LED.
  46. * Power management
  47. Good: "platform:*:charging" (allwinner sun50i, leds-cht-wcove)
  48. * Screen
  49. Good: ":backlight" (Motorola Droid 4)
  50. * Indicators
  51. Good: ":indicator" (Blinkm)
  52. * RGB
  53. Good: ":rgb" (Blinkm)
  54. * Ethernet LEDs
  55. Currently two types of Network LEDs are support, those controlled by
  56. the PHY and those by the MAC. In theory both can be present at the
  57. same time for one Linux netdev, hence the names need to differ between
  58. MAC and PHY.
  59. Do not use the netdev name, such as eth0, enp1s0. These are not stable
  60. and are not unique. They also don't differentiate between MAC and PHY.
  61. ** MAC LEDs
  62. Good: f1070000.ethernet:white:WAN
  63. Good: mdio_mux-0.1:00:green:left
  64. Good: 0000:02:00.0:yellow:top
  65. The first part must uniquely name the MAC controller. Then follows the
  66. colour. WAN/LAN should be used for a single LED. If there are
  67. multiple LEDs, use left/right, or top/bottom to indicate their
  68. position on the RJ45 socket.
  69. ** PHY LEDs
  70. Good: f1072004.mdio-mii:00: white:WAN
  71. Good: !mdio-mux!mdio@2!switch@0!mdio:01:green:right
  72. Good: r8169-0-200:00:yellow:bottom
  73. The first part must uniquely name the PHY. This often means uniquely
  74. identifying the MDIO bus controller, and the address on the bus.