summaryrefslogtreecommitdiff
path: root/common/host_command_pd.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-09-06 22:37:15 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-09-17 01:24:25 +0000
commiteff864775f25f16480955ebde7234219c6e03948 (patch)
treed4abaf804d6778885004c0423cbda45856569c55 /common/host_command_pd.c
parentf0274df3db491c207413db35319eb72b35874b21 (diff)
downloadchrome-ec-eff864775f25f16480955ebde7234219c6e03948.tar.gz
samus: exchange status with PD MCU on boot
On boot, the EC should send host command to exchange status with PD MCU. This allows EC to get the correct input current limit when EC reboots and PD does not. Also had to move some of the charger state machine initialization to run with HOOK_INIT so that it runs before the tasks run. BUG=none BRANCH=none TEST=tested on EVT samus. Without this change, if you reboot EC, and run charger command, the charger input current limit is 512mA. with this change, when the EC reboots, it sends host command to PD MCU to get current limit and sets it appropriately. Change-Id: I5426f0fc3a62b6cd7a73f55cb11b895902a54903 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/216879 Reviewed-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'common/host_command_pd.c')
-rw-r--r--common/host_command_pd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/host_command_pd.c b/common/host_command_pd.c
index 444e9e3288..252ade01b7 100644
--- a/common/host_command_pd.c
+++ b/common/host_command_pd.c
@@ -56,6 +56,8 @@ static void pd_exchange_status(void)
void pd_command_task(void)
{
+ /* On startup exchange status with the PD */
+ pd_exchange_status();
while (1) {
/* Wait for the next command event */