Sean Rhodes has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85702?usp=email )
Change subject: ec/starlabs/merlin: Add the option to reduce the LED brightness ......................................................................
ec/starlabs/merlin: Add the option to reduce the LED brightness
Add an option to set the Power LED to a lower brightness level
Change-Id: I39507d4f2e572ca31ad982ce0d730a0d00f6ca32 Signed-off-by: Sean Rhodes sean@starlabs.systems Reviewed-on: https://review.coreboot.org/c/coreboot/+/85702 Reviewed-by: Matt DeVillier matt.devillier@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/ec/starlabs/merlin/Kconfig M src/ec/starlabs/merlin/ec.h M src/ec/starlabs/merlin/ite.c M src/ec/starlabs/merlin/variants/apl/ecdefs.h M src/ec/starlabs/merlin/variants/cezanne/ecdefs.h M src/ec/starlabs/merlin/variants/glk/ecdefs.h M src/ec/starlabs/merlin/variants/glkr/ecdefs.h M src/ec/starlabs/merlin/variants/kbl/ecdefs.h M src/ec/starlabs/merlin/variants/merlin/ecdefs.h M src/mainboard/starlabs/starlite_adl/Kconfig M src/mainboard/starlabs/starlite_adl/cmos.default M src/mainboard/starlabs/starlite_adl/cmos.layout 12 files changed, 44 insertions(+), 0 deletions(-)
Approvals: Matt DeVillier: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/ec/starlabs/merlin/Kconfig b/src/ec/starlabs/merlin/Kconfig index 32b3ed0..52690e3 100644 --- a/src/ec/starlabs/merlin/Kconfig +++ b/src/ec/starlabs/merlin/Kconfig @@ -76,6 +76,12 @@ help Select if the mainboard supports disabling the lid switch
+config EC_STARLABS_POWER_LED + bool "Enable lowering the brightess of the Power LED" + depends on EC_STARLABS_ITE + help + Selec the in the mainboard supports reducing the LED brightness + config EC_STARLABS_MERLIN bool "Use open-source Merlin EC Firmware" default n diff --git a/src/ec/starlabs/merlin/ec.h b/src/ec/starlabs/merlin/ec.h index 7372f52..d5e1788 100644 --- a/src/ec/starlabs/merlin/ec.h +++ b/src/ec/starlabs/merlin/ec.h @@ -107,6 +107,10 @@ #define SWITCH_ENABLED 0x00 #define SWITCH_DISABLED 0x01
+/* Power LED Brightness */ +#define LED_NORMAL 0x00 +#define LED_REDUCED 0x01 + uint16_t ec_get_version(void);
#endif diff --git a/src/ec/starlabs/merlin/ite.c b/src/ec/starlabs/merlin/ite.c index 383c1a4..52d4b9d 100644 --- a/src/ec/starlabs/merlin/ite.c +++ b/src/ec/starlabs/merlin/ite.c @@ -71,6 +71,7 @@ * kbl_state * charging_speed * lid_switch + * power_led */
/* @@ -285,6 +286,27 @@ 0, lid_switch, ARRAY_SIZE(lid_switch))); + + /* + * Power LED Brightness + * + * Setting: power_led + * + * Values: 0, 1 + * Default: 0 + * + */ + const uint8_t power_led[] = { + LED_NORMAL, + LED_REDUCED + }; + + if (CONFIG(EC_STARLABS_POWER_LED)) + ec_write(ECRAM_POWER_LED, + get_ec_value_from_option("power_led", + 0, + power_led, + ARRAY_SIZE(power_led))); }
static struct device_operations ops = { diff --git a/src/ec/starlabs/merlin/variants/apl/ecdefs.h b/src/ec/starlabs/merlin/variants/apl/ecdefs.h index 72baf09..b2a8eaa 100644 --- a/src/ec/starlabs/merlin/variants/apl/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/apl/ecdefs.h @@ -22,5 +22,6 @@ #define ECRAM_FAST_CHARGE dead_code_t(uint8_t) #define ECRAM_CHARGING_SPEED dead_code_t(uint8_t) #define ECRAM_LID_SWITCH dead_code_t(uint8_t) +#define ECRAM_POWER_LED 0x1f
#endif diff --git a/src/ec/starlabs/merlin/variants/cezanne/ecdefs.h b/src/ec/starlabs/merlin/variants/cezanne/ecdefs.h index 967e3c3..47e3b77 100644 --- a/src/ec/starlabs/merlin/variants/cezanne/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/cezanne/ecdefs.h @@ -25,5 +25,6 @@ #define ECRAM_FAST_CHARGE dead_code_t(uint8_t) #define ECRAM_CHARGING_SPEED dead_code_t(uint8_t) #define ECRAM_LID_SWITCH dead_code_t(uint8_t) +#define ECRAM_POWER_LED 0x1f
#endif diff --git a/src/ec/starlabs/merlin/variants/glk/ecdefs.h b/src/ec/starlabs/merlin/variants/glk/ecdefs.h index 9178d0c..b9b4305 100644 --- a/src/ec/starlabs/merlin/variants/glk/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/glk/ecdefs.h @@ -22,5 +22,6 @@ #define ECRAM_FAST_CHARGE dead_code_t(uint8_t) #define ECRAM_CHARGING_SPEED dead_code_t(uint8_t) #define ECRAM_LID_SWITCH dead_code_t(uint8_t) +#define ECRAM_POWER_LED 0x1f
#endif diff --git a/src/ec/starlabs/merlin/variants/glkr/ecdefs.h b/src/ec/starlabs/merlin/variants/glkr/ecdefs.h index a36f4df..3e63bcb 100644 --- a/src/ec/starlabs/merlin/variants/glkr/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/glkr/ecdefs.h @@ -25,5 +25,6 @@ #define ECRAM_FAST_CHARGE 0x18 #define ECRAM_CHARGING_SPEED dead_code_t(uint8_t) #define ECRAM_LID_SWITCH dead_code_t(uint8_t) +#define ECRAM_POWER_LED 0x1f
#endif diff --git a/src/ec/starlabs/merlin/variants/kbl/ecdefs.h b/src/ec/starlabs/merlin/variants/kbl/ecdefs.h index 1c821d4..82384dd 100644 --- a/src/ec/starlabs/merlin/variants/kbl/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/kbl/ecdefs.h @@ -22,5 +22,6 @@ #define ECRAM_FAST_CHARGE dead_code_t(uint8_t) #define ECRAM_CHARGING_SPEED dead_code_t(uint8_t) #define ECRAM_LID_SWITCH dead_code_t(uint8_t) +#define ECRAM_POWER_LED 0x1f
#endif diff --git a/src/ec/starlabs/merlin/variants/merlin/ecdefs.h b/src/ec/starlabs/merlin/variants/merlin/ecdefs.h index fb1d5b2..17de22c 100644 --- a/src/ec/starlabs/merlin/variants/merlin/ecdefs.h +++ b/src/ec/starlabs/merlin/variants/merlin/ecdefs.h @@ -22,5 +22,6 @@ #define ECRAM_FAST_CHARGE dead_code_t(uint8_t) #define ECRAM_CHARGING_SPEED 0x1d #define ECRAM_LID_SWITCH 0x1e +#define ECRAM_POWER_LED 0x1f
#endif diff --git a/src/mainboard/starlabs/starlite_adl/Kconfig b/src/mainboard/starlabs/starlite_adl/Kconfig index 5c289c8..41d6c23 100644 --- a/src/mainboard/starlabs/starlite_adl/Kconfig +++ b/src/mainboard/starlabs/starlite_adl/Kconfig @@ -7,6 +7,7 @@ select EC_STARLABS_MAX_CHARGE select EC_STARLABS_MERLIN select EC_STARLABS_NEED_ITE_BIN + select EC_STARLABS_POWER_LED select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select HAVE_CMOS_DEFAULT diff --git a/src/mainboard/starlabs/starlite_adl/cmos.default b/src/mainboard/starlabs/starlite_adl/cmos.default index 899d4c7..d3c3f80 100644 --- a/src/mainboard/starlabs/starlite_adl/cmos.default +++ b/src/mainboard/starlabs/starlite_adl/cmos.default @@ -15,5 +15,6 @@ camera=Enable microphone=Enable lid_switch=Disable +power_led=Normal # EC charging_speed=0.5C diff --git a/src/mainboard/starlabs/starlite_adl/cmos.layout b/src/mainboard/starlabs/starlite_adl/cmos.layout index b6dc5e4..909d7655 100644 --- a/src/mainboard/starlabs/starlite_adl/cmos.layout +++ b/src/mainboard/starlabs/starlite_adl/cmos.layout @@ -32,6 +32,7 @@ 520 1 e 1 camera 528 1 e 1 microphone 536 1 e 1 lid_switch +542 1 e 9 power_led
# coreboot config options: EC 600 2 e 6 max_charge @@ -83,6 +84,9 @@ 8 1 6400MT/s 8 2 7500MT/s
+9 0 Normal +9 1 Reduced + # ----------------------------------------------------------------- checksums