]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
board: st: Update LED management for stm32mp1
authorPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 14 Nov 2025 16:23:36 +0000 (17:23 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 5 Dec 2025 10:39:40 +0000 (11:39 +0100)
Remove get_led() and setup_led() which became obsolete since
led_boot_on() introduction. led_boot_on() is automatically called
from board_r.c

Regarding "u-boot,error-led" property can't be used anymore since commit
Since commit 516a13e8db32 ("led: update LED boot/activity to new property implementation")

Instead get the LED labeled "red:status".
See kernel series: https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=1022570

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
board/st/stm32mp1/stm32mp1.c

index cb5cab9f36adaebf24ffcb2932f4041fdc2119bf..5f7c68221169be41ad496d1faf39d1f9a60c0af6 100644 (file)
@@ -247,41 +247,6 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 }
 #endif /* CONFIG_USB_GADGET_DOWNLOAD */
 
-static int get_led(struct udevice **dev, char *led_string)
-{
-       const char *led_name;
-       int ret;
-
-       led_name = ofnode_conf_read_str(led_string);
-       if (!led_name) {
-               log_debug("could not find %s config string\n", led_string);
-               return -ENOENT;
-       }
-       ret = led_get_by_label(led_name, dev);
-       if (ret) {
-               log_debug("get=%d\n", ret);
-               return ret;
-       }
-
-       return 0;
-}
-
-static int setup_led(enum led_state_t cmd)
-{
-       struct udevice *dev;
-       int ret;
-
-       if (!CONFIG_IS_ENABLED(LED))
-               return 0;
-
-       ret = get_led(&dev, "u-boot,boot-led");
-       if (ret)
-               return ret;
-
-       ret = led_set_state(dev, cmd);
-       return ret;
-}
-
 static void __maybe_unused led_error_blink(u32 nb_blink)
 {
        int ret;
@@ -292,9 +257,9 @@ static void __maybe_unused led_error_blink(u32 nb_blink)
                return;
 
        if (CONFIG_IS_ENABLED(LED)) {
-               ret = get_led(&led, "u-boot,error-led");
+               ret = led_get_by_label("red:status", &led);
                if (!ret) {
-                       /* make u-boot,error-led blinking */
+                       /* make led "red:status" blinking */
                        /* if U32_MAX and 125ms interval, for 17.02 years */
                        for (i = 0; i < 2 * nb_blink; i++) {
                                led_set_state(led, LEDST_TOGGLE);
@@ -418,7 +383,7 @@ static int board_check_usb_power(void)
         * If highest and lowest value are either both below
         * USB_LOW_THRESHOLD_UV or both above USB_LOW_THRESHOLD_UV, that
         * means USB TYPE-C is in unattached mode, this is an issue, make
-        * u-boot,error-led blinking and stop boot process.
+        * led "red:status" blinking and stop boot process.
         */
        if ((max_uV > USB_LOW_THRESHOLD_UV &&
             min_uV > USB_LOW_THRESHOLD_UV) ||
@@ -672,8 +637,6 @@ int board_init(void)
        if (IS_ENABLED(CONFIG_ARMV7_NONSEC))
                sysconf_init();
 
-       setup_led(LEDST_ON);
-
 #if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
        efi_guid_t image_type_guid = STM32MP_FIP_IMAGE_GUID;
 
@@ -736,7 +699,7 @@ int board_late_init(void)
 
 void board_quiesce_devices(void)
 {
-       setup_led(LEDST_OFF);
+       led_boot_off();
 }
 
 enum env_location env_get_location(enum env_operation op, int prio)