diff options
-rw-r--r-- | src/ec/starlabs/merlin/Kconfig | 7 | ||||
-rw-r--r-- | src/ec/starlabs/merlin/ec.c | 11 | ||||
-rw-r--r-- | src/mainboard/starlabs/labtop/Kconfig | 1 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/ec/starlabs/merlin/Kconfig b/src/ec/starlabs/merlin/Kconfig index 67582ac4a7..93101b74ec 100644 --- a/src/ec/starlabs/merlin/Kconfig +++ b/src/ec/starlabs/merlin/Kconfig @@ -44,6 +44,13 @@ config EC_STARLABS_FAN 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 40be138a82..e8eaa229d7 100644 --- a/src/ec/starlabs/merlin/ec.c +++ b/src/ec/starlabs/merlin/ec.c @@ -130,11 +130,12 @@ static void merlin_init(struct device *dev) 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 1700fb1410..9bf4273e0a 100644 --- a/src/mainboard/starlabs/labtop/Kconfig +++ b/src/mainboard/starlabs/labtop/Kconfig @@ -31,6 +31,7 @@ config BOARD_STARLABS_STARBOOK_TGL select DRIVERS_INTEL_USB4_RETIMER select EC_STARLABS_KBL_LEVELS select EC_STARLABS_FAN + select EC_STARLABS_MAX_CHARGE select EC_STARLABS_NEED_ITE_BIN select MAINBOARD_HAS_LPC_TPM select MAINBOARD_HAS_TPM2 |