[PATCH 0/9] led: introduce LED boot and activity function

This series is a reworked version of the previous seried: misc: introduce STATUS LED activity function
This series port and expand the legacy concept of LED boot from the legacy Status LED API to new LED API.
One thing that many device need is a way to communicate to the user that the device is actually doing something.
This is especially useful for recovery steps where an user (for example) insert an USB drive, keep a button pressed and the device autorecover.
There is currently no way to signal the user externally that the bootloader is processing/recoverying aside from setting a LED on.
A solid LED on is not enough and won't actually signal any kind of progress. Solution is the good old blinking LED but uboot doesn't suggest (and support) interrupts and almost all the LED are usually GPIO LED that doesn't support HW blink.
To fix this and handle the problem of device not supporting HW blink, expand the GPIO LED framework with support for SW blink with the new Kconfig.
Additional Kconfg are also introduced to set the LED boot and activity. Those are referenced by label.
A documentation for old and these new LED API is created.
(world tested with the azure pipeline)
Christian Marangi (9): led: led_gpio: add support for SW Blink led: implement led_set_state/paeriod_by_label led: implement LED boot API common: board_r: rework BOOT LED handling led: implement LED activity API tftp: implement support for LED activity mtd: implement support for LED activity ubi: implement support for LED activity doc: introduce led.rst documentation
cmd/mtd.c | 19 ++++++ cmd/ubi.c | 15 ++++- common/board_r.c | 25 ++++++- doc/api/index.rst | 1 + doc/api/led.rst | 10 +++ drivers/led/Kconfig | 54 ++++++++++++++++ drivers/led/led-uclass.c | 28 ++++++++ drivers/led/led_gpio.c | 56 ++++++++++++++++ include/led.h | 136 +++++++++++++++++++++++++++++++++++++++ net/tftp.c | 7 ++ 10 files changed, 347 insertions(+), 4 deletions(-) create mode 100644 doc/api/led.rst

Add support for GPIO-connected LEDs to make use of Cyclic API to simulate Blink by software.
A new Kconfig is introduced to enable this, CONFIG_LED_GPIO_SW_BLINK.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- drivers/led/Kconfig | 9 +++++++ drivers/led/led_gpio.c | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+)
diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig index 9837960198d..13d6eb40cea 100644 --- a/drivers/led/Kconfig +++ b/drivers/led/Kconfig @@ -91,6 +91,15 @@ config LED_GPIO The GPIO driver must used driver model. LEDs are configured using the device tree.
+config LED_GPIO_SW_BLINK + bool "LED support for GPIO software blink" + depends on LED_GPIO + select CYCLIC + select LED_BLINK + help + Enable support for GPIO-connected LEDs to make use of Cyclic API + to simulate LED blink by software. + config SPL_LED_GPIO bool "LED support for GPIO-connected LEDs in SPL" depends on SPL_LED && SPL_DM_GPIO diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c index ce22fb49f2a..20a6c149e4a 100644 --- a/drivers/led/led_gpio.c +++ b/drivers/led/led_gpio.c @@ -4,6 +4,7 @@ * Written by Simon Glass sjg@chromium.org */
+#include <cyclic.h> #include <dm.h> #include <errno.h> #include <led.h> @@ -13,13 +14,60 @@
struct led_gpio_priv { struct gpio_desc gpio; +#ifdef CONFIG_LED_GPIO_SW_BLINK + bool sw_blink; + struct cyclic_info cyclic; +#endif };
+#ifdef CONFIG_LED_GPIO_SW_BLINK +static void gpio_led_toggle(struct cyclic_info *ctx) +{ + struct led_gpio_priv *priv = container_of(ctx, struct led_gpio_priv, cyclic); + struct gpio_desc *gpio = &priv->gpio; + int state; + + state = dm_gpio_get_value(gpio); + if (state < 0) { + printf("Error getting value for GPIO %d\n", + gpio->offset); + return; + } + + dm_gpio_set_value(gpio, !state); +} + +static int gpio_led_set_period(struct udevice *dev, int period_ms) +{ + struct led_gpio_priv *priv = dev_get_priv(dev); + char cyclic_name[16]; + + if (priv->sw_blink) + cyclic_unregister(&priv->cyclic); + + snprintf(cyclic_name, sizeof(cyclic_name), + "gpio_cyclic%u", priv->gpio.offset); + cyclic_register(&priv->cyclic, gpio_led_toggle, + period_ms * 500, cyclic_name); + + /* Init the LED on */ + dm_gpio_set_value(&priv->gpio, LEDST_ON); + + priv->sw_blink = true; + return 0; +} +#endif + static int gpio_led_set_state(struct udevice *dev, enum led_state_t state) { struct led_gpio_priv *priv = dev_get_priv(dev); int ret;
+#ifdef CONFIG_LED_GPIO_SW_BLINK + if (priv->sw_blink) + cyclic_unregister(&priv->cyclic); +#endif + if (!dm_gpio_is_valid(&priv->gpio)) return -EREMOTEIO; switch (state) { @@ -50,6 +98,11 @@ static enum led_state_t gpio_led_get_state(struct udevice *dev) if (ret < 0) return ret;
+#ifdef CONFIG_LED_GPIO_SW_BLINK + if (priv->sw_blink) + return LEDST_BLINK; +#endif + return ret ? LEDST_ON : LEDST_OFF; }
@@ -84,6 +137,9 @@ static int led_gpio_bind(struct udevice *parent) static const struct led_ops gpio_led_ops = { .set_state = gpio_led_set_state, .get_state = gpio_led_get_state, +#ifdef CONFIG_LED_GPIO_SW_BLINK + .set_period = gpio_led_set_period, +#endif };
U_BOOT_DRIVER(led_gpio) = {

Introduce new API led_set_state/period_by label as a shorthand to set LED state and LED blink period by referencing them by label.
This is needed for the upcoming additional API that will declare LED in .confg and reference them by their LED label name.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- drivers/led/led-uclass.c | 28 ++++++++++++++++++++++++++++ include/led.h | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+)
diff --git a/drivers/led/led-uclass.c b/drivers/led/led-uclass.c index f37bf6a1550..d1e9916bb33 100644 --- a/drivers/led/led-uclass.c +++ b/drivers/led/led-uclass.c @@ -61,6 +61,20 @@ int led_set_state(struct udevice *dev, enum led_state_t state) return ops->set_state(dev, state); }
+int led_set_state_by_label(const char *label, enum led_state_t state) +{ + struct udevice *dev; + int ret; + + ret = led_get_by_label(label, &dev); + if (ret) { + printf("Failed to get LED by label %s\n", label); + return ret; + } + + return led_set_state(dev, state); +} + enum led_state_t led_get_state(struct udevice *dev) { struct led_ops *ops = led_get_ops(dev); @@ -81,6 +95,20 @@ int led_set_period(struct udevice *dev, int period_ms)
return ops->set_period(dev, period_ms); } + +int led_set_period_by_label(const char *label, int period_ms) +{ + struct udevice *dev; + int ret; + + ret = led_get_by_label(label, &dev); + if (ret) { + printf("Failed to get LED by label %s\n", label); + return ret; + } + + return led_set_period(dev, period_ms); +} #endif
static int led_post_bind(struct udevice *dev) diff --git a/include/led.h b/include/led.h index a6353166289..71dd7a28d93 100644 --- a/include/led.h +++ b/include/led.h @@ -93,6 +93,15 @@ int led_get_by_label(const char *label, struct udevice **devp); */ int led_set_state(struct udevice *dev, enum led_state_t state);
+/** + * led_set_state_by_label - set the state of an LED referenced by Label + * + * @label: LED label + * @state: LED state to set + * Return: 0 if OK, -ve on error + */ +int led_set_state_by_label(const char *label, enum led_state_t state); + /** * led_get_state() - get the state of an LED * @@ -110,6 +119,15 @@ enum led_state_t led_get_state(struct udevice *dev); */ int led_set_period(struct udevice *dev, int period_ms);
+/** + * led_set_period_by_label - set the blink period of an LED referenced by Label + * + * @label: LED label + * @period_ms: LED blink period in milliseconds + * Return: 0 if OK, -ve on error + */ +int led_set_period_by_label(const char *label, int period_ms); + /** * led_bind_generic() - bind children of parent to given driver *

Implement LED boot API to signal correct boot of the system.
led_boot_on/off/blink() are introduced to turn ON, OFF and BLINK the designated boot LED.
New Kconfig are introduced, CONFIG_LED_BOOT_ENABLE to enable the feature, CONFIG_LED_BOOT_LABEL to declare the LED label in DT to reference the LED for BOOT usage and CONFIG_LED_BOOT_PERIOD to declare the blinking period.
If CONFIG_LED_BLINK is not enabled, led_boot_blink call will fallback to simple LED ON.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- drivers/led/Kconfig | 22 ++++++++++++++++++++++ include/led.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+)
diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig index 13d6eb40cea..0506a33b6ee 100644 --- a/drivers/led/Kconfig +++ b/drivers/led/Kconfig @@ -9,6 +9,28 @@ config LED can provide access to board-specific LEDs. Use of the device tree for configuration is encouraged.
+config LED_BOOT_ENABLE + bool "Enable LED boot support" + help + Enable LED boot support. + + LED boot is a specific LED assigned to signal boot operation status. + +config LED_BOOT_LABEL + string "LED boot label" + depends on LED_BOOT_ENABLE + help + LED label defined in DT to assign for LED boot usage. + +config LED_BOOT_PERIOD + int "LED boot period" + depends on LED_BOOT_ENABLE && LED_BLINK + default 2 + help + LED boot blink period in ms. + + Value is normalized per CONFIG_SYS_HZ. + config LED_BCM6328 bool "LED Support for BCM6328" depends on LED && ARCH_BMIPS diff --git a/include/led.h b/include/led.h index 71dd7a28d93..479c6d17c5b 100644 --- a/include/led.h +++ b/include/led.h @@ -136,4 +136,44 @@ int led_set_period_by_label(const char *label, int period_ms); */ int led_bind_generic(struct udevice *parent, const char *driver_name);
+#ifdef CONFIG_LED_BOOT_ENABLE + +#define LED_BOOT_PERIOD CONFIG_SYS_HZ / CONFIG_LED_BOOT_PERIOD + +/** + * led_boot_on() - turn ON the designated LED for booting + * + * Return: 0 if OK, -ve on error + */ +static inline int led_boot_on(void) +{ + return led_set_state_by_label(CONFIG_LED_BOOT_LABEL, LEDST_ON); +} + +/** + * led_boot_off() - turn OFF the designated LED for booting + * + * Return: 0 if OK, -ve on error + */ +static inline int led_boot_off(void) +{ + return led_set_state_by_label(CONFIG_LED_BOOT_LABEL, LEDST_OFF); +} + +#ifdef CONFIG_LED_BLINK +/** + * led_boot_blink() - turn ON the designated LED for booting + * + * Return: 0 if OK, -ve on error + */ +static inline int led_boot_blink(void) +{ + return led_set_period_by_label(CONFIG_LED_BOOT_LABEL, LED_BOOT_PERIOD); +} +#else +/* If LED BLINK is not supported/enabled, fallback to LED ON */ +#define led_boot_blink led_boot_on +#endif +#endif + #endif

Rework BOOT LED handling. There is currently one legacy implementation for BOOT LED from Status Led API.
This work on ancient implementation wused by BOOTP by setting the LED to Blink on boot and to turn it OFF when the firmware was correctly received by network.
Now that we new LED implementation have support for LED boot, rework this by also set the new BOOT LED to blink and also set it to ON before entering main loop to confirm successful boot.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- common/board_r.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/common/board_r.c b/common/board_r.c index c823cd262f1..6a4dacdea88 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -39,6 +39,7 @@ #include <initcall.h> #include <kgdb.h> #include <irq_func.h> +#include <led.h> #include <malloc.h> #include <mapmem.h> #include <miiphy.h> @@ -463,14 +464,30 @@ static int initr_malloc_bootparams(void) #if defined(CONFIG_LED_STATUS) static int initr_status_led(void) { -#if defined(CONFIG_LED_STATUS_BOOT) - status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_BLINKING); -#else status_led_init(); + + return 0; +} +#endif + +static int initr_boot_led_blink(void) +{ +#ifdef CONFIG_LED_STATUS_BOOT + status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_BLINKING); +#endif +#ifdef CONFIG_LED_BOOT_ENABLE + led_boot_blink(); #endif return 0; } + +static int initr_boot_led_on(void) +{ +#ifdef CONFIG_LED_BOOT_ENABLE + led_boot_on(); #endif + return 0; +}
#ifdef CONFIG_CMD_NET static int initr_net(void) @@ -717,6 +734,7 @@ static init_fnc_t init_sequence_r[] = { #if defined(CONFIG_LED_STATUS) initr_status_led, #endif + initr_boot_led_blink, /* PPC has a udelay(20) here dating from 2002. Why? */ #ifdef CONFIG_BOARD_LATE_INIT board_late_init, @@ -739,6 +757,7 @@ static init_fnc_t init_sequence_r[] = { #if defined(CFG_PRAM) initr_mem, #endif + initr_boot_led_on, run_main_loop, };

Implement LED activity API similar to BOOT LED API.
Usual activity might be a file transfer with TFTP, a flash write...
User of this API will call led_activity_on/off/blink() to signal these kind of activity.
New Kconfig are implemented similar to BOOT LED, LED_ACTIVITY_ENABLE to enable support for it, LED_ACTIVITY_LABEL to assign the LED in DT for activity usage and LED_ACTIVITY_PERIOD to set the blinking period.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- drivers/led/Kconfig | 23 +++++++++++++++++++++++ include/led.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+)
diff --git a/drivers/led/Kconfig b/drivers/led/Kconfig index 0506a33b6ee..f53e5fb5bd3 100644 --- a/drivers/led/Kconfig +++ b/drivers/led/Kconfig @@ -31,6 +31,29 @@ config LED_BOOT_PERIOD
Value is normalized per CONFIG_SYS_HZ.
+config LED_ACTIVITY_ENABLE + bool "Enable LED activity support" + help + Enable LED activity support. + + LED activity is a specific LED assigned to signal activity operation + like file trasnfer, flash write/erase... + +config LED_ACTIVITY_LABEL + string "LED activity label" + depends on LED_ACTIVITY_ENABLE + help + LED label defined in DT to assign for LED activity usage. + +config LED_ACTIVITY_PERIOD + int "LED activity period" + depends on LED_ACTIVITY_ENABLE && LED_BLINK + default 2 + help + LED activity blink period in ms. + + Value is normalized per CONFIG_SYS_HZ. + config LED_BCM6328 bool "LED Support for BCM6328" depends on LED && ARCH_BMIPS diff --git a/include/led.h b/include/led.h index 479c6d17c5b..409397e1df9 100644 --- a/include/led.h +++ b/include/led.h @@ -176,4 +176,44 @@ static inline int led_boot_blink(void) #endif #endif
+#ifdef CONFIG_LED_ACTIVITY_ENABLE + +#define LED_ACTIVITY_PERIOD CONFIG_SYS_HZ / CONFIG_LED_ACTIVITY_PERIOD + +/** + * led_activity_on() - turn ON the designated LED for activity + * + * Return: 0 if OK, -ve on error + */ +static inline int led_activity_on(void) +{ + return led_set_state_by_label(CONFIG_LED_ACTIVITY_LABEL, LEDST_ON); +} + +/** + * led_activity_off() - turn OFF the designated LED for activity + * + * Return: 0 if OK, -ve on error + */ +static inline int led_activity_off(void) +{ + return led_set_state_by_label(CONFIG_LED_ACTIVITY_LABEL, LEDST_OFF); +} + +#ifdef CONFIG_LED_BLINK +/** + * led_activity_blink() - turn ON the designated LED for activity + * + * Return: 0 if OK, -ve on error + */ +static inline int led_activity_blink(void) +{ + return led_set_period_by_label(CONFIG_LED_ACTIVITY_LABEL, LED_BOOT_PERIOD); +} +#else +/* If LED BLINK is not supported/enabled, fallback to LED ON */ +#define led_activity_blink led_activity_on +#endif +#endif + #endif

Implement support for LED activity. If the feature is enabled, make the defined ACTIVITY LED to signal traffic.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- net/tftp.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/net/tftp.c b/net/tftp.c index 6b16bdcbe4c..1d6609342a9 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -10,6 +10,7 @@ #include <efi_loader.h> #include <env.h> #include <image.h> +#include <led.h> #include <lmb.h> #include <log.h> #include <mapmem.h> @@ -192,6 +193,9 @@ static void new_transfer(void) #ifdef CONFIG_CMD_TFTPPUT tftp_put_final_block_sent = 0; #endif +#ifdef CONFIG_LED_ACTIVITY_ENABLE + led_activity_blink(); +#endif }
#ifdef CONFIG_CMD_TFTPPUT @@ -301,6 +305,9 @@ static void tftp_complete(void) time_start * 1000, "/s"); } puts("\ndone\n"); +#ifdef CONFIG_LED_ACTIVITY_ENABLE + led_activity_off(); +#endif if (!tftp_put_active) efi_set_bootdev("Net", "", tftp_filename, map_sysmem(tftp_load_addr, 0),

Implement support for LED activity. If the feature is enabled, make the defined ACTIVITY LED to signal mtd write or erase operations.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- cmd/mtd.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/cmd/mtd.c b/cmd/mtd.c index 795aaa2b37d..ba5ee0d4d71 100644 --- a/cmd/mtd.c +++ b/cmd/mtd.c @@ -10,6 +10,7 @@
#include <command.h> #include <console.h> +#include <led.h> #if CONFIG_IS_ENABLED(CMD_MTD_OTP) #include <hexdump.h> #endif @@ -558,6 +559,11 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc, while (mtd_block_isbad(mtd, off)) off += mtd->erasesize;
+#ifdef CONFIG_LED_ACTIVITY_ENABLE + if (!read) + led_activity_blink(); +#endif + /* Loop over the pages to do the actual read/write */ while (remaining) { /* Skip the block if it is bad */ @@ -585,6 +591,11 @@ static int do_mtd_io(struct cmd_tbl *cmdtp, int flag, int argc, io_op.oobbuf += io_op.oobretlen; }
+#ifdef CONFIG_LED_ACTIVITY_ENABLE + if (!read) + led_activity_off(); +#endif + if (!ret && dump) mtd_dump_device_buf(mtd, start_off, buf, len, woob);
@@ -652,6 +663,10 @@ static int do_mtd_erase(struct cmd_tbl *cmdtp, int flag, int argc, erase_op.addr = off; erase_op.len = mtd->erasesize;
+#ifdef CONFIG_LED_ACTIVITY_ENABLE + led_activity_blink(); +#endif + while (len) { if (!scrub) { ret = mtd_block_isbad(mtd, erase_op.addr); @@ -680,6 +695,10 @@ static int do_mtd_erase(struct cmd_tbl *cmdtp, int flag, int argc, erase_op.addr += mtd->erasesize; }
+#ifdef CONFIG_LED_ACTIVITY_ENABLE + led_activity_off(); +#endif + if (ret && ret != -EIO) ret = CMD_RET_FAILURE; else

Implement support for LED activity. If the feature is enabled, make the defined ACTIVITY LED to signal ubi write operation.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- cmd/ubi.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/cmd/ubi.c b/cmd/ubi.c index 8c1b5df0572..984be3da4af 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -14,6 +14,7 @@ #include <command.h> #include <env.h> #include <exports.h> +#include <led.h> #include <malloc.h> #include <memalign.h> #include <mtd.h> @@ -416,7 +417,19 @@ int ubi_volume_begin_write(char *volume, void *buf, size_t size,
int ubi_volume_write(char *volume, void *buf, size_t size) { - return ubi_volume_begin_write(volume, buf, size, size); + int ret; + +#ifdef CONFIG_LED_ACTIVITY_ENABLE + led_activity_blink(); +#endif + + ret = ubi_volume_begin_write(volume, buf, size, size); + +#ifdef CONFIG_LED_ACTIVITY_ENABLE + led_activity_off(); +#endif + + return ret; }
int ubi_volume_read(char *volume, char *buf, size_t size)

Introduce simple led.rst documentation to document all the additional Kconfig and the current limitation of LED_BLINK and GPIO software blink.
Signed-off-by: Christian Marangi ansuelsmth@gmail.com --- doc/api/index.rst | 1 + doc/api/led.rst | 10 ++++++++++ include/led.h | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 doc/api/led.rst
diff --git a/doc/api/index.rst b/doc/api/index.rst index 51b2013af36..6f11b94eac3 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -13,6 +13,7 @@ U-Boot API documentation event getopt interrupt + led linker_lists lmb logging diff --git a/doc/api/led.rst b/doc/api/led.rst new file mode 100644 index 00000000000..e52e350d1bb --- /dev/null +++ b/doc/api/led.rst @@ -0,0 +1,10 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +LED +=== + +.. kernel-doc:: include/led.h + :doc: Overview + +.. kernel-doc:: include/led.h + :internal: \ No newline at end of file diff --git a/include/led.h b/include/led.h index 409397e1df9..4dac54338e4 100644 --- a/include/led.h +++ b/include/led.h @@ -7,6 +7,44 @@ #ifndef __LED_H #define __LED_H
+/** + * DOC: Overview + * + * Generic LED API provided when a supported compatible is defined in DeviceTree. + * + * To enable support for LEDs, enable the `CONFIG_LED` Kconfig option. + * + * The most common implementation is for GPIO-connected LEDs. If using GPIO-connected LEDs, + * enable the `LED_GPIO` Kconfig option. + * + * `LED_BLINK` support requires LED driver support and is therefore optional. If LED blink + * functionality is needed, enable the `LED_BLINK` Kconfig option. + * + * GPIO-connected LEDs can simulate blinking via software using the Cyclic API. To utilize this, + * enable `CONFIG_LED_GPIO_SW_BLINK`. This will also select `CONFIG_LED_BLINK` and `CONFIG_CYCLIC`. + * + * Boot and Activity LEDs are also supported. These LEDs can signal various system operations + * during runtime, such as boot initialization, file transfers, and flash write/erase operations. + * + * To enable a Boot LED, enable `CONFIG_LED_BOOT_ENABLE` and define `CONFIG_LED_BOOT_LABEL`. This + * will enable the specified LED to blink and turn ON when the bootloader initializes correctly. + * + * To enable an Activity LED, enable `CONFIG_LED_ACTIVITY_ENABLE` and define + * `CONFIG_LED_ACTIVITY_LABEL`. + * This will enable the specified LED to blink and turn ON during file transfers or flash + * write/erase operations. + * + * Both Boot and Activity LEDs provide a simple API to turn the LED ON or OFF: + * `led_boot_on()`, `led_boot_off()`, `led_activity_on()`, and `led_activity_off()`. + * + * Both configurations can optionally define a `_PERIOD` option if `CONFIG_LED_BLINK` is enabled + * for LED blink operations, which is usually used by the Activity LED. + * + * When `CONFIG_LED_BLINK` is enabled, additional APIs are exposed: `led_boot_blink()` and + * `led_activity_blink()`. Note that if `CONFIG_LED_BLINK` is disabled, these APIs will behave + * like the `led_boot_on()` and `led_activity_on()` APIs, respectively. + */ + struct udevice;
enum led_state_t {
participants (1)
-
Christian Marangi