#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/usb.h>
#define OSIFI2C_READ …
#define OSIFI2C_WRITE …
#define OSIFI2C_STOP …
#define OSIFI2C_STATUS …
#define OSIFI2C_SET_BIT_RATE …
#define STATUS_ADDRESS_ACK …
#define STATUS_ADDRESS_NAK …
struct osif_priv { … };
static int osif_usb_read(struct i2c_adapter *adapter, int cmd,
int value, int index, void *data, int len)
{ … }
static int osif_usb_write(struct i2c_adapter *adapter, int cmd,
int value, int index, void *data, int len)
{ … }
static int osif_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,
int num)
{ … }
static u32 osif_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm osif_algorithm = …;
#define USB_OSIF_VENDOR_ID …
#define USB_OSIF_PRODUCT_ID …
static const struct usb_device_id osif_table[] = …;
MODULE_DEVICE_TABLE(usb, osif_table);
static int osif_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{ … }
static void osif_disconnect(struct usb_interface *interface)
{ … }
static struct usb_driver osif_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;