summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-04-20 17:44:38 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-05-12 18:46:14 -0700
commit05a8637ca0f5118da1af8d14d460d210cc2665b3 (patch)
tree1648fde091772f8def8ab37ff75aed60f6cf6ca3
parent70f2088b41cb540f29fef24acf149746b39822af (diff)
downloadchrome-ec-05a8637ca0f5118da1af8d14d460d210cc2665b3.tar.gz
Fizz: Add recovery button
Cr50 masks the recovery button signal on a proto board when the power button is being pressed (b:37682117). This bug has to be fixed for the recovery button to work. BUG=b:37274183 BRANCH=none TEST=make buildall Change-Id: Ia413ffce84d67b6f24f983ccce8ae8277452ac2c Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/494069 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/fizz/board.c15
-rw-r--r--board/fizz/board.h7
-rw-r--r--board/fizz/gpio.inc2
-rw-r--r--include/button.h1
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,