#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/usb/pd.h>
#include <linux/usb/tcpci.h>
#include <linux/usb/tcpm.h>
#include <linux/usb/typec.h>
#define PD_RETRY_COUNT_DEFAULT …
#define PD_RETRY_COUNT_3_0_OR_HIGHER …
#define AUTO_DISCHARGE_DEFAULT_THRESHOLD_MV …
#define VSINKPD_MIN_IR_DROP_MV …
#define VSRC_NEW_MIN_PERCENT …
#define VSRC_VALID_MIN_MV …
#define VPPS_NEW_MIN_PERCENT …
#define VPPS_VALID_MIN_MV …
#define VSINKDISCONNECT_PD_MIN_PERCENT …
struct tcpci { … };
struct tcpci_chip { … };
struct tcpm_port *tcpci_get_tcpm_port(struct tcpci *tcpci)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline struct tcpci *tcpc_to_tcpci(struct tcpc_dev *tcpc)
{ … }
static int tcpci_read16(struct tcpci *tcpci, unsigned int reg, u16 *val)
{ … }
static int tcpci_write16(struct tcpci *tcpci, unsigned int reg, u16 val)
{ … }
static bool tcpci_check_std_output_cap(struct regmap *regmap, u8 mask)
{ … }
static int tcpci_set_cc(struct tcpc_dev *tcpc, enum typec_cc_status cc)
{ … }
static int tcpci_apply_rc(struct tcpc_dev *tcpc, enum typec_cc_status cc,
enum typec_cc_polarity polarity)
{ … }
static int tcpci_start_toggling(struct tcpc_dev *tcpc,
enum typec_port_type port_type,
enum typec_cc_status cc)
{ … }
static int tcpci_get_cc(struct tcpc_dev *tcpc,
enum typec_cc_status *cc1, enum typec_cc_status *cc2)
{ … }
static int tcpci_set_polarity(struct tcpc_dev *tcpc,
enum typec_cc_polarity polarity)
{ … }
static int tcpci_set_orientation(struct tcpc_dev *tcpc,
enum typec_orientation orientation)
{ … }
static void tcpci_set_partner_usb_comm_capable(struct tcpc_dev *tcpc, bool capable)
{ … }
static int tcpci_set_vconn(struct tcpc_dev *tcpc, bool enable)
{ … }
static int tcpci_enable_auto_vbus_discharge(struct tcpc_dev *dev, bool enable)
{ … }
static int tcpci_set_auto_vbus_discharge_threshold(struct tcpc_dev *dev, enum typec_pwr_opmode mode,
bool pps_active, u32 requested_vbus_voltage_mv)
{ … }
static int tcpci_enable_frs(struct tcpc_dev *dev, bool enable)
{ … }
static void tcpci_frs_sourcing_vbus(struct tcpc_dev *dev)
{ … }
static void tcpci_check_contaminant(struct tcpc_dev *dev)
{ … }
static int tcpci_set_bist_data(struct tcpc_dev *tcpc, bool enable)
{ … }
static int tcpci_set_roles(struct tcpc_dev *tcpc, bool attached,
enum typec_role role, enum typec_data_role data)
{ … }
static int tcpci_set_pd_rx(struct tcpc_dev *tcpc, bool enable)
{ … }
static int tcpci_get_vbus(struct tcpc_dev *tcpc)
{ … }
static bool tcpci_is_vbus_vsafe0v(struct tcpc_dev *tcpc)
{ … }
static int tcpci_set_vbus(struct tcpc_dev *tcpc, bool source, bool sink)
{ … }
static int tcpci_pd_transmit(struct tcpc_dev *tcpc, enum tcpm_transmit_type type,
const struct pd_message *msg, unsigned int negotiated_rev)
{ … }
static bool tcpci_cable_comm_capable(struct tcpc_dev *tcpc)
{ … }
static bool tcpci_attempt_vconn_swap_discovery(struct tcpc_dev *tcpc)
{ … }
static int tcpci_init(struct tcpc_dev *tcpc)
{ … }
irqreturn_t tcpci_irq(struct tcpci *tcpci)
{ … }
EXPORT_SYMBOL_GPL(…);
static irqreturn_t _tcpci_irq(int irq, void *dev_id)
{ … }
static const struct regmap_config tcpci_regmap_config = …;
static int tcpci_parse_config(struct tcpci *tcpci)
{ … }
struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data)
{ … }
EXPORT_SYMBOL_GPL(…);
void tcpci_unregister_port(struct tcpci *tcpci)
{ … }
EXPORT_SYMBOL_GPL(…);
static int tcpci_probe(struct i2c_client *client)
{ … }
static void tcpci_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id tcpci_id[] = …;
MODULE_DEVICE_TABLE(i2c, tcpci_id);
#ifdef CONFIG_OF
static const struct of_device_id tcpci_of_match[] = …;
MODULE_DEVICE_TABLE(of, tcpci_of_match);
#endif
static struct i2c_driver tcpci_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;