diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-08-20 18:07:33 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-08-27 01:29:58 +0000 |
commit | 1933fb8ff70ec725cbb4d960de5cc23d682acb78 (patch) | |
tree | 3c23f0f3e85194bdb5b156b4da911d799e6bf85b /common/host_command_pd.c | |
parent | e913bc15b8a631757b362da09fc1385a7f509def (diff) | |
download | chrome-ec-1933fb8ff70ec725cbb4d960de5cc23d682acb78.tar.gz |
samus: add ability for PD MCU to send host event to AP
Add host event for PD up to AP. The PD toggles a gpio line to
EC causing an interrupt on EC. The EC then sends host command
down to PD MCU to get its status. There is a new status bit for
PD host event, so when EC see's the PD host event status bit,
it sends a PD host event to the AP.
There is currently only one host event for PD to AP.
BUG=chrome-os-partner:31361
BRANCH=none
TEST=added PD console command pdevent, which initiates the host
event. when sent, verified on EC that it sets the correct host
event bit using hostevent console command
Change-Id: If1a59a3232e2f9a49f272c6dee5319254d87b9a9
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/213371
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/host_command_pd.c')
-rw-r--r-- | common/host_command_pd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/host_command_pd.c b/common/host_command_pd.c index 5f57c83305..467dc07dd7 100644 --- a/common/host_command_pd.c +++ b/common/host_command_pd.c @@ -54,6 +54,10 @@ static void pd_exchange_status(void) CONFIG_CHARGER_INPUT_CURRENT)); if (rv < 0) CPRINTS("Failed to set input current limit from PD MCU"); + + /* If PD is signalling host event, then pass it up to AP */ + if (pd_status.status | PD_STATUS_HOST_EVENT) + host_set_single_event(EC_HOST_EVENT_PD_MCU); } void pd_command_task(void) |