diff options
-rw-r--r-- | board/fizz/board.c | 15 | ||||
-rw-r--r-- | board/fizz/board.h | 7 | ||||
-rw-r--r-- | board/fizz/gpio.inc | 2 | ||||
-rw-r--r-- | include/button.h | 1 |
4 files changed, 24 insertions, 1 deletions
diff --git a/board/fizz/board.c b/board/fizz/board.c index 87221606ca..157b452e62 100644 --- a/board/fizz/board.c +++ b/board/fizz/board.c @@ -464,3 +464,18 @@ int board_is_consuming_full_charge(void) return chg_perc > 2 && chg_perc < 95; } + +const struct button_config buttons[CONFIG_BUTTON_COUNT] = { + [BUTTON_RECOVERY] = { + .name = "Recovery", + .type = KEYBOARD_BUTTON_RECOVERY, + .gpio = GPIO_RECOVERY_L, + .debounce_us = 30 * MSEC, + .flags = 0, + }, +}; + +const struct button_config *recovery_buttons[] = { + &buttons[BUTTON_RECOVERY], +}; +const int recovery_buttons_count = ARRAY_SIZE(recovery_buttons); diff --git a/board/fizz/board.h b/board/fizz/board.h index ce35934640..f723e89415 100644 --- a/board/fizz/board.h +++ b/board/fizz/board.h @@ -17,6 +17,8 @@ /* EC */ #define CONFIG_ADC #define CONFIG_BOARD_VERSION +#define CONFIG_BUTTON_COUNT 1 +#define CONFIG_BUTTON_RECOVERY #define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL #define CONFIG_DPTF #define CONFIG_FLASH_SIZE 0x80000 @@ -167,6 +169,11 @@ enum adc_channel { ADC_CH_COUNT }; +enum button { + BUTTON_RECOVERY = 0, + BUTTON_COUNT +}; + /* TODO(crosbug.com/p/61098): Verify the numbers below. */ /* * delay to turn on the power supply max is ~16ms. diff --git a/board/fizz/gpio.inc b/board/fizz/gpio.inc index c8ed8389f1..92ee2b1798 100644 --- a/board/fizz/gpio.inc +++ b/board/fizz/gpio.inc @@ -42,7 +42,7 @@ GPIO(PMIC_INT_L, PIN(6, 0), GPIO_INPUT) /* PMIC interrupt */ /* Fizz specific pins */ GPIO(LAN_PWR_EN, PIN(8, 3), GPIO_INPUT) /* Ethernet power enabled */ -GPIO(EC_RECOVERY_L, PIN(8, 2), GPIO_INPUT) /* Recovery button */ +GPIO(RECOVERY_L, PIN(8, 2), GPIO_INPUT) /* Recovery button */ GPIO(PWR_RED_LED, PIN(8, 0), GPIO_OUT_HIGH) /* Power Red LED */ GPIO(PWR_GRN_LED, PIN(B, 7), GPIO_OUT_HIGH) /* Power Green LED */ diff --git a/include/button.h b/include/button.h index 8909ba5f11..c542d44c47 100644 --- a/include/button.h +++ b/include/button.h @@ -17,6 +17,7 @@ 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, |