#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/usb/role.h>
#include <linux/irqreturn.h>
#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/slab.h>
#include <linux/usb/typec.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#define HD3SS3220_REG_CN_STAT_CTRL …
#define HD3SS3220_REG_GEN_CTRL …
#define HD3SS3220_REG_DEV_REV …
#define HD3SS3220_REG_CN_STAT_CTRL_ATTACHED_STATE_MASK …
#define HD3SS3220_REG_CN_STAT_CTRL_AS_DFP …
#define HD3SS3220_REG_CN_STAT_CTRL_AS_UFP …
#define HD3SS3220_REG_CN_STAT_CTRL_TO_ACCESSORY …
#define HD3SS3220_REG_CN_STAT_CTRL_INT_STATUS …
#define HD3SS3220_REG_GEN_CTRL_SRC_PREF_MASK …
#define HD3SS3220_REG_GEN_CTRL_SRC_PREF_DRP_DEFAULT …
#define HD3SS3220_REG_GEN_CTRL_SRC_PREF_DRP_TRY_SNK …
#define HD3SS3220_REG_GEN_CTRL_SRC_PREF_DRP_TRY_SRC …
struct hd3ss3220 { … };
static int hd3ss3220_set_source_pref(struct hd3ss3220 *hd3ss3220, int src_pref)
{ … }
static enum usb_role hd3ss3220_get_attached_state(struct hd3ss3220 *hd3ss3220)
{ … }
static int hd3ss3220_dr_set(struct typec_port *port, enum typec_data_role role)
{ … }
static const struct typec_operations hd3ss3220_ops = …;
static void hd3ss3220_set_role(struct hd3ss3220 *hd3ss3220)
{ … }
static void output_poll_execute(struct work_struct *work)
{ … }
static irqreturn_t hd3ss3220_irq(struct hd3ss3220 *hd3ss3220)
{ … }
static irqreturn_t hd3ss3220_irq_handler(int irq, void *data)
{ … }
static const struct regmap_config config = …;
static int hd3ss3220_probe(struct i2c_client *client)
{ … }
static void hd3ss3220_remove(struct i2c_client *client)
{ … }
static const struct of_device_id dev_ids[] = …;
MODULE_DEVICE_TABLE(of, dev_ids);
static struct i2c_driver hd3ss3220_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;