summaryrefslogtreecommitdiff
path: root/include/usbc_ppc.h
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-11-27 11:11:14 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-12-05 22:43:45 -0800
commit9c4008e35c291017c7a0ffbe96e1e5d9df8a0e5a (patch)
treebe29cf3f63098c673b122425c09521816dea318a /include/usbc_ppc.h
parent9300c0d470f3d266465731b941075f6d0a321636 (diff)
downloadchrome-ec-9c4008e35c291017c7a0ffbe96e1e5d9df8a0e5a.tar.gz
ppc: Add common APIs.
It'll be easier to add support for new PPCs if we make a generic API. BUG=None BRANCH=None TEST=make -j buildall Change-Id: I9aac1750eb4c163eb2b94aa8975c797f86d0a25a Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/791499 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.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/usbc_ppc.h b/include/usbc_ppc.h
new file mode 100644
index 0000000000..0af3e766e3
--- /dev/null
+++ b/include/usbc_ppc.h
@@ -0,0 +1,40 @@
+/* Copyright 2017 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_USBC_PPC_H
+#define __CROS_EC_USBC_PPC_H
+
+#include "common.h"
+
+
+/* Common APIs for USB Type-C Power Path Controllers (PPC) */
+
+/**
+ * Is the port sourcing Vbus?
+ *
+ * @param port: The type c port.
+ * @return 1 if sourcing Vbus, 0 if not.
+ */
+int ppc_is_sourcing_vbus(int port);
+
+/**
+ * Allow current to flow into the system.
+ *
+ * @param port: The Type-C port's FET to open.
+ * @param enable: 1: Turn on the FET, 0: turn off the FET.
+ * @return EC_SUCCESS on success, error otherwise.
+ */
+int ppc_vbus_sink_enable(int port, int enable);
+
+/**
+ * Allow current out of the system.
+ *
+ * @param port: The Type-C port's FET to open.
+ * @param enable: 1: Turn on the FET, 0: turn off the FET.
+ * @return EC_SUCCESS on success, error otherwise.
+ */
+int ppc_vbus_source_enable(int port, int enable);
+
+#endif /* !defined(__CROS_EC_USBC_PPC_H) */