xref: /linux/Documentation/leds/well-known-leds.txt (revision cdd5b5a9761fd66d17586e4f4ba6588c70e640ea)
109f12730SPavel Machek-*- org -*-
209f12730SPavel Machek
309f12730SPavel MachekIt is somehow important to provide consistent interface to the
409f12730SPavel Machekuserland. LED devices have one problem there, and that is naming of
509f12730SPavel Machekdirectories in /sys/class/leds. It would be nice if userland would
609f12730SPavel Machekjust know right "name" for given LED function, but situation got more
709f12730SPavel Machekcomplex.
809f12730SPavel Machek
909f12730SPavel MachekAnyway, if backwards compatibility is not an issue, new code should
1009f12730SPavel Machekuse one of the "good" names from this list, and you should extend the
1109f12730SPavel Macheklist where applicable.
1209f12730SPavel Machek
1309f12730SPavel MachekLegacy names are listed, too; in case you are writing application that
1409f12730SPavel Machekwants to use particular feature, you should probe for good name, first,
1509f12730SPavel Machekbut then try the legacy ones, too.
1609f12730SPavel Machek
1709f12730SPavel MachekNotice there's a list of functions in include/dt-bindings/leds/common.h .
1809f12730SPavel Machek
1961177c08SRoderick Colenbrander* Gamepads and joysticks
2061177c08SRoderick Colenbrander
2161177c08SRoderick ColenbranderGame controllers may feature LEDs to indicate a player number. This is commonly
2261177c08SRoderick Colenbranderused on game consoles in which multiple controllers can be connected to a system.
2361177c08SRoderick ColenbranderThe "player LEDs" are then programmed with a pattern to indicate a particular
2461177c08SRoderick Colenbranderplayer. For example, a game controller with 4 LEDs, may be programmed with "x---"
2561177c08SRoderick Colenbranderto indicate player 1, "-x--" to indicate player 2 etcetera where "x" means on.
2661177c08SRoderick ColenbranderInput drivers can utilize the LED class to expose the individual player LEDs
2761177c08SRoderick Colenbranderof a game controller using the function "player".
2861177c08SRoderick ColenbranderNote: tracking and management of Player IDs is the responsibility of user space,
2961177c08SRoderick Colenbranderthough drivers may pick a default value.
3061177c08SRoderick Colenbrander
3161177c08SRoderick ColenbranderGood: "input*:*:player-{1,2,3,4,5}
3261177c08SRoderick Colenbrander
3309f12730SPavel Machek* Keyboards
3409f12730SPavel Machek
3509f12730SPavel MachekGood: "input*:*:capslock"
3609f12730SPavel MachekGood: "input*:*:scrolllock"
3709f12730SPavel MachekGood: "input*:*:numlock"
3809f12730SPavel MachekLegacy: "shift-key-light" (Motorola Droid 4, capslock)
3909f12730SPavel Machek
4009f12730SPavel MachekSet of common keyboard LEDs, going back to PC AT or so.
4109f12730SPavel Machek
4209f12730SPavel MachekLegacy: "tpacpi::thinklight" (IBM/Lenovo Thinkpads)
4309f12730SPavel MachekLegacy: "lp5523:kb{1,2,3,4,5,6}" (Nokia N900)
4409f12730SPavel Machek
4509f12730SPavel MachekFrontlight/backlight of main keyboard.
4609f12730SPavel Machek
4709f12730SPavel MachekLegacy: "button-backlight" (Motorola Droid 4)
4809f12730SPavel Machek
4909f12730SPavel MachekSome phones have touch buttons below screen; it is different from main
5009f12730SPavel Machekkeyboard. And this is their backlight.
5109f12730SPavel Machek
5209f12730SPavel Machek* Sound subsystem
5309f12730SPavel Machek
5409f12730SPavel MachekGood: "platform:*:mute"
5509f12730SPavel MachekGood: "platform:*:micmute"
5609f12730SPavel Machek
5709f12730SPavel MachekLEDs on notebook body, indicating that sound input / output is muted.
5809f12730SPavel Machek
5909f12730SPavel Machek* System notification
6009f12730SPavel Machek
61*ece1f480SLuca WeissGood: "rgb:status"
6209f12730SPavel MachekLegacy: "status-led:{red,green,blue}" (Motorola Droid 4)
6309f12730SPavel MachekLegacy: "lp5523:{r,g,b}" (Nokia N900)
6409f12730SPavel Machek
6509f12730SPavel MachekPhones usually have multi-color status LED.
6609f12730SPavel Machek
6709f12730SPavel Machek* Power management
6809f12730SPavel Machek
69047da762SYauhen KharuzhyGood: "platform:*:charging" (allwinner sun50i, leds-cht-wcove)
7009f12730SPavel Machek
7109f12730SPavel Machek* Screen
7209f12730SPavel Machek
7309f12730SPavel MachekGood: ":backlight" (Motorola Droid 4)
74c693ea2fSAndrew Lunn
75c693ea2fSAndrew Lunn* Ethernet LEDs
76c693ea2fSAndrew Lunn
77c693ea2fSAndrew LunnCurrently two types of Network LEDs are support, those controlled by
78c693ea2fSAndrew Lunnthe PHY and those by the MAC. In theory both can be present at the
79c693ea2fSAndrew Lunnsame time for one Linux netdev, hence the names need to differ between
80c693ea2fSAndrew LunnMAC and PHY.
81c693ea2fSAndrew Lunn
82c693ea2fSAndrew LunnDo not use the netdev name, such as eth0, enp1s0. These are not stable
83c693ea2fSAndrew Lunnand are not unique. They also don't differentiate between MAC and PHY.
84c693ea2fSAndrew Lunn
85c693ea2fSAndrew Lunn** MAC LEDs
86c693ea2fSAndrew Lunn
87c693ea2fSAndrew LunnGood: f1070000.ethernet:white:WAN
88c693ea2fSAndrew LunnGood: mdio_mux-0.1:00:green:left
89c693ea2fSAndrew LunnGood: 0000:02:00.0:yellow:top
90c693ea2fSAndrew Lunn
91c693ea2fSAndrew LunnThe first part must uniquely name the MAC controller. Then follows the
92c693ea2fSAndrew Lunncolour.  WAN/LAN should be used for a single LED. If there are
93c693ea2fSAndrew Lunnmultiple LEDs, use left/right, or top/bottom to indicate their
94c693ea2fSAndrew Lunnposition on the RJ45 socket.
95c693ea2fSAndrew Lunn
96c693ea2fSAndrew Lunn** PHY LEDs
97c693ea2fSAndrew Lunn
98c693ea2fSAndrew LunnGood: f1072004.mdio-mii:00: white:WAN
99c693ea2fSAndrew LunnGood: !mdio-mux!mdio@2!switch@0!mdio:01:green:right
100c693ea2fSAndrew LunnGood: r8169-0-200:00:yellow:bottom
101c693ea2fSAndrew Lunn
102c693ea2fSAndrew LunnThe first part must uniquely name the PHY. This often means uniquely
103c693ea2fSAndrew Lunnidentifying the MDIO bus controller, and the address on the bus.
104