Lines Matching +full:int +full:- +full:enum

3  * SPDX-License-Identifier: Apache-2.0
8 * @brief Helper functions to use by the TCPCI-compliant drivers
10 * This file contains generic TCPCI functions that may be used by the drivers to TCPCI-compliant
11 * devices that want to implement vendor-specific functionality without the need to reimplement the
38 * If the TCPC driver contain any vendor-specific registers, it may override the TCPCI dump_std_reg
45 * @brief Function to read the 8-bit register of TCPCI device
50 * @return int Status of I2C operation, 0 in case of success
52 int tcpci_read_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t *value);
55 * @brief Function to write a value to the 8-bit register of TCPCI device
60 * @return int Status of I2C operation, 0 in case of success
62 int tcpci_write_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t value);
65 * @brief Function to read and update part of the 8-bit register of TCPCI device
72 * @return int Status of I2C operation, 0 in case of success
74 int tcpci_update_reg8(const struct i2c_dt_spec *bus, uint8_t reg, uint8_t mask, uint8_t value);
77 * @brief Function to read the 16-bit register of TCPCI device
82 * @return int Status of I2C operation, 0 in case of success
84 int tcpci_read_reg16(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t *value);
87 * @brief Function to write a value to the 16-bit register of TCPCI device
92 * @return int Status of I2C operation, 0 in case of success
94 int tcpci_write_reg16(const struct i2c_dt_spec *bus, uint8_t reg, uint16_t value);
97 * @brief Function that converts the TCPCI alert register to the tcpc_alert enum
102 * @return enum tcpc_alert Value of one of the flags being set in the alert register
104 enum tcpc_alert tcpci_alert_reg_to_enum(uint16_t reg);
113 * @return -EINVAL if cc1 or cc2 pointer is NULL
114 * @return int Status of I2C operation, 0 in case of success
116 int tcpci_tcpm_get_cc(const struct i2c_dt_spec *bus, enum tc_cc_voltage_state *cc1,
117 enum tc_cc_voltage_state *cc2);
124 * @return int Status of I2C operation, 0 in case of success
126 int tcpci_tcpm_get_chip_info(const struct i2c_dt_spec *bus, struct tcpc_chip_info *chip_info);
132 * @return int Status of I2C operation, 0 in case of success
134 int tcpci_tcpm_dump_std_reg(const struct i2c_dt_spec *bus);
137 * @brief Function to enable or disable the BIST (Built-In Self-Test) mode.
141 * @return int Status of I2C operation, 0 in case of success
143 int tcpci_tcpm_set_bist_test_mode(const struct i2c_dt_spec *bus, bool enable);
152 * @return int Status of I2C operation, 0 in case of success
154 int tcpci_tcpm_transmit_data(const struct i2c_dt_spec *bus, struct pd_msg *msg,
158 * @brief Function to select the Rp (Pull-up Resistor) value.
161 * @param rp Enum representing the Rp value to be set
162 * @return int Status of I2C operation, 0 in case of success
164 int tcpci_tcpm_select_rp_value(const struct i2c_dt_spec *bus, enum tc_rp_value rp);
171 * @return int Status of I2C operation, 0 in case of success
173 int tcpci_tcpm_get_rp_value(const struct i2c_dt_spec *bus, enum tc_rp_value *rp);
179 * @param pull Enum representing the CC pull resistor to be set
180 * @return int Status of I2C operation, 0 in case of success
182 int tcpci_tcpm_set_cc(const struct i2c_dt_spec *bus, enum tc_cc_pull pull);
189 * @return int Status of I2C operation, 0 in case of success
191 int tcpci_tcpm_set_drp_toggle(const struct i2c_dt_spec *bus, bool enable);
197 * @param pd_rev Enum representing the USB−PD Specification Revision to be set
198 * @param power_role Enum representing the power role to be set
199 * @param data_role Enum representing the data role to be set
200 * @return int Status of I2C operation, 0 in case of success
202 int tcpci_tcpm_set_roles(const struct i2c_dt_spec *bus, enum pd_rev_type pd_rev,
203 enum tc_power_role power_role, enum tc_data_role data_role);
210 * @return int Status of I2C operation, 0 in case of success
212 int tcpci_tcpm_set_rx_type(const struct i2c_dt_spec *bus, uint8_t type);
218 * @param polarity Enum representing the CC polarity to be set
219 * @return int Status of I2C operation, 0 in case of success
221 int tcpci_tcpm_set_cc_polarity(const struct i2c_dt_spec *bus, enum tc_cc_polarity polarity);
228 * @return int Status of I2C operation, 0 in case of success
230 int tcpci_tcpm_set_vconn(const struct i2c_dt_spec *bus, bool enable);
236 * @param reg Enum representing the status register to be read
238 * @return int Status of I2C operation, 0 in case of success
240 int tcpci_tcpm_get_status_register(const struct i2c_dt_spec *bus, enum tcpc_status_reg reg,
247 * @param reg Enum representing the status register to be cleared
249 * @return int Status of I2C operation, 0 in case of success
251 int tcpci_tcpm_clear_status_register(const struct i2c_dt_spec *bus, enum tcpc_status_reg reg,
258 * @param reg Enum representing the status register to be masked
260 * @return int Status of I2C operation, 0 in case of success
262 int tcpci_tcpm_mask_status_register(const struct i2c_dt_spec *bus, enum tcpc_status_reg reg,