#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/usb/typec.h>
#define WUSB3801_REG_DEVICE_ID …
#define WUSB3801_REG_CTRL0 …
#define WUSB3801_REG_INT …
#define WUSB3801_REG_STAT …
#define WUSB3801_REG_CTRL1 …
#define WUSB3801_REG_TEST00 …
#define WUSB3801_REG_TEST01 …
#define WUSB3801_REG_TEST02 …
#define WUSB3801_REG_TEST03 …
#define WUSB3801_REG_TEST04 …
#define WUSB3801_REG_TEST05 …
#define WUSB3801_REG_TEST06 …
#define WUSB3801_REG_TEST07 …
#define WUSB3801_REG_TEST08 …
#define WUSB3801_REG_TEST09 …
#define WUSB3801_REG_TEST0A …
#define WUSB3801_REG_TEST0B …
#define WUSB3801_REG_TEST0C …
#define WUSB3801_REG_TEST0D …
#define WUSB3801_REG_TEST0E …
#define WUSB3801_REG_TEST0F …
#define WUSB3801_REG_TEST10 …
#define WUSB3801_REG_TEST11 …
#define WUSB3801_REG_TEST12 …
#define WUSB3801_DEVICE_ID_VERSION_ID …
#define WUSB3801_DEVICE_ID_VENDOR_ID …
#define WUSB3801_CTRL0_DIS_ACC_SUPPORT …
#define WUSB3801_CTRL0_TRY …
#define WUSB3801_CTRL0_TRY_NONE …
#define WUSB3801_CTRL0_TRY_SNK …
#define WUSB3801_CTRL0_TRY_SRC …
#define WUSB3801_CTRL0_CURRENT …
#define WUSB3801_CTRL0_CURRENT_DEFAULT …
#define WUSB3801_CTRL0_CURRENT_1_5A …
#define WUSB3801_CTRL0_CURRENT_3_0A …
#define WUSB3801_CTRL0_ROLE …
#define WUSB3801_CTRL0_ROLE_SNK …
#define WUSB3801_CTRL0_ROLE_SRC …
#define WUSB3801_CTRL0_ROLE_DRP …
#define WUSB3801_CTRL0_INT_MASK …
#define WUSB3801_INT_ATTACHED …
#define WUSB3801_INT_DETACHED …
#define WUSB3801_STAT_VBUS_DETECTED …
#define WUSB3801_STAT_CURRENT …
#define WUSB3801_STAT_CURRENT_STANDBY …
#define WUSB3801_STAT_CURRENT_DEFAULT …
#define WUSB3801_STAT_CURRENT_1_5A …
#define WUSB3801_STAT_CURRENT_3_0A …
#define WUSB3801_STAT_PARTNER …
#define WUSB3801_STAT_PARTNER_STANDBY …
#define WUSB3801_STAT_PARTNER_SNK …
#define WUSB3801_STAT_PARTNER_SRC …
#define WUSB3801_STAT_PARTNER_AUDIO …
#define WUSB3801_STAT_PARTNER_DEBUG …
#define WUSB3801_STAT_ORIENTATION …
#define WUSB3801_STAT_ORIENTATION_NONE …
#define WUSB3801_STAT_ORIENTATION_CC1 …
#define WUSB3801_STAT_ORIENTATION_CC2 …
#define WUSB3801_STAT_ORIENTATION_BOTH …
#define WUSB3801_CTRL1_SM_RESET …
#define WUSB3801_TEST01_VENDOR_SUB_ID …
#define WUSB3801_TEST02_FORCE_ERR_RCY …
#define WUSB3801_TEST0A_WAIT_VBUS …
struct wusb3801 { … };
static enum typec_role wusb3801_get_default_role(struct wusb3801 *wusb3801)
{ … }
static int wusb3801_map_port_type(enum typec_port_type type)
{ … }
static int wusb3801_map_pwr_opmode(enum typec_pwr_opmode mode)
{ … }
static unsigned int wusb3801_map_try_role(int role)
{ … }
static enum typec_orientation wusb3801_unmap_orientation(unsigned int status)
{ … }
static enum typec_pwr_opmode wusb3801_unmap_pwr_opmode(unsigned int status)
{ … }
static int wusb3801_try_role(struct typec_port *port, int role)
{ … }
static int wusb3801_port_type_set(struct typec_port *port,
enum typec_port_type type)
{ … }
static const struct typec_operations wusb3801_typec_ops = …;
static int wusb3801_hw_init(struct wusb3801 *wusb3801)
{ … }
static void wusb3801_hw_update(struct wusb3801 *wusb3801)
{ … }
static irqreturn_t wusb3801_irq(int irq, void *data)
{ … }
static const struct regmap_config config = …;
static int wusb3801_probe(struct i2c_client *client)
{ … }
static void wusb3801_remove(struct i2c_client *client)
{ … }
static const struct of_device_id wusb3801_of_match[] = …;
MODULE_DEVICE_TABLE(of, wusb3801_of_match);
static struct i2c_driver wusb3801_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;