summaryrefslogtreecommitdiff
path: root/common/usb_common.c
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-04-21 20:15:33 -0700
committerCommit Bot <commit-bot@chromium.org>2020-04-23 03:08:01 +0000
commit333df910313489744af4087d7bf6759f68359267 (patch)
treed3bd0346f4cc159f0cc94ee8b11a89ff8a3441a8 /common/usb_common.c
parentd7d96bd08c822a99c68dfb72469d0f408c89bb96 (diff)
downloadchrome-ec-333df910313489744af4087d7bf6759f68359267.tar.gz
tcpci: Add trigger for VBUS presence changes
Some boards don't have a direct interrupt indicating ACOK, but the TCPC can provide this notification via the POWER_STATUS register. This commit adds a lightweight trigger which calls board_vbus_presence_change() whenever the TCPC gets a POWER_STATUS alert. The default implementation does nothing, but a board may override it to make it useful. BUG=b:154113446,b:154113465 BRANCH=None TEST=Add override for waddledoo. Build and flash waddledoo, plug in AC, verify that "AC on" prints are seen. Unplug AC, verify that "AC off" prints are seen. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I6ab1a2649c12a0525502eac6baab2e1b31168212 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2159941 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/usb_common.c')
-rw-r--r--common/usb_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/usb_common.c b/common/usb_common.c
index 588493b823..67db582f4f 100644
--- a/common/usb_common.c
+++ b/common/usb_common.c
@@ -36,6 +36,10 @@
#define CPRINTF(format, args...)
#endif
+__overridable void board_vbus_present_change(void)
+{
+}
+
#if defined(CONFIG_CMD_PD) && defined(CONFIG_CMD_PD_FLASH)
int hex8tou32(char *str, uint32_t *val)
{