From f94dbdfa5768a8be81b180bfd00064f8bb642634 Mon Sep 17 00:00:00 2001 From: dnojiri Date: Wed, 4 Mar 2020 12:41:42 -0800 Subject: 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 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 Commit-Queue: Daisuke Nojiri Tested-by: Daisuke Nojiri Auto-Submit: Daisuke Nojiri --- include/button.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/button.h') 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, -- cgit v1.2.1