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