summaryrefslogtreecommitdiff
path: root/include/button.h
diff options
context:
space:
mode:
authordnojiri <dnojiri@chromium.org>2020-03-04 12:41:42 -0800
committerCommit Bot <commit-bot@chromium.org>2020-03-05 03:10:27 +0000
commitf94dbdfa5768a8be81b180bfd00064f8bb642634 (patch)
treea265d2822d5f0ffd45a6c1e882dedb2a61153ea9 /include/button.h
parent5e9b1c805b2b13d998fb65506ff3a214c8bfd8d3 (diff)
downloadchrome-ec-f94dbdfa5768a8be81b180bfd00064f8bb642634.tar.gz
Button: Clean up button library
Define BUTTON_DEBOUNCE_US and use it for recovery, volume, and power. Use struct button_config for characterizing power button. Introduce CONFIG_POWER_BUTTON_FLAGS for power button customization. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=Verified power button works on Helios. TEST=Verified powerbtn command works on Helios. Change-Id: I4fd0db1da6190127f223d9c27b02ae370fa91c03 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2088279 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include/button.h')
-rw-r--r--include/button.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/button.h b/include/button.h
index 2961625bea..5f6ffe11c6 100644
--- a/include/button.h
+++ b/include/button.h
@@ -14,6 +14,8 @@
#define BUTTON_FLAG_ACTIVE_HIGH BIT(0)
+#define BUTTON_DEBOUNCE_US (30 * MSEC)
+
enum keyboard_button_type {
KEYBOARD_BUTTON_POWER = 0,
KEYBOARD_BUTTON_VOLUME_DOWN,