diff --git a/board/glkrvp/board.c b/board/glkrvp/board.c index 7170c47d0f..1a1fcb42a3 100644 --- a/board/glkrvp/board.c +++ b/board/glkrvp/board.c @@ -5,6 +5,7 @@ /* Intel GLK-RVP board-specific configuration */ +#include "button.h" #include "chipset.h" #include "console.h" #include "extpower.h" @@ -71,6 +72,24 @@ 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] = { + { + .name = "Volume Up", + .type = KEYBOARD_BUTTON_VOLUME_UP, + .gpio = GPIO_EC_VOLUP_BTN_ODL, + .debounce_us = 30 * MSEC, + .flags = 0, + }, + { + .name = "Volume Down", + .type = KEYBOARD_BUTTON_VOLUME_DOWN, + .gpio = GPIO_EC_VOLDN_BTN_ODL, + .debounce_us = 30 * MSEC, + .flags = 0, + }, +}; +BUILD_ASSERT(ARRAY_SIZE(buttons) == CONFIG_BUTTON_COUNT); + /* Called by APL power state machine when transitioning from G3 to S5 */ static void chipset_pre_init(void) { diff --git a/board/glkrvp/board.h b/board/glkrvp/board.h index 32a7b8793d..d76ca49706 100644 --- a/board/glkrvp/board.h +++ b/board/glkrvp/board.h @@ -84,6 +84,7 @@ /* EC */ #define CONFIG_BOARD_VERSION #define CONFIG_BOARD_SPECIFIC_VERSION +#define CONFIG_BUTTON_COUNT 2 #define CONFIG_WP_ALWAYS #define CONFIG_I2C #define CONFIG_I2C_MASTER diff --git a/board/glkrvp/gpio.inc b/board/glkrvp/gpio.inc index 475fa238bd..2571c57a2f 100644 --- a/board/glkrvp/gpio.inc +++ b/board/glkrvp/gpio.inc @@ -22,6 +22,8 @@ GPIO_INT(AC_PRESENT, PIN(D, 2), GPIO_INT_BOTH, extpower_interrupt) /* ACOK_OD GPIO_INT(WP_L, PIN(9, 3), GPIO_INT_BOTH | GPIO_SEL_1P8V, switch_interrupt) /* EC_WP_ODL */ GPIO_INT(USB_C0_PD_INT_ODL, PIN(6, 2), GPIO_INT_FALLING, tcpc_alert_event) GPIO_INT(USB_C1_PD_INT_ODL, PIN(6, 3), GPIO_INT_FALLING, tcpc_alert_event) +GPIO_INT(EC_VOLUP_BTN_ODL, PIN(3, 4), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) +GPIO_INT(EC_VOLDN_BTN_ODL, PIN(3, 7), GPIO_INT_BOTH | GPIO_PULL_UP, button_interrupt) GPIO(PCH_SMI_L, PIN(C, 6), GPIO_ODR_HIGH) /* EC_SMI_ODL */ GPIO(PCH_SCI_L, PIN(7, 6), GPIO_ODR_HIGH) /* EC_SCI_ODL */ @@ -66,9 +68,6 @@ UNIMPLEMENTED(USB_C1_5V_EN) GPIO(NC_02, PIN(0, 2), GPIO_INPUT) GPIO(NC_04, PIN(0, 4), GPIO_INPUT) -GPIO(NC_34, PIN(3, 4), GPIO_INPUT) -GPIO(NC_37, PIN(3, 7), GPIO_INPUT) - GPIO(NC_41, PIN(4, 1), GPIO_INPUT) GPIO(NC_42, PIN(4, 2), GPIO_INPUT)