diff options
author | Aseda Aboagye <aaboagye@google.com> | 2017-11-15 22:23:00 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-11-17 20:18:38 -0800 |
commit | 34a97f50d5275f1fa2f1cb377683c96286b2421d (patch) | |
tree | 2ea62dc537426fb252123fb93b3b4f05db5f1443 /board/kevin | |
parent | f587852570770564e8a94b2c3f7ad7d97883c49a (diff) | |
download | chrome-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/kevin')
-rw-r--r-- | board/kevin/board.c | 7 | ||||
-rw-r--r-- | board/kevin/board.h | 2 |
2 files changed, 1 insertions, 8 deletions
diff --git a/board/kevin/board.c b/board/kevin/board.c index 6dadcd5c67..c7b0442c65 100644 --- a/board/kevin/board.c +++ b/board/kevin/board.c @@ -163,13 +163,6 @@ struct keyboard_scan_config keyscan_config = { }, }; -const struct button_config buttons[CONFIG_BUTTON_COUNT] = { - {"Volume Down", KEYBOARD_BUTTON_VOLUME_DOWN, GPIO_VOLUME_DOWN_L, - 30 * MSEC, 0}, - {"Volume Up", KEYBOARD_BUTTON_VOLUME_UP, GPIO_VOLUME_UP_L, - 30 * MSEC, 0}, -}; - const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { {I2C_PORT_TCPC0, FUSB302_I2C_SLAVE_ADDR, &fusb302_tcpm_drv}, {I2C_PORT_TCPC1, FUSB302_I2C_SLAVE_ADDR, &fusb302_tcpm_drv}, diff --git a/board/kevin/board.h b/board/kevin/board.h index 8b0eac980f..d0306c8c26 100644 --- a/board/kevin/board.h +++ b/board/kevin/board.h @@ -48,7 +48,6 @@ /* Optional features */ #define CONFIG_BOARD_VERSION #define CONFIG_BOARD_SPECIFIC_VERSION -#define CONFIG_BUTTON_COUNT 2 #define CONFIG_FLASH_SIZE 0x00080000 /* 512KB spi flash */ #define CONFIG_HOST_COMMAND_STATUS #define CONFIG_HOSTCMD_SECTION_SORTED /* Host commands are sorted. */ @@ -63,6 +62,7 @@ #define CONFIG_POWER_BUTTON #define CONFIG_POWER_TRACK_HOST_SLEEP_STATE #define CONFIG_VBOOT_HASH +#define CONFIG_VOLUME_BUTTONS #define CONFIG_CHARGER #define CONFIG_CHARGER_BD9995X |