xref: /rk3399_rockchip-uboot/drivers/led/Kconfig (revision ddae9fcddc48d1e624c941148d0df5a4fc7d7d5c)
1menu "LED Support"
2
3config LED
4	bool "Enable LED support"
5	depends on DM
6	help
7	  Many boards have LEDs which can be used to signal status or alerts.
8	  U-Boot provides a uclass API to implement this feature. LED drivers
9	  can provide access to board-specific LEDs. Use of the device tree
10	  for configuration is encouraged.
11
12config SPL_LED
13	bool "Enable LED support in SPL"
14	depends on SPL && SPL_DM
15	help
16	  The LED subsystem adds a small amount of overhead to the image.
17	  If this is acceptable and you have a need to use LEDs in SPL,
18	  enable this option. You will need to enable device tree in SPL
19	  for this to work.
20
21config LED_GPIO
22	bool "LED support for GPIO-connected LEDs"
23	depends on LED && DM_GPIO
24	help
25	  Enable support for LEDs which are connected to GPIO lines. These
26	  GPIOs may be on the SoC or some other device which provides GPIOs.
27	  The GPIO driver must used driver model. LEDs are configured using
28	  the device tree.
29
30config SPL_LED_GPIO
31	bool "LED support for GPIO-connected LEDs in SPL"
32        depends on SPL_LED && DM_GPIO
33	help
34	  This option is an SPL-variant of the LED_GPIO option.
35	  See the help of LED_GPIO for details.
36
37config LED_STATUS
38	bool "Enable status LED API"
39	help
40	  Allows common u-boot commands to use a board's leds to
41	  provide status for activities like booting and downloading files.
42
43if LED_STATUS
44
45# Hidden constants
46
47config LED_STATUS_OFF
48	int
49	default 0
50
51config LED_STATUS_BLINKING
52	int
53	default 1
54
55config LED_STATUS_ON
56	int
57	default 2
58
59# Hidden constants end
60
61config LED_STATUS_GPIO
62	bool "GPIO status LED implementation"
63	help
64	  The status LED can be connected to a GPIO pin. In such cases, the
65	  gpio_led driver can be used as a status LED backend implementation.
66
67config LED_STATUS_BOARD_SPECIFIC
68	bool "Specific board"
69	default y
70	help
71	  LED support is only for a specific board.
72
73comment "LEDs parameters"
74
75config LED_STATUS0
76	bool "Enable status LED 0"
77
78if LED_STATUS0
79
80config LED_STATUS_BIT
81	int "identification"
82	help
83	  CONFIG_LED_STATUS_BIT is passed into the __led_* functions to identify
84	  which LED is being acted on.  As such, the chosen value must be unique
85	  with respect to the other CONFIG_LED_STATUS_BIT's. Mapping the value
86	  to a physical LED is the responsibility of the __led_* function.
87
88config LED_STATUS_STATE
89	int "initial state"
90	range LED_STATUS_OFF LED_STATUS_ON
91	default LED_STATUS_OFF
92	help
93	  Should be set one of the following:
94	  0 - off
95	  1 - blinking
96	  2 - on
97
98config LED_STATUS_FREQ
99	int "blink frequency"
100	range 2 10
101	default 2
102	help
103	  The LED blink period calculated from LED_STATUS_FREQ:
104	  LED_STATUS_PERIOD = CONFIG_SYS_HZ/LED_STATUS_FREQ
105	  Values range: 2 - 10
106
107endif # LED_STATUS0
108
109config LED_STATUS1
110	bool "Enable status LED 1"
111
112if LED_STATUS1
113
114config LED_STATUS_BIT1
115	int "identification"
116	help
117	  CONFIG_LED_STATUS_BIT1 is passed into the __led_* functions to
118	  identify which LED is being acted on.  As such, the chosen value must
119	  be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
120	  the value to a physical LED is the responsibility of the __led_*
121	  function.
122
123config LED_STATUS_STATE1
124	int "initial state"
125	range LED_STATUS_OFF LED_STATUS_ON
126	default LED_STATUS_OFF
127	help
128	  Should be set one of the following:
129	  0 - off
130	  1 - blinking
131	  2 - on
132
133config LED_STATUS_FREQ1
134	int "blink frequency"
135	range 2 10
136	default 2
137	help
138	  The LED blink period calculated from LED_STATUS_FREQ1:
139	  LED_STATUS_PERIOD1 = CONFIG_SYS_HZ/LED_STATUS_FREQ1
140	  Values range: 2 - 10
141
142endif # LED_STATUS1
143
144config LED_STATUS2
145	bool "Enable status LED 2"
146
147if LED_STATUS2
148
149config LED_STATUS_BIT2
150	int "identification"
151	help
152	  CONFIG_LED_STATUS_BIT2 is passed into the __led_* functions to
153	  identify which LED is being acted on.  As such, the chosen value must
154	  be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
155	  the value to a physical LED is the responsibility of the __led_*
156	  function.
157
158config LED_STATUS_STATE2
159	int "initial state"
160	range LED_STATUS_OFF LED_STATUS_ON
161	default LED_STATUS_OFF
162	help
163	  Should be set one of the following:
164	  0 - off
165	  1 - blinking
166	  2 - on
167
168config LED_STATUS_FREQ2
169	int "blink frequency"
170	range 2 10
171	default 2
172	help
173	  The LED blink period calculated from LED_STATUS_FREQ2:
174	  LED_STATUS_PERIOD2 = CONFIG_SYS_HZ/LED_STATUS_FREQ2
175	  Values range: 2 - 10
176
177endif # LED_STATUS2
178
179config LED_STATUS3
180	bool "Enable status LED 3"
181
182if LED_STATUS3
183
184config LED_STATUS_BIT3
185	int "identification"
186	help
187	  CONFIG_LED_STATUS_BIT3 is passed into the __led_* functions to
188	  identify which LED is being acted on.  As such, the chosen value must
189	  be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
190	  the value to a physical LED is the responsibility of the __led_*
191	  function.
192
193config LED_STATUS_STATE3
194	int "initial state"
195	range LED_STATUS_OFF LED_STATUS_ON
196	default LED_STATUS_OFF
197	help
198	  Should be set one of the following:
199	  0 - off
200	  1 - blinking
201	  2 - on
202
203config LED_STATUS_FREQ3
204	int "blink frequency"
205	range 2 10
206	default 2
207	help
208	  The LED blink period calculated from LED_STATUS_FREQ3:
209	  LED_STATUS_PERIOD3 = CONFIG_SYS_HZ/LED_STATUS_FREQ3
210	  Values range: 2 - 10
211
212endif # LED_STATUS3
213
214config LED_STATUS4
215	bool "Enable status LED 4"
216
217if LED_STATUS4
218
219config LED_STATUS_BIT4
220	int "identification"
221	help
222	  CONFIG_LED_STATUS_BIT4 is passed into the __led_* functions to
223	  identify which LED is being acted on.  As such, the chosen value must
224	  be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
225	  the value to a physical LED is the responsibility of the __led_*
226	  function.
227
228config LED_STATUS_STATE4
229	int "initial state"
230	range LED_STATUS_OFF LED_STATUS_ON
231	default LED_STATUS_OFF
232	help
233	  Should be set one of the following:
234	  0 - off
235	  1 - blinking
236	  2 - on
237
238config LED_STATUS_FREQ4
239	int "blink frequency"
240	range 2 10
241	default 2
242	help
243	  The LED blink period calculated from LED_STATUS_FREQ4:
244	  LED_STATUS_PERIOD4 = CONFIG_SYS_HZ/LED_STATUS_FREQ4
245	  Values range: 2 - 10
246
247endif # LED_STATUS4
248
249config LED_STATUS5
250	bool "Enable status LED 5"
251
252if LED_STATUS5
253
254config LED_STATUS_BIT5
255	int "identification"
256	help
257	  CONFIG_LED_STATUS_BIT5 is passed into the __led_* functions to
258	  identify which LED is being acted on.  As such, the chosen value must
259	  be unique with respect to the other CONFIG_LED_STATUS_BIT's. Mapping
260	  the value to a physical LED is the responsibility of the __led_*
261	  function.
262
263config LED_STATUS_STATE5
264	int "initial state"
265	range LED_STATUS_OFF LED_STATUS_ON
266	default LED_STATUS_OFF
267	help
268	  Should be set one of the following:
269	  0 - off
270	  1 - blinking
271	  2 - on
272
273config LED_STATUS_FREQ5
274	int "blink frequency"
275	range 2 10
276	default 2
277	help
278	  The LED blink period calculated from LED_STATUS_FREQ5:
279	  LED_STATUS_PERIOD5 = CONFIG_SYS_HZ/LED_STATUS_FREQ5
280	  Values range: 2 - 10
281
282endif # LED_STATUS5
283
284config LED_STATUS_BOOT_ENABLE
285	bool "Enable BOOT LED"
286	help
287	  Enable to turn an LED on when the board is booting.
288
289if LED_STATUS_BOOT_ENABLE
290
291config LED_STATUS_BOOT
292	int "LED to light when the board is booting"
293	help
294	  Valid enabled LED device number.
295
296endif # LED_STATUS_BOOT_ENABLE
297
298config LED_STATUS_RED_ENABLE
299	bool "Enable red LED"
300	help
301	  Enable red status LED.
302
303if LED_STATUS_RED_ENABLE
304
305config LED_STATUS_RED
306	int "Red LED identification"
307	help
308	  Valid enabled LED device number.
309
310endif # LED_STATUS_RED_ENABLE
311
312config LED_STATUS_YELLOW_ENABLE
313	bool "Enable yellow LED"
314	help
315	  Enable yellow status LED.
316
317if LED_STATUS_YELLOW_ENABLE
318
319config LED_STATUS_YELLOW
320	int "Yellow LED identification"
321	help
322	  Valid enabled LED device number.
323
324endif # LED_STATUS_YELLOW_ENABLE
325
326config LED_STATUS_BLUE_ENABLE
327	bool "Enable blue LED"
328	help
329	  Enable blue status LED.
330
331if LED_STATUS_BLUE_ENABLE
332
333config LED_STATUS_BLUE
334	int "Blue LED identification"
335	help
336	  Valid enabled LED device number.
337
338endif # LED_STATUS_BLUE_ENABLE
339
340config LED_STATUS_GREEN_ENABLE
341	bool "Enable green LED"
342	help
343	  Enable green status LED.
344
345if LED_STATUS_GREEN_ENABLE
346
347config LED_STATUS_GREEN
348	int "Green LED identification"
349	help
350	  Valid enabled LED device number (0-5).
351
352endif # LED_STATUS_GREEN_ENABLE
353
354config LED_STATUS_CMD
355	bool "Enable status LED commands"
356
357endif # LED_STATUS
358
359endmenu
360