diff options
author | Wai-Hong Tam <waihong@google.com> | 2020-03-17 11:46:25 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-08 05:33:18 +0000 |
commit | 974de474ad4c4c86721ae6c4448875b85dc3234b (patch) | |
tree | ffb277505a96ef8de7a9eb16ae037a43c12ca2c5 /board/servo_v4/board.c | |
parent | acce53e2ea4eb248a816f868a5b3817bbd4f83a0 (diff) | |
download | chrome-ec-974de474ad4c4c86721ae6c4448875b85dc3234b.tar.gz |
servo_v4: Add console commands to override the HPD pass-through
New console commands, like:
> usbc_action dp hpd ext # use the external HPD, no overridden
> usbc_action dp hpd h # override HPD to high, IRQ pass-through
> usbc_action dp hpd l # override HPD to low, no IRQ pass-through
> usbc_action dp hpd irq # send HPD IRQ
BRANCH=servo
BUG=b:153647984
TEST=Tried the new console commands.
Change-Id: I197efd1d03d906b99d7b82ad151865da44e321ea
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2143937
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board/servo_v4/board.c')
-rw-r--r-- | board/servo_v4/board.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/board/servo_v4/board.c b/board/servo_v4/board.c index 5dc2b18ed5..559b9bb5b0 100644 --- a/board/servo_v4/board.c +++ b/board/servo_v4/board.c @@ -469,18 +469,24 @@ static void ccd_measure_sbu(void) hook_call_deferred(&ccd_measure_sbu_data, 100 * MSEC); } -void ccd_enable(int enable) +void ext_hpd_detection_enable(int enable) { if (enable) { - gpio_disable_interrupt(GPIO_DP_HPD); - hook_call_deferred(&ccd_measure_sbu_data, 0); - } else { timestamp_t now = get_time(); hpd_prev_level = gpio_get_level(GPIO_DP_HPD); hpd_prev_ts = now.val; gpio_enable_interrupt(GPIO_DP_HPD); + } else { + gpio_disable_interrupt(GPIO_DP_HPD); + } +} +void ccd_enable(int enable) +{ + if (enable) { + hook_call_deferred(&ccd_measure_sbu_data, 0); + } else { gpio_set_level(GPIO_SBU_MUX_EN, 0); hook_call_deferred(&ccd_measure_sbu_data, -1); } |