diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2022-05-23 12:29:26 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-05-26 22:17:52 +0000 |
commit | e7ba53ffc045ec6a152674e15e48d51a09d675d6 (patch) | |
tree | 600b4980d4b0ff8b0f3bf79e4f0661ff10bcc7b3 /include/typec_control.h | |
parent | 7ad7c9c9ca974dfbaa3e82337d38523b2385cd31 (diff) | |
download | chrome-ec-e7ba53ffc045ec6a152674e15e48d51a09d675d6.tar.gz |
usbc: cleanup: Abstract the TCPM control logic
Abstract the TCPM control logic to support various combinations
of TCPC chips that support built in PPC and OCP.
BUG=none
BRANCH=none
TEST=make buildall -j, zmake testall
Change-Id: I614797829d1d8f230439a70c1822c918f9fea1f3
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3661521
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include/typec_control.h')
-rw-r--r-- | include/typec_control.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/typec_control.h b/include/typec_control.h new file mode 100644 index 0000000000..b162467663 --- /dev/null +++ b/include/typec_control.h @@ -0,0 +1,46 @@ +/* Copyright 2022 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. + */ + +/* Type-C control logic header */ + +#ifndef __CROS_EC_TYPEC_CONTROL_H +#define __CROS_EC_TYPEC_CONTROL_H + +#include "usb_pd_tcpm.h" + +/** + * Sets the polarity of the port + * + * @param port USB-C port number + * @param polarity Polarity of CC lines + */ +void typec_set_polarity(int port, enum tcpc_cc_polarity polarity); + +/** + * Turn on/off the SBU FETs. + * + * @param port USB-C port number + * @param enable true:enable, false:disable + */ +void typec_set_sbu(int port, bool enable); + +/** + * Set the type-C current limit when sourcing current + * + * @param port USB-C port number + * @param rp Pull-up values to be aplied as a SRC to advertise current limits + */ +__override_proto void typec_set_source_current_limit(int port, + enum tcpc_rp_value rp); + +/** + * Turn on/off the VCONN FET + * + * @param port USB-C port number + * @param enable true:enable, false:disable + */ +void typec_set_vconn(int port, bool enable); + +#endif /* __CROS_EC_TYPEC_CONTROL_H */ |