#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.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>
#include "tcpci_maxim.h"
#define PD_ACTIVITY_TIMEOUT_MS …
#define TCPC_VENDOR_ALERT …
#define TCPC_VENDOR_USBSW_CTRL …
#define TCPC_VENDOR_USBSW_CTRL_ENABLE_USB_DATA …
#define TCPC_VENDOR_USBSW_CTRL_DISABLE_USB_DATA …
#define TCPC_RECEIVE_BUFFER_COUNT_OFFSET …
#define TCPC_RECEIVE_BUFFER_FRAME_TYPE_OFFSET …
#define TCPC_RECEIVE_BUFFER_RX_BYTE_BUF_OFFSET …
#define TCPC_RECEIVE_BUFFER_LEN …
#define MAX_BUCK_BOOST_SID …
#define MAX_BUCK_BOOST_OP …
#define MAX_BUCK_BOOST_OFF …
#define MAX_BUCK_BOOST_SOURCE …
#define MAX_BUCK_BOOST_SINK …
static const struct regmap_range max_tcpci_tcpci_range[] = …;
static const struct regmap_access_table max_tcpci_tcpci_write_table = …;
static const struct regmap_config max_tcpci_regmap_config = …;
static struct max_tcpci_chip *tdata_to_max_tcpci(struct tcpci_data *tdata)
{ … }
static void max_tcpci_init_regs(struct max_tcpci_chip *chip)
{ … }
static void process_rx(struct max_tcpci_chip *chip, u16 status)
{ … }
static int max_tcpci_set_vbus(struct tcpci *tcpci, struct tcpci_data *tdata, bool source, bool sink)
{ … }
static void process_power_status(struct max_tcpci_chip *chip)
{ … }
static void max_tcpci_frs_sourcing_vbus(struct tcpci *tcpci, struct tcpci_data *tdata)
{ … }
static void process_tx(struct max_tcpci_chip *chip, u16 status)
{ … }
static void max_tcpci_set_partner_usb_comm_capable(struct tcpci *tcpci, struct tcpci_data *data,
bool capable)
{ … }
static irqreturn_t _max_tcpci_irq(struct max_tcpci_chip *chip, u16 status)
{ … }
static irqreturn_t max_tcpci_irq(int irq, void *dev_id)
{ … }
static irqreturn_t max_tcpci_isr(int irq, void *dev_id)
{ … }
static int max_tcpci_init_alert(struct max_tcpci_chip *chip, struct i2c_client *client)
{ … }
static int max_tcpci_start_toggling(struct tcpci *tcpci, struct tcpci_data *tdata,
enum typec_cc_status cc)
{ … }
static int tcpci_init(struct tcpci *tcpci, struct tcpci_data *data)
{ … }
static void max_tcpci_check_contaminant(struct tcpci *tcpci, struct tcpci_data *tdata)
{ … }
static bool max_tcpci_attempt_vconn_swap_discovery(struct tcpci *tcpci, struct tcpci_data *tdata)
{ … }
static int max_tcpci_probe(struct i2c_client *client)
{ … }
static void max_tcpci_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id max_tcpci_id[] = …;
MODULE_DEVICE_TABLE(i2c, max_tcpci_id);
#ifdef CONFIG_OF
static const struct of_device_id max_tcpci_of_match[] = …;
MODULE_DEVICE_TABLE(of, max_tcpci_of_match);
#endif
static struct i2c_driver max_tcpci_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;