summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2019-04-11 10:46:45 -0600
committerchrome-bot <chrome-bot@chromium.org>2019-04-15 17:51:51 -0700
commit7b01a7716c33c4c01907acc88adba7cc1c15199e (patch)
tree747c536ddb221e83f6b4b2d950967780e56dc0e5
parent28d6be82e967db846cbd2329a9dff48e55770cb6 (diff)
downloadchrome-ec-7b01a7716c33c4c01907acc88adba7cc1c15199e.tar.gz
TCPC: Set charger vbus during init
For some chargers and TCPCs (specifically in this case, BC1.2 charger and ANX7447 combination), the TCPC will not supply a power status changed interrupt after waking from low power mode with the charger plugged in. In this case, we can use the Vbus presence during init in order to alert the charger task. BUG=b:130249342 BRANCH=octopus TEST=checked PD and BC1.2 chargers worked on both ports of phaser, verified they also worked over resets and sysjumps, both locked and unlocked Change-Id: Ie9c581a7b5a21c093a10d3e8d57cf27ac48fa138 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1565170 Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--driver/tcpm/tcpci.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/driver/tcpm/tcpci.c b/driver/tcpm/tcpci.c
index 59393a62a9..f9e5db929c 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -761,6 +761,13 @@ int tcpci_tcpm_init(int port)
/* Update VBUS status */
tcpc_vbus[port] = power_status &
TCPC_REG_POWER_STATUS_VBUS_PRES ? 1 : 0;
+#if defined(CONFIG_USB_PD_VBUS_DETECT_TCPC) && defined(CONFIG_USB_CHARGER)
+ /*
+ * Set Vbus change now in case the TCPC doesn't send a power status
+ * changed interrupt for it later.
+ */
+ usb_charger_vbus_change(port, tcpc_vbus[port]);
+#endif
error = init_alert_mask(port);
if (error)
return error;