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