summaryrefslogtreecommitdiff
path: root/board/rainier
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-11-15 22:23:00 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-17 20:18:38 -0800
commit34a97f50d5275f1fa2f1cb377683c96286b2421d (patch)
tree2ea62dc537426fb252123fb93b3b4f05db5f1443 /board/rainier
parentf587852570770564e8a94b2c3f7ad7d97883c49a (diff)
downloadchrome-ec-34a97f50d5275f1fa2f1cb377683c96286b2421d.tar.gz
buttons: Make buttons[] common.
Nearly every board had a buttons array defined in which its contents had the standard volume buttons. This commit creates a single common buttons array that can contain the standard volume buttons and recovery buttons. If a board has volume up and down buttons, they can simply define CONFIG_VOLUME_BUTTONS and it will populate the buttons array with the standard definition. The buttons are active low and have a 30 ms debounce period. Similiarly, if a board has a dedicated recovery button, defining CONFIG_DEDICATED_RECOVERY_BUTTON will also populate the buttons array with a recovery button. BUG=chromium:783371 BRANCH=None TEST=make -j buildall. TEST=Flash a device with CONFIG_VOLUME_BUTTONS, verify pressing volume buttons still work. Change-Id: Ie5d63670ca4c6b146ec8ffb64d40ea9ce437b913 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/773794 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board/rainier')
-rw-r--r--board/rainier/board.c7
-rw-r--r--board/rainier/board.h8
2 files changed, 1 insertions, 14 deletions
diff --git a/board/rainier/board.c b/board/rainier/board.c
index 237cfcca12..b8c8627983 100644
--- a/board/rainier/board.c
+++ b/board/rainier/board.c
@@ -129,13 +129,6 @@ const enum gpio_signal hibernate_wake_pins[] = {
const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins);
/******************************************************************************/
-const struct button_config buttons[CONFIG_BUTTON_COUNT] = {
- [BUTTON_VOLUME_DOWN] = {"Volume Down", KEYBOARD_BUTTON_VOLUME_DOWN,
- GPIO_VOLUME_DOWN_L, 30 * MSEC, 0},
- [BUTTON_VOLUME_UP] = {"Volume Up", KEYBOARD_BUTTON_VOLUME_UP,
- GPIO_VOLUME_UP_L, 30 * MSEC, 0},
-};
-
const struct button_config *recovery_buttons[] = {
&buttons[BUTTON_VOLUME_DOWN],
&buttons[BUTTON_VOLUME_UP],
diff --git a/board/rainier/board.h b/board/rainier/board.h
index 8c67257695..4b6e4fb97a 100644
--- a/board/rainier/board.h
+++ b/board/rainier/board.h
@@ -43,7 +43,6 @@
#define CONFIG_BOARD_PRE_INIT
#define CONFIG_BOARD_SPECIFIC_VERSION
#define CONFIG_BOARD_VERSION
-#define CONFIG_BUTTON_COUNT 2
#define CONFIG_BUTTON_RECOVERY
#define CONFIG_CHARGER_ILIM_PIN_DISABLED
#define CONFIG_FORCE_CONSOLE_RESUME
@@ -59,6 +58,7 @@
#define CONFIG_POWER_TRACK_HOST_SLEEP_STATE
#define CONFIG_SOFTWARE_PANIC
#define CONFIG_VBOOT_HASH
+#define CONFIG_VOLUME_BUTTONS
#define CONFIG_USB_MUX_VIRTUAL
@@ -142,12 +142,6 @@ enum adc_channel {
ADC_CH_COUNT
};
-enum button {
- BUTTON_VOLUME_DOWN = 0,
- BUTTON_VOLUME_UP = 1,
- BUTTON_COUNT
-};
-
/* power signal definitions */
enum power_signal {
PP1250_S3_PWR_GOOD = 0,