diff options
author | Diana Z <dzigterman@chromium.org> | 2020-03-19 13:59:51 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-26 00:28:15 +0000 |
commit | 44a4f02980689e156c74161a32943b1a0b30ec0e (patch) | |
tree | 16e59ca95ab54693b608c08618ba5d6a4e82aaf0 | |
parent | f6a87936b224620c18b58f45af5ef1a42e116561 (diff) | |
download | chrome-ec-44a4f02980689e156c74161a32943b1a0b30ec0e.tar.gz |
USB: Make handling of CC overvoltage independent of PPCs
Boards may have CC overvoltage detection from other chips besides PPCs,
so this removes pd_handle_cc_overvoltage() from that constraint and uses
it on waddledee.
BUG=b:149094279
BRANCH=None
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: If197c4ea2308fe6113c134e6a7e293cb8a3e3c3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110974
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | board/waddledee/board.c | 2 | ||||
-rw-r--r-- | common/usb_common.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/board/waddledee/board.c b/board/waddledee/board.c index d25858c30c..19be66ccc1 100644 --- a/board/waddledee/board.c +++ b/board/waddledee/board.c @@ -51,7 +51,7 @@ static void usb_c1_interrupt(enum gpio_signal s) static void c0_ccsbu_ovp_interrupt(enum gpio_signal s) { cprints(CC_USBPD, "C0: CC OVP, SBU OVP, or thermal event"); - /*pd_handle_cc_overvoltage(0);*/ + pd_handle_cc_overvoltage(0); } /* Must come after other header files and interrupt handler declarations */ diff --git a/common/usb_common.c b/common/usb_common.c index 9f10e953e3..2a3ac922ed 100644 --- a/common/usb_common.c +++ b/common/usb_common.c @@ -417,13 +417,13 @@ void set_usb_mux_with_current_data_role(int port) } } -#ifdef CONFIG_USBC_PPC - static void pd_send_hard_reset(int port) { task_set_event(PD_PORT_TO_TASK_ID(port), PD_EVENT_SEND_HARD_RESET, 0); } +#ifdef CONFIG_USBC_PPC + static uint32_t port_oc_reset_req; static void re_enable_ports(void) @@ -469,13 +469,13 @@ void pd_handle_overcurrent(int port) hook_call_deferred(&re_enable_ports_data, SECOND); } -void pd_handle_cc_overvoltage(int port) +#endif /* CONFIG_USBC_PPC */ + +__maybe_unused void pd_handle_cc_overvoltage(int port) { pd_send_hard_reset(port); } -#endif /* CONFIG_USBC_PPC */ - __overridable int pd_board_checks(void) { return EC_SUCCESS; |