summaryrefslogtreecommitdiff
path: root/src/ec/starlabs/merlin
diff options
context:
space:
mode:
authorSean Rhodes <sean@starlabs.systems>2022-02-17 13:55:34 +0000
committerFelix Held <felix-coreboot@felixheld.de>2022-03-08 16:07:11 +0000
commit4d1bf7b847c400dfd3fd0cd56cd57e49b766843a (patch)
tree82e3db6de7a633d57773abc0730b5270c8f8ee8f /src/ec/starlabs/merlin
parentad6157ebdfddc39b95e388487e00cadd2bbf368b (diff)
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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62123 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Andy Pont <andy.pont@sdcsystems.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/ec/starlabs/merlin')
-rw-r--r--src/ec/starlabs/merlin/Kconfig7
-rw-r--r--src/ec/starlabs/merlin/ec.c11
2 files changed, 13 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