summaryrefslogtreecommitdiff
path: root/include/usbc_ppc.h
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-12-08 14:56:55 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-13 22:33:22 -0800
commit755517e2cfc213936107c60768455fd90748d75e (patch)
treeda8241abbb58390eab4b25e78c364eff664bfcb0 /include/usbc_ppc.h
parente167d36b75ab13892abaf865860a6674a5a09b59 (diff)
downloadchrome-ec-755517e2cfc213936107c60768455fd90748d75e.tar.gz
ppc: Add API to set Vbus source ILIM.
The PPC needs to update its Vbus source current limits whenever our policy changes on the PD ports. This commit simply adds and API to do so. BUG=None BRANCH=None TEST=With some extra code to enable 3A out, flash zoombini; Plug in a PD device to a port, verify that it gets 5V @ 3A. Plug in a second device, verify that we re-send new source caps of 5V @ 1.5A. TEST=Repeat above for meowth. Change-Id: Ifa4bc8b7df87f7730f2bcded842906d43171394b Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/818335 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/usbc_ppc.h')
-rw-r--r--include/usbc_ppc.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/usbc_ppc.h b/include/usbc_ppc.h
index 83fac5cad9..9fc8e61f91 100644
--- a/include/usbc_ppc.h
+++ b/include/usbc_ppc.h
@@ -7,6 +7,7 @@
#define __CROS_EC_USBC_PPC_H
#include "common.h"
+#include "usb_pd_tcpm.h"
/* Common APIs for USB Type-C Power Path Controllers (PPC) */
@@ -47,6 +48,15 @@ struct ppc_drv {
*/
int (*vbus_source_enable)(int port, int enable);
+ /**
+ * Set the Vbus source path current limit
+ *
+ * @param port: The Type-C port number.
+ * @param rp: The Rp value which to approximately set the current limit.
+ * @return EC_SUCCESS on success, error otherwise.
+ */
+ int (*set_vbus_source_current_limit)(int port, enum tcpc_rp_value rp);
+
#ifdef CONFIG_CMD_PPC_DUMP
/**
* Perform a register dump of the PPC.
@@ -104,6 +114,15 @@ int ppc_is_vbus_present(int port, int *vbus_present);
int ppc_is_sourcing_vbus(int port);
/**
+ * Set the Vbus source path current limit
+ *
+ * @param port: The Type-C port number.
+ * @param rp: The Rp value which to approximately set the current limit.
+ * @return EC_SUCCESS on success, error otherwise.
+ */
+int ppc_set_vbus_source_current_limit(int port, enum tcpc_rp_value rp);
+
+/**
* Turn on/off the charge path FET, such that current flows into the
* system.
*