summaryrefslogtreecommitdiff
path: root/include/button.h
diff options
context:
space:
mode:
authorpandeyan <anshuman.pandey@intel.com>2020-01-31 12:03:17 +0530
committerCommit Bot <commit-bot@chromium.org>2020-03-17 10:59:27 +0000
commite5e676f641dec32ddf4b32d1b8f4f9636e31ff2a (patch)
tree70ff7dda81a04ab75e1f402847230d302343050c /include/button.h
parentc0bc2333b28bfad368768292fa84808bfb9cf954 (diff)
downloadchrome-ec-e5e676f641dec32ddf4b32d1b8f4f9636e31ff2a.tar.gz
Button: add ectool command to simulate button press
Added a new ectool command 'ectool button' for simulating volume up and volume down button operations along with the duration in milli-seconds for which button needs to be pressed. BUG=b:149659987 BRANCH=None TEST=Tested on hatch board. From Kernel console, entered the below commands: $ectool button vup 500 Observed volume UP key press on EC console. Change-Id: I6fcdf80ea45b80403f72af89ce99214226731d0f Signed-off-by: pandeyan <anshuman.pandey@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2059929 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'include/button.h')
-rw-r--r--include/button.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/include/button.h b/include/button.h
index 5f6ffe11c6..bbe4cb44df 100644
--- a/include/button.h
+++ b/include/button.h
@@ -11,28 +11,12 @@
#include "common.h"
#include "compile_time_macros.h"
#include "gpio.h"
+#include "ec_commands.h"
#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,
- KEYBOARD_BUTTON_VOLUME_UP,
- KEYBOARD_BUTTON_RECOVERY,
- KEYBOARD_BUTTON_CAPSENSE_1,
- KEYBOARD_BUTTON_CAPSENSE_2,
- KEYBOARD_BUTTON_CAPSENSE_3,
- KEYBOARD_BUTTON_CAPSENSE_4,
- KEYBOARD_BUTTON_CAPSENSE_5,
- KEYBOARD_BUTTON_CAPSENSE_6,
- KEYBOARD_BUTTON_CAPSENSE_7,
- KEYBOARD_BUTTON_CAPSENSE_8,
-
- KEYBOARD_BUTTON_COUNT
-};
-
struct button_config {
const char *name;
enum keyboard_button_type type;