summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2019-04-11 10:46:45 -0600
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-04-16 15:04:40 +0000
commit290f16a3a0361e7e42938b4f17b63f57924d9c21 (patch)
treea44c9bf4010b60358284cded94318c217d93eb8f
parent0033e4ca695ed4dc42d34f8c2fe686167ebd1959 (diff)
downloadchrome-ec-290f16a3a0361e7e42938b4f17b63f57924d9c21.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> (cherry picked from commit 7b01a7716c33c4c01907acc88adba7cc1c15199e) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1568885 Tested-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com>
-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 a99e50e695..ea4183c247 100644
--- a/driver/tcpm/tcpci.c
+++ b/driver/tcpm/tcpci.c
@@ -707,6 +707,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;