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>
This commit is contained in:
Sean Rhodes 2024-10-29 10:07:50 +00:00
commit eef5a5747f
12 changed files with 44 additions and 0 deletions

View file

@ -76,6 +76,12 @@ config EC_STARLABS_LID_SWITCH
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

View file

@ -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

View file

@ -71,6 +71,7 @@ static void merlin_init(struct device *dev)
* kbl_state
* charging_speed
* lid_switch
* power_led
*/
/*
@ -285,6 +286,27 @@ static void merlin_init(struct device *dev)
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 = {

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -7,6 +7,7 @@ config BOARD_STARLABS_STARLITE_SERIES
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

View file

@ -15,5 +15,6 @@ webcam=Enable
camera=Enable
microphone=Enable
lid_switch=Disable
power_led=Normal
# EC
charging_speed=0.5C

View file

@ -32,6 +32,7 @@ entries
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 @@ enumerations
8 1 6400MT/s
8 2 7500MT/s
9 0 Normal
9 1 Reduced
# -----------------------------------------------------------------
checksums