diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-06-04 11:30:34 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-05 22:35:05 +0000 |
commit | 58719e30730e6420533514dabd27c188e60ae607 (patch) | |
tree | 8015dd22c5808e88b648cd52463bf59a34b0a734 /board/glados_pd/board.c | |
parent | bdc680d8ed7ea24cdfb1b5498f73a1008c71ad37 (diff) | |
download | chrome-ec-58719e30730e6420533514dabd27c188e60ae607.tar.gz |
pd: use pdcmd task to handle tcpc interrupt
Use the PDCMD task to handle PD MCU interrupts, and use it
to trigger the tcpc_alert().
Note this fixes bug on Glados and Oak that could cause watchdog
reset because tcpc_alert() which uses i2c to talk to tcpc was
called from hooks task and can delay tickling watchdog.
BUG=chrome-os-partner:40920
BRANCH=none
TEST=load on glados and plug zinger into both ports many times.
make sure we get a stable contract and no watchdog reset.
Change-Id: I37625fae2ca0057d2ee8fa1eea6974f2d26d1b91
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/275296
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'board/glados_pd/board.c')
-rw-r--r-- | board/glados_pd/board.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/board/glados_pd/board.c b/board/glados_pd/board.c index da6fc82525..776e30a29b 100644 --- a/board/glados_pd/board.c +++ b/board/glados_pd/board.c @@ -101,3 +101,20 @@ 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)); + |