Sean Rhodes has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/62123 )
Change subject: ec/starlabs: Guard Max Charge in Kconfig ......................................................................
ec/starlabs: Guard Max Charge in Kconfig
Guard Max Charge EC write in Kconfig so it's only used on platforms that support it.
Signed-off-by: Sean Rhodes sean@starlabs.systems Change-Id: I7be39cd9543c8253d53070950edc6908a21e864a --- M src/ec/starlabs/merlin/Kconfig M src/ec/starlabs/merlin/ec.c M src/mainboard/starlabs/labtop/Kconfig 3 files changed, 14 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/62123/1
diff --git a/src/ec/starlabs/merlin/Kconfig b/src/ec/starlabs/merlin/Kconfig index 67582ac..93101b7 100644 --- a/src/ec/starlabs/merlin/Kconfig +++ b/src/ec/starlabs/merlin/Kconfig @@ -44,6 +44,13 @@ help Select if the mainboard has a fan.
+config EC_STARLABS_MAX_CHARGE + bool + default n + depends on EC_STARLABS_ITE + help + Select if the mainboard supports limiting the maximum charge of the battery. + config EC_STARLABS_MERLIN bool "Use open-source Merlin EC Firmware" default n diff --git a/src/ec/starlabs/merlin/ec.c b/src/ec/starlabs/merlin/ec.c index 40be138..e8eaa22 100644 --- a/src/ec/starlabs/merlin/ec.c +++ b/src/ec/starlabs/merlin/ec.c @@ -130,11 +130,12 @@ CHARGE_60 };
- ec_write(ECRAM_MAX_CHARGE, - get_ec_value_from_option("max_charge", - 0, - max_charge, - ARRAY_SIZE(max_charge))); + if (CONFIG(EC_STARLABS_MAX_CHARGE)) + ec_write(ECRAM_MAX_CHARGE, + get_ec_value_from_option("max_charge", + 0, + max_charge, + ARRAY_SIZE(max_charge)));
/* * Fan Mode diff --git a/src/mainboard/starlabs/labtop/Kconfig b/src/mainboard/starlabs/labtop/Kconfig index e133faa..b7defc3 100644 --- a/src/mainboard/starlabs/labtop/Kconfig +++ b/src/mainboard/starlabs/labtop/Kconfig @@ -3,6 +3,7 @@ select DRIVERS_I2C_HID select EC_STARLABS_ITE select EC_STARLABS_FAN + select EC_STARLABS_MAX_CHARGE select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select HAVE_CMOS_DEFAULT