From 0204b81f09bf4042a89d5eb031bb8e767d1aff99 Mon Sep 17 00:00:00 2001 From: Zick Wei Date: Mon, 22 Jun 2020 09:16:03 +0800 Subject: common: add CONFIG_POWER_SIGNAL_RUNTIME_CONFIG This patch add config: CONFIG_POWER_SUGNAL_RUNTIME_CONFIG to allow board modified power signal gpio if needed. BUG=b:150278507, b:152841287 BRANCH=none TEST=make buildall Signed-off-by: Zick Wei Change-Id: I5c885f9cb3400f3354a18b6d497340dfe3ad993b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2256624 Reviewed-by: Denis Brockus --- include/config.h | 3 +++ include/power.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/config.h b/include/config.h index 70d9179789..cd09eed545 100644 --- a/include/config.h +++ b/include/config.h @@ -641,6 +641,9 @@ /*****************************************************************************/ +/* EC can choose power signal gpio by schematic version */ +#undef CONFIG_POWER_SIGNAL_RUNTIME_CONFIG + /* EC has GPIOs to allow board to reset RTC */ #undef CONFIG_BOARD_HAS_RTC_RESET diff --git a/include/power.h b/include/power.h index 41d7a5585d..fd0c9af432 100644 --- a/include/power.h +++ b/include/power.h @@ -69,7 +69,11 @@ struct power_signal_info { * Each board must provide its signal list and a corresponding enum * power_signal. */ +#ifdef CONFIG_POWER_SIGNAL_RUNTIME_CONFIG +extern struct power_signal_info power_signal_list[]; +#else extern const struct power_signal_info power_signal_list[]; +#endif /* Convert enum power_signal to a mask for signal functions */ #define POWER_SIGNAL_MASK(signal) (1 << (signal)) -- cgit v1.2.1