summaryrefslogtreecommitdiff
path: root/board/coachz
diff options
context:
space:
mode:
authorhegang5 <hegang5@huaqin.corp-partner.google.com>2021-01-19 21:01:51 +0800
committerCommit Bot <commit-bot@chromium.org>2021-01-20 11:19:38 +0000
commitb2c274f2ddece5c41912621b74d31fdc8384c8f8 (patch)
tree0475afc0023b39d09e51e717001e96ce932dffed /board/coachz
parent8014ff8ddf2658fb82ef38a43c7114ee7a202564 (diff)
downloadchrome-ec-b2c274f2ddece5c41912621b74d31fdc8384c8f8.tar.gz
Coachz: Add BASE_EN debounce time to 350ms
Add BASE_EN debounce time to meet TP reset sequence BRANCH=master BUG=b:176398060 TEST=make BOARD=coachz -j flash ec and check BASE_EN delay time Signed-off-by: hegang5 <hegang5@huaqin.corp-partner.google.com> Change-Id: I04fb80d9f44a56bbf52dc089406ab0bd4fc2cd16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637166 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'board/coachz')
-rw-r--r--board/coachz/base_detect.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/board/coachz/base_detect.c b/board/coachz/base_detect.c
index ae485dc5ee..6295ccb39d 100644
--- a/board/coachz/base_detect.c
+++ b/board/coachz/base_detect.c
@@ -23,7 +23,8 @@
#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args)
/* Base detection and debouncing */
-#define BASE_DETECT_DEBOUNCE_US (20 * MSEC)
+#define BASE_DETECT_EN_DEBOUNCE_US (350 * MSEC)
+#define BASE_DETECT_DIS_DEBOUNCE_US (20 * MSEC)
/*
* If the base status is unclear (i.e. not within expected ranges, read
@@ -142,7 +143,13 @@ static inline int detect_pin_connected(enum gpio_signal det_pin)
void base_detect_interrupt(enum gpio_signal signal)
{
uint64_t time_now = get_time().val;
-
+ int debounce_us;
+
+ if (detect_pin_connected(signal))
+ debounce_us = BASE_DETECT_EN_DEBOUNCE_US;
+ else
+ debounce_us = BASE_DETECT_DIS_DEBOUNCE_US;
+
if (base_detect_debounce_time <= time_now) {
/*
* Detect and measure detection pin pulse, when base is
@@ -158,8 +165,7 @@ void base_detect_interrupt(enum gpio_signal signal)
}
pulse_width = 0;
- hook_call_deferred(&base_detect_deferred_data,
- BASE_DETECT_DEBOUNCE_US);
+ hook_call_deferred(&base_detect_deferred_data, debounce_us);
} else {
if (current_base_status == BASE_CONNECTED &&
detect_pin_connected(signal) && !pulse_width &&
@@ -172,7 +178,7 @@ void base_detect_interrupt(enum gpio_signal signal)
}
}
- base_detect_debounce_time = time_now + BASE_DETECT_DEBOUNCE_US;
+ base_detect_debounce_time = time_now + debounce_us;
}
static void base_enable(void)