diff --git a/board/oak/board.c b/board/oak/board.c index 70cb91de7a..f8c2408a45 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -67,7 +67,8 @@ void vbus_wake_interrupt(enum gpio_signal signal) void pd_mcu_interrupt(enum gpio_signal signal) { - hook_call_deferred(tcpc_alert, 0); + /* Exchange status with PD MCU to determin interrupt cause */ + host_command_pd_send_status(0); } #include "gpio_list.h" diff --git a/board/oak_pd/board.c b/board/oak_pd/board.c index a29d143054..8d346661b5 100644 --- a/board/oak_pd/board.c +++ b/board/oak_pd/board.c @@ -103,3 +103,19 @@ DECLARE_CONSOLE_COMMAND(ecint, command_ec_int, "Toggle EC interrupt line", NULL); +static int ec_status_host_cmd(struct host_cmd_handler_args *args) +{ + struct ec_response_pd_status *r = args->response; + + /* + * TODO: use state here to notify EC of host events, tcpc port + * 0 alert and tcpc port 1 alert. + */ + r->status = 0; + args->response_size = sizeof(*r); + + return EC_RES_SUCCESS; +} +DECLARE_HOST_COMMAND(EC_CMD_PD_EXCHANGE_STATUS, ec_status_host_cmd, + EC_VER_MASK(1)); +