summaryrefslogtreecommitdiff
path: root/common/extpower_gpio.c
diff options
context:
space:
mode:
authorDavid Hendricks <dhendrix@chromium.org>2016-08-30 18:03:35 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-02 07:11:33 -0700
commit74e60906c4c2d4c3520d3ea221c232b5f29b7e0d (patch)
treec07e38972a89c21357e336397fd6bcef4ce9f6ef /common/extpower_gpio.c
parent6910f907a6384cf94e58927fa1b1221ba84ebe1a (diff)
downloadchrome-ec-74e60906c4c2d4c3520d3ea221c232b5f29b7e0d.tar.gz
extpower: Allow board to override signal debounce time
This is for boards on which AC_PRESENT can be expected to fluctuate over a much longer period than the code was originally designed for. Specifically, USB-PD systems may require several hundred milliseconds for the state machine to settle before making decisions based on AC_PRESENT status, for example, changing LED state. BUG=chrome-os-partner:56471 BRANCH=none TEST=Tested on Reef with follow-up patch Change-Id: I370048cb79d1593a14077563ec8db8e8282afb16 Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/378755
Diffstat (limited to 'common/extpower_gpio.c')
-rw-r--r--common/extpower_gpio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/extpower_gpio.c b/common/extpower_gpio.c
index 569d674157..c9e62b71e2 100644
--- a/common/extpower_gpio.c
+++ b/common/extpower_gpio.c
@@ -12,8 +12,6 @@
#include "host_command.h"
#include "timer.h"
-#define EXTPOWER_DEBOUNCE_US (30 * MSEC)
-
static int debounced_extpower_presence;
int extpower_is_present(void)
@@ -45,7 +43,8 @@ DECLARE_DEFERRED(extpower_deferred);
void extpower_interrupt(enum gpio_signal signal)
{
/* Trigger deferred notification of external power change */
- hook_call_deferred(&extpower_deferred_data, EXTPOWER_DEBOUNCE_US);
+ hook_call_deferred(&extpower_deferred_data,
+ CONFIG_EXTPOWER_DEBOUNCE_MS * MSEC);
}
static void extpower_init(void)