summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@google.com>2020-07-27 12:53:31 -0600
committerCommit Bot <commit-bot@chromium.org>2020-07-28 05:24:13 +0000
commitea077cccd9e5cf25176ab9082be438ac26823126 (patch)
tree9694b14a57bc46841b452a00a8d2f9c4247959b9 /include
parent9fadd40cebcd179aebf1b12b6fbc0080e71420bc (diff)
downloadchrome-ec-ea077cccd9e5cf25176ab9082be438ac26823126.tar.gz
AOZ1380: initialize srcing/snking flags to reflect hardware
The AOZ1380 always started off with not sinking and not sourcing. In a batteryless or dead battery condition this is not true. So making sure we start with an accurate state. BUG=b:162016100 BRANCH=none TEST=trembyle cold boot with only AC power Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ic542e52b3b8d715b7526e7e393ae4f4c40c721ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2321132 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd_tcpm.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 910a44d792..b039c6f63e 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -361,6 +361,17 @@ struct tcpm_drv {
#ifdef CONFIG_USBC_PPC
/**
+ * Request current sinking state of the TCPC
+ * NOTE: this is most useful for PPCs that can not tell on their own
+ *
+ * @param port Type-C port number
+ * @param is_sinking true for sinking, false for not
+ *
+ * @return EC_SUCCESS, EC_ERROR_UNIMPLEMENTED or error
+ */
+ int (*get_snk_ctrl)(int port, bool *sinking);
+
+ /**
* Send SinkVBUS or DisableSinkVBUS command
*
* @param port Type-C port number
@@ -371,6 +382,17 @@ struct tcpm_drv {
int (*set_snk_ctrl)(int port, int enable);
/**
+ * Request current sourcing state of the TCPC
+ * NOTE: this is most useful for PPCs that can not tell on their own
+ *
+ * @param port Type-C port number
+ * @param is_sourcing true for sourcing, false for not
+ *
+ * @return EC_SUCCESS, EC_ERROR_UNIMPLEMENTED or error
+ */
+ int (*get_src_ctrl)(int port, bool *sourcing);
+
+ /**
* Send SourceVBUS or DisableSourceVBUS command
*
* @param port Type-C port number