summaryrefslogtreecommitdiff
path: root/include/typec_control.h
blob: b16246766376475b019e9ef53db5a5fcc36ceb7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 */