From: Stefan Roese <sr@denx.de>
Date: Tue, 9 Oct 2018 06:59:13 +0000 (+0200)
Subject: mips: mt76xx: gardena-smart-gateway: Add board_late_init() to set LED def state
X-Git-Tag: v2025.01-rc5-pxa1908~3274^2~6
X-Git-Url: http://git.dujemihanovic.xyz/img/static/login.html?a=commitdiff_plain;h=b1f51fc24f9f9f9be450a280c92a49d7e1a8668a;p=u-boot.git

mips: mt76xx: gardena-smart-gateway: Add board_late_init() to set LED def state

This is needed to set the LEDs automatically to a default state, as
configured in the dts.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
---

diff --git a/arch/mips/mach-mt7620/Kconfig b/arch/mips/mach-mt7620/Kconfig
index 13a7bd2cc0..4ebcb4b053 100644
--- a/arch/mips/mach-mt7620/Kconfig
+++ b/arch/mips/mach-mt7620/Kconfig
@@ -24,6 +24,7 @@ choice
 config BOARD_GARDENA_SMART_GATEWAY_MT7688
 	bool "Gardena Smart Gateway"
 	depends on SOC_MT7620
+	select BOARD_LATE_INIT
 	select SUPPORTS_BOOT_RAM
 	help
 	  Gardena Smart Gateway boards have a MT7688 SoC with 128 MiB of RAM
diff --git a/board/gardena/smart-gateway-mt7688/board.c b/board/gardena/smart-gateway-mt7688/board.c
index 838dfc205b..3a1838e44a 100644
--- a/board/gardena/smart-gateway-mt7688/board.c
+++ b/board/gardena/smart-gateway-mt7688/board.c
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <led.h>
 #include <linux/io.h>
 
 #define MT76XX_AGPIO_CFG	0x1000003c
@@ -18,3 +19,11 @@ int board_early_init_f(void)
 
 	return 0;
 }
+
+int board_late_init(void)
+{
+	if (IS_ENABLED(CONFIG_LED))
+		led_default_state();
+
+	return 0;
+}