diff options
author | Denis Brockus <dbrockus@chromium.org> | 2019-11-27 11:03:16 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-05 20:58:28 +0000 |
commit | 3dd62a63e18927d6f9c87fef6b5160d3f49d88d7 (patch) | |
tree | 416ea77919ba5bd4c1b277c2d92795ca4590c612 /include | |
parent | bf0057e2bff9a68dc9a9f00d660193143d8233c0 (diff) | |
download | chrome-ec-3dd62a63e18927d6f9c87fef6b5160d3f49d88d7.tar.gz |
tcpci: POWER_CTRL auto discharge disconnect init
Change TCPCI to use HOOK_USB_PD_CONNECT/DISCONNECT to
set/clear TCPC_REG_POWER_CTRL_AUTO_DISCHARGE_DISCONNECT
according to the TCPCI spec.
Change the definition of HOOK_USB_PD_CONNECT to occur
after CC and VBus are stable.
BUG=b:144126745,chromium:951683
BRANCH=none
TEST=Charger attach/pull with AP not running
Change-Id: I625efbba80f190322e3e92de6318b710b3ce7ade
Signed-off-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1940777
Diffstat (limited to 'include')
-rw-r--r-- | include/hooks.h | 2 | ||||
-rw-r--r-- | include/usb_pd_tcpm.h | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/hooks.h b/include/hooks.h index e30c420fbb..5c699f9555 100644 --- a/include/hooks.h +++ b/include/hooks.h @@ -216,6 +216,8 @@ enum hook_type { /* * USB PD cc connection event. + * + * CC lines and VBus are stable when this hook is called. */ HOOK_USB_PD_CONNECT, }; diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h index ab70c9a7f7..7a7bd0b3a1 100644 --- a/include/usb_pd_tcpm.h +++ b/include/usb_pd_tcpm.h @@ -266,6 +266,15 @@ struct tcpm_drv { */ void (*tcpc_discharge_vbus)(int port, int enable); + /** + * Connection State Change + * + * @param port Type-C port number + * @param connected Connection state + */ + void (*tcpc_connect_state_change)(int port, + int connected); + #ifdef CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE /** * Enable TCPC auto DRP toggling. |