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/grunt | |
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/grunt')
-rw-r--r-- | board/grunt/board.c | 7 | ||||
-rw-r--r-- | board/grunt/board.h | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/board/grunt/board.c b/board/grunt/board.c index a8755e08c2..68d765dab4 100644 --- a/board/grunt/board.c +++ b/board/grunt/board.c @@ -72,13 +72,6 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); -const struct button_config buttons[CONFIG_BUTTON_COUNT] = { - {"Volume Down", KEYBOARD_BUTTON_VOLUME_DOWN, GPIO_VOLDN_BTN_ODL, - 30 * MSEC, 0}, - {"Volume Up", KEYBOARD_BUTTON_VOLUME_UP, GPIO_VOLUP_BTN_ODL, - 30 * MSEC, 0}, -}; - /* Keyboard scan setting */ struct keyboard_scan_config keyscan_config = { /* Extra delay when KSO2 is tied to Cr50. */ diff --git a/board/grunt/board.h b/board/grunt/board.h index bb15a7e0bf..8e20aaddeb 100644 --- a/board/grunt/board.h +++ b/board/grunt/board.h @@ -29,7 +29,6 @@ #define CONFIG_LPC #define CONFIG_BOARD_VERSION -#define CONFIG_BUTTON_COUNT 2 #define CONFIG_CHIPSET_STONEY #define CONFIG_CHIPSET_RESET_HOOK @@ -46,6 +45,10 @@ #define CONFIG_KEYBOARD_COL2_INVERTED #define CONFIG_KEYBOARD_PROTOCOL_8042 +#define CONFIG_VOLUME_BUTTONS +#define GPIO_VOLUME_DOWN_L GPIO_VOLDN_BTN_ODL +#define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL + #define I2C_PORT_BATTERY I2C_PORT_POWER #define I2C_PORT_POWER NPCX_I2C_PORT0_0 #define I2C_PORT_TCPC0 NPCX_I2C_PORT1_0 |