summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-04 16:00:43 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-05 19:23:06 +0000
commitafe4efdc9506dabcbbf0545d70a598d8d7428f44 (patch)
tree352a4ff1921d698f5b1421a4aa160ae9ea25c70a
parente150dbe890434ee59292c3ab0e2128c265502759 (diff)
downloadchrome-ec-afe4efdc9506dabcbbf0545d70a598d8d7428f44.tar.gz
zephyr: Support volume buttons
Add support for volume buttons in Zephyr. BUG=b:167405015 BRANCH=none TEST=with other CLs, build for volteer and see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Id8bd57c4dc36037fc5e4181291623a6f358b8381 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674955 Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/CMakeLists.txt3
-rw-r--r--zephyr/Kconfig.keyboard10
-rw-r--r--zephyr/shim/include/config_chip.h5
3 files changed, 18 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index e28c94c527..dc02a3eb0d 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -244,6 +244,9 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_USBC_PPC_SYV682X
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_VBOOT_HASH
"${PLATFORM_EC}/common/vboot_hash.c")
+zephyr_sources_ifdef(CONFIG_PLATFORM_EC_VOLUME_BUTTONS
+ "${PLATFORM_EC}/common/button.c")
+
zephyr_sources_ifdef(CONFIG_PLATFORM_EC_VSTORE "${PLATFORM_EC}/common/vstore.c")
zephyr_sources_ifdef(CONFIG_SHELL "${PLATFORM_EC}/common/gpio_commands.c")
diff --git a/zephyr/Kconfig.keyboard b/zephyr/Kconfig.keyboard
index 70358d14eb..e14c887aff 100644
--- a/zephyr/Kconfig.keyboard
+++ b/zephyr/Kconfig.keyboard
@@ -80,6 +80,16 @@ config PLATFORM_EC_KEYBOARD_COL2_INVERTED
Refresh key will also trigger T key, which is in the next scanning
column line. See http://b/156007029.
+config PLATFORM_EC_VOLUME_BUTTONS
+ bool "Board has volume-up and volume-down buttons"
+ help
+ Enable this if the board has physical buttons for the volume controls.
+ These are buttons controlled by GPIOs and are not part of the keyboard
+ matrix.
+
+ Your board must define GPIO_VOLUME_UP_L and GPIO_VOLUME_DOWN_L in
+ gpio_map.h
+
config PLATFORM_EC_CONSOLE_CMD_KEYBOARD_8042
bool "Console command: i8042"
default y if PLATFORM_EC_KEYBOARD_PROTOCOL_8042
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index 299bef85ee..55a0743d2b 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -284,6 +284,11 @@ enum battery_type {
#define CONFIG_KEYBOARD_PWRBTN_ASSERTS_KSI3
#endif
+#undef CONFIG_VOLUME_BUTTONS
+#ifdef CONFIG_PLATFORM_EC_VOLUME_BUTTONS
+#define CONFIG_VOLUME_BUTTONS
+#endif
+
#undef CONFIG_PWM_KBLIGHT
#undef CONFIG_KEYBOARD_BACKLIGHT
#ifdef CONFIG_PLATFORM_EC_PWM_KBLIGHT