diff options
author | Diana Z <dzigterman@chromium.org> | 2021-04-02 16:25:51 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-06 18:00:28 +0000 |
commit | e820abf4090c36067d9f1ad85d6ea6b41c0063c0 (patch) | |
tree | 07e9595bb802427d1c36f7404124bc3b93dc67c0 | |
parent | 42a750d21c2fd2dcc33d24c0a03c2800a1ceccbc (diff) | |
download | chrome-ec-e820abf4090c36067d9f1ad85d6ea6b41c0063c0.tar.gz |
PD_INT: Add ability to process non-TCPC alerts in PD_INT
Some boards may have other chips sharing the TCPC interrupt line, in
which case their alerts may need to be handled at the same priority as
the TCPC itself. Otherwise, it becomes difficult to respond quickly to
TCPC interrupts.
BRANCH=None
BUG=b:182534117,b:183679237
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I905f20eeb0dd89c8516de31005d402a890906595
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2803460
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r-- | common/usbc_intr_task.c | 10 | ||||
-rw-r--r-- | include/usb_pd.h | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/common/usbc_intr_task.c b/common/usbc_intr_task.c index 7470696c18..aa5242a5d5 100644 --- a/common/usbc_intr_task.c +++ b/common/usbc_intr_task.c @@ -70,8 +70,14 @@ static void service_one_port(int port) } } +__overridable void board_process_pd_alert(int port) +{ +} + /* - * Main task entry point that handles PD interrupts for a single port + * Main task entry point that handles PD interrupts for a single port. These + * interrupts usually come from a TCPC, but may also come from PD-related chips + * sharing the TCPC interrupt line. * * @param p The PD port number for which to handle interrupts (pointer is * reinterpreted as an integer directly). @@ -112,6 +118,8 @@ void pd_interrupt_handler_task(void *p) service_one_port(port); } + + board_process_pd_alert(port); } } diff --git a/include/usb_pd.h b/include/usb_pd.h index 3337a9aa5c..e4ba46dc39 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -3048,6 +3048,13 @@ __override_proto uint8_t board_get_usb_pd_port_count(void); __override_proto bool board_is_usb_pd_port_present(int port); /** + * Process PD-related alerts for a chip which is sharing the TCPC interrupt line + * + * @param port USB-C port number + */ +__override_proto void board_process_pd_alert(int port); + +/** * Resets external PD chips including TCPCs and MCUs. * * Boards must provide this when PDCMD (PD MCUs case) or PD INT (TCPC case) |