xref: /freebsd-src/sys/contrib/device-tree/include/dt-bindings/leds/common.h (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1c66ec88fSEmmanuel Vadot /* SPDX-License-Identifier: GPL-2.0 */
2c66ec88fSEmmanuel Vadot /*
3c66ec88fSEmmanuel Vadot  * This header provides macros for the common LEDs device tree bindings.
4c66ec88fSEmmanuel Vadot  *
5c66ec88fSEmmanuel Vadot  * Copyright (C) 2015, Samsung Electronics Co., Ltd.
6c66ec88fSEmmanuel Vadot  * Author: Jacek Anaszewski <j.anaszewski@samsung.com>
7c66ec88fSEmmanuel Vadot  *
8c66ec88fSEmmanuel Vadot  * Copyright (C) 2019 Jacek Anaszewski <jacek.anaszewski@gmail.com>
9c66ec88fSEmmanuel Vadot  * Copyright (C) 2020 Pavel Machek <pavel@ucw.cz>
10c66ec88fSEmmanuel Vadot  */
11c66ec88fSEmmanuel Vadot 
12c66ec88fSEmmanuel Vadot #ifndef __DT_BINDINGS_LEDS_H
13c66ec88fSEmmanuel Vadot #define __DT_BINDINGS_LEDS_H
14c66ec88fSEmmanuel Vadot 
15c66ec88fSEmmanuel Vadot /* External trigger type */
16c66ec88fSEmmanuel Vadot #define LEDS_TRIG_TYPE_EDGE	0
17c66ec88fSEmmanuel Vadot #define LEDS_TRIG_TYPE_LEVEL	1
18c66ec88fSEmmanuel Vadot 
19c66ec88fSEmmanuel Vadot /* Boost modes */
20c66ec88fSEmmanuel Vadot #define LEDS_BOOST_OFF		0
21c66ec88fSEmmanuel Vadot #define LEDS_BOOST_ADAPTIVE	1
22c66ec88fSEmmanuel Vadot #define LEDS_BOOST_FIXED	2
23c66ec88fSEmmanuel Vadot 
24c66ec88fSEmmanuel Vadot /* Standard LED colors */
25c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_WHITE	0
26c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_RED	1
27c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_GREEN	2
28c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_BLUE	3
29c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_AMBER	4
30c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_VIOLET	5
31c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_YELLOW	6
32c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_IR		7
33c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_MULTI	8	/* For multicolor LEDs */
34c66ec88fSEmmanuel Vadot #define LED_COLOR_ID_RGB	9	/* For multicolor LEDs that can do arbitrary color,
35c66ec88fSEmmanuel Vadot 					   so this would include RGBW and similar */
36*7ef62cebSEmmanuel Vadot #define LED_COLOR_ID_PURPLE	10
37*7ef62cebSEmmanuel Vadot #define LED_COLOR_ID_ORANGE	11
38*7ef62cebSEmmanuel Vadot #define LED_COLOR_ID_PINK	12
39*7ef62cebSEmmanuel Vadot #define LED_COLOR_ID_CYAN	13
40*7ef62cebSEmmanuel Vadot #define LED_COLOR_ID_LIME	14
41*7ef62cebSEmmanuel Vadot #define LED_COLOR_ID_MAX	15
42c66ec88fSEmmanuel Vadot 
43c66ec88fSEmmanuel Vadot /* Standard LED functions */
44c66ec88fSEmmanuel Vadot /* Keyboard LEDs, usually it would be input4::capslock etc. */
45c66ec88fSEmmanuel Vadot /*   Obsolete equivalent: "shift-key-light" */
46c66ec88fSEmmanuel Vadot #define LED_FUNCTION_CAPSLOCK "capslock"
47c66ec88fSEmmanuel Vadot #define LED_FUNCTION_SCROLLLOCK "scrolllock"
48c66ec88fSEmmanuel Vadot #define LED_FUNCTION_NUMLOCK "numlock"
49c66ec88fSEmmanuel Vadot /*   Obsolete equivalents: "tpacpi::thinklight" (IBM/Lenovo Thinkpads),
50c66ec88fSEmmanuel Vadot      "lp5523:kb{1,2,3,4,5,6}" (Nokia N900) */
51c66ec88fSEmmanuel Vadot #define LED_FUNCTION_KBD_BACKLIGHT "kbd_backlight"
52c66ec88fSEmmanuel Vadot 
53c66ec88fSEmmanuel Vadot /* System LEDs, usually found on system body.
54c66ec88fSEmmanuel Vadot    platform::mute (etc) is sometimes seen, :mute would be better */
55c66ec88fSEmmanuel Vadot #define LED_FUNCTION_POWER "power"
56c66ec88fSEmmanuel Vadot #define LED_FUNCTION_DISK "disk"
57c66ec88fSEmmanuel Vadot 
58c66ec88fSEmmanuel Vadot /*   Obsolete: "platform:*:charging" (allwinner sun50i) */
59c66ec88fSEmmanuel Vadot #define LED_FUNCTION_CHARGING "charging"
60c66ec88fSEmmanuel Vadot /*   Used RGB notification LEDs common on phones.
61c66ec88fSEmmanuel Vadot      Obsolete equivalents: "status-led:{red,green,blue}" (Motorola Droid 4),
62c66ec88fSEmmanuel Vadot      "lp5523:{r,g,b}" (Nokia N900) */
63c66ec88fSEmmanuel Vadot #define LED_FUNCTION_STATUS "status"
64c66ec88fSEmmanuel Vadot 
65c66ec88fSEmmanuel Vadot #define LED_FUNCTION_MICMUTE "micmute"
66c66ec88fSEmmanuel Vadot #define LED_FUNCTION_MUTE "mute"
67c66ec88fSEmmanuel Vadot 
688cc087a1SEmmanuel Vadot /* Used for player LEDs as found on game controllers from e.g. Nintendo, Sony. */
698cc087a1SEmmanuel Vadot #define LED_FUNCTION_PLAYER1 "player-1"
708cc087a1SEmmanuel Vadot #define LED_FUNCTION_PLAYER2 "player-2"
718cc087a1SEmmanuel Vadot #define LED_FUNCTION_PLAYER3 "player-3"
728cc087a1SEmmanuel Vadot #define LED_FUNCTION_PLAYER4 "player-4"
738cc087a1SEmmanuel Vadot #define LED_FUNCTION_PLAYER5 "player-5"
748cc087a1SEmmanuel Vadot 
75c66ec88fSEmmanuel Vadot /* Miscelleaus functions. Use functions above if you can. */
76c66ec88fSEmmanuel Vadot #define LED_FUNCTION_ACTIVITY "activity"
77c66ec88fSEmmanuel Vadot #define LED_FUNCTION_ALARM "alarm"
78c66ec88fSEmmanuel Vadot #define LED_FUNCTION_BACKLIGHT "backlight"
79c66ec88fSEmmanuel Vadot #define LED_FUNCTION_BLUETOOTH "bluetooth"
80c66ec88fSEmmanuel Vadot #define LED_FUNCTION_BOOT "boot"
81c66ec88fSEmmanuel Vadot #define LED_FUNCTION_CPU "cpu"
82c66ec88fSEmmanuel Vadot #define LED_FUNCTION_DEBUG "debug"
83c66ec88fSEmmanuel Vadot #define LED_FUNCTION_DISK_ACTIVITY "disk-activity"
84c66ec88fSEmmanuel Vadot #define LED_FUNCTION_DISK_ERR "disk-err"
85c66ec88fSEmmanuel Vadot #define LED_FUNCTION_DISK_READ "disk-read"
86c66ec88fSEmmanuel Vadot #define LED_FUNCTION_DISK_WRITE "disk-write"
87c66ec88fSEmmanuel Vadot #define LED_FUNCTION_FAULT "fault"
88c66ec88fSEmmanuel Vadot #define LED_FUNCTION_FLASH "flash"
89c66ec88fSEmmanuel Vadot #define LED_FUNCTION_HEARTBEAT "heartbeat"
90c66ec88fSEmmanuel Vadot #define LED_FUNCTION_INDICATOR "indicator"
91c66ec88fSEmmanuel Vadot #define LED_FUNCTION_LAN "lan"
92c66ec88fSEmmanuel Vadot #define LED_FUNCTION_MAIL "mail"
93c66ec88fSEmmanuel Vadot #define LED_FUNCTION_MTD "mtd"
94c66ec88fSEmmanuel Vadot #define LED_FUNCTION_PANIC "panic"
95c66ec88fSEmmanuel Vadot #define LED_FUNCTION_PROGRAMMING "programming"
96c66ec88fSEmmanuel Vadot #define LED_FUNCTION_RX "rx"
97c66ec88fSEmmanuel Vadot #define LED_FUNCTION_SD "sd"
98c66ec88fSEmmanuel Vadot #define LED_FUNCTION_STANDBY "standby"
99c66ec88fSEmmanuel Vadot #define LED_FUNCTION_TORCH "torch"
100c66ec88fSEmmanuel Vadot #define LED_FUNCTION_TX "tx"
101c66ec88fSEmmanuel Vadot #define LED_FUNCTION_USB "usb"
102c66ec88fSEmmanuel Vadot #define LED_FUNCTION_WAN "wan"
103c66ec88fSEmmanuel Vadot #define LED_FUNCTION_WLAN "wlan"
104c66ec88fSEmmanuel Vadot #define LED_FUNCTION_WPS "wps"
105c66ec88fSEmmanuel Vadot 
106c66ec88fSEmmanuel Vadot #endif /* __DT_BINDINGS_LEDS_H */
107