#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/usb.h>
#define CP2615_VID …
#define CP2615_PID …
#define IOP_EP_IN …
#define IOP_EP_OUT …
#define IOP_IFN …
#define IOP_ALTSETTING …
#define MAX_IOP_SIZE …
#define MAX_IOP_PAYLOAD_SIZE …
#define MAX_I2C_SIZE …
enum cp2615_iop_msg_type { … };
struct __packed cp2615_iop_msg { … };
#define PART_ID_A01 …
#define PART_ID_A02 …
struct __packed cp2615_iop_accessory_info { … };
struct __packed cp2615_i2c_transfer { … };
enum cp2615_i2c_status { … };
struct __packed cp2615_i2c_transfer_result { … };
static int cp2615_init_iop_msg(struct cp2615_iop_msg *ret, enum cp2615_iop_msg_type msg,
const void *data, size_t data_len)
{ … }
static int cp2615_init_i2c_msg(struct cp2615_iop_msg *ret, const struct cp2615_i2c_transfer *data)
{ … }
static int cp2615_check_status(enum cp2615_i2c_status status)
{ … }
static int
cp2615_i2c_send(struct usb_interface *usbif, struct cp2615_i2c_transfer *i2c_w)
{ … }
static int
cp2615_i2c_recv(struct usb_interface *usbif, unsigned char tag, void *buf)
{ … }
static int cp2615_check_iop(struct usb_interface *usbif)
{ … }
static int
cp2615_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{ … }
static u32
cp2615_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm cp2615_i2c_algo = …;
static struct i2c_adapter_quirks cp2615_i2c_quirks = …;
static void
cp2615_i2c_remove(struct usb_interface *usbif)
{ … }
static int
cp2615_i2c_probe(struct usb_interface *usbif, const struct usb_device_id *id)
{ … }
static const struct usb_device_id id_table[] = …;
MODULE_DEVICE_TABLE(usb, id_table);
static struct usb_driver cp2615_i2c_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;