summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-11-09 12:51:13 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-10 00:57:30 +0000
commit5d36fe2ef100d1f1a174eb32bb5956d5534af27f (patch)
tree97cb0afcb7138f1314261ab1c664f1b7f96625c1
parente6d6403b047bea8016af1f669ff3b66531bc72eb (diff)
downloadchrome-ec-5d36fe2ef100d1f1a174eb32bb5956d5534af27f.tar.gz
zephyr: add shim for extpower
This brings over the extpower_common.c and extpower_gpio.c files to the Zephyr build. This is needed as a dependency of power sequencing. BUG=b:172720290 BRANCH=none TEST=on volteer, observe "hostevents" command output to see AC_PRESENT event set when charger connected. (requires the zephyr-chrome CL as well) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I28ad442180762d542cc6031ab1f33284b08a4572 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527703 Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--zephyr/CMakeLists.txt3
-rw-r--r--zephyr/Kconfig9
2 files changed, 12 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index a6a4b75e22..475834f7e7 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -35,6 +35,9 @@ zephyr_include_directories_ifdef(
add_subdirectory_ifdef(CONFIG_PLATFORM_EC "shim")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC "${PLATFORM_EC}/common/base32.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC "${PLATFORM_EC}/common/extpower_common.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_EXTPOWER_GPIO
+ "${PLATFORM_EC}/common/extpower_gpio.c")
zephyr_sources_ifdef(CONFIG_SHELL "${PLATFORM_EC}/common/gpio_commands.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD "${PLATFORM_EC}/common/host_command.c")
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_HOSTCMD "${PLATFORM_EC}/common/host_event_commands.c")
diff --git a/zephyr/Kconfig b/zephyr/Kconfig
index 381c2fe30c..5dba81db7b 100644
--- a/zephyr/Kconfig
+++ b/zephyr/Kconfig
@@ -28,6 +28,15 @@ config ZEPHYR
This should always be enabled. It's a workaround for
config.h not being available in some headers.
+config PLATFORM_EC_EXTPOWER_GPIO
+ bool "Enable the GPIO-based external power detection module"
+ depends on PLATFORM_EC_HOOKS && PLATFORM_EC_HOSTCMD
+ help
+ Enable shimming the extpower_gpio module, which provides
+ GPIO-based external power presence detection features. The
+ project should define a GPIO pin named GPIO_AC_PRESENT, with
+ extpower_interrupt configured as the handler in gpio_map.h.
+
menuconfig PLATFORM_EC_KEYBOARD
bool "Enable keybaord support"
default y