oak: use pdcmd task to handle tcpc interrupt

This change syncs oak with glados change CL:275296.

BRANCH=none
BUG=chrome-os-partner:41167
TEST=manual
  load on oak and plug zinger in both ports many times.

Change-Id: Idc00a50c2d7b7a865e70762e91b2e7a82c6e6896
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275852
Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
Rong Chang
2015-06-08 20:16:10 +08:00
committed by ChromeOS Commit Bot
parent 483eba41c1
commit ffd83ca8e9
2 changed files with 18 additions and 1 deletions

View File

@@ -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"

View File

@@ -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));