diff mbox series

[v2,1/2] board: sunxi: enable status LED early

Message ID 20210908191420.138444-2-arnaud.ferraris@collabora.com
State Accepted
Delegated to: Andre Przywara
Headers show
Series PinePhone: enable LED on boot for improved | expand

Commit Message

Arnaud Ferraris Sept. 8, 2021, 7:14 p.m. UTC
For some systems, such as the PinePhone, there is no way for the end
user to make sure the system is indeed booting before the boot script is
executed, which takes several seconds. Therefore, it can be useful to
provide early visual feedback as soon as possible.

In order achieve this goal, this patch initializes the status LED (if
configured) in the SPL.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
---
Changes in v2:
  - limit the amount of #ifdef's in board.c

 board/sunxi/board.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Samuel Holland Sept. 9, 2021, 12:15 a.m. UTC | #1
On 9/8/21 2:14 PM, Arnaud Ferraris wrote:
> For some systems, such as the PinePhone, there is no way for the end
> user to make sure the system is indeed booting before the boot script is
> executed, which takes several seconds. Therefore, it can be useful to
> provide early visual feedback as soon as possible.
> 
> In order achieve this goal, this patch initializes the status LED (if
> configured) in the SPL.
> 
> Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>

Reviewed-by: Samuel Holland <samuel@sholland.org>
diff mbox series

Patch

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 1a46100e40..2249374fba 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -46,6 +46,7 @@ 
 #include <spl.h>
 #include <sy8106a.h>
 #include <asm/setup.h>
+#include <status_led.h>
 
 #if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
 /* So that we can use pin names in Kconfig and sunxi_name_to_gpio() */
@@ -672,6 +673,11 @@  void sunxi_board_init(void)
 {
 	int power_failed = 0;
 
+#ifdef CONFIG_LED_STATUS
+	if (IS_ENABLED(CONFIG_SPL_DRIVERS_MISC))
+		status_led_init();
+#endif
+
 #ifdef CONFIG_SY8106A_POWER
 	power_failed = sy8106a_set_vout1(CONFIG_SY8106A_VOUT1_VOLT);
 #endif