#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/usb.h>
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define CYPRESS_VENDOR_ID …
#define CYPRESS_PRODUCT_ID …
#define CYPRESS_READ_PORT …
#define CYPRESS_WRITE_PORT …
#define CYPRESS_READ_RAM …
#define CYPRESS_WRITE_RAM …
#define CYPRESS_READ_ROM …
#define CYPRESS_READ_PORT_ID0 …
#define CYPRESS_WRITE_PORT_ID0 …
#define CYPRESS_READ_PORT_ID1 …
#define CYPRESS_WRITE_PORT_ID1 …
#define CYPRESS_MAX_REQSIZE …
static const struct usb_device_id cypress_table[] = …;
MODULE_DEVICE_TABLE(usb, cypress_table);
struct cypress { … };
static int vendor_command(struct cypress *dev, unsigned char request,
unsigned char address, unsigned char data)
{ … }
static ssize_t write_port(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count,
int port_num, int write_id)
{ … }
static ssize_t port0_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t port1_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t read_port(struct device *dev, struct device_attribute *attr,
char *buf, int port_num, int read_id)
{ … }
static ssize_t port0_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(port0);
static ssize_t port1_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RW(port1);
static struct attribute *cypress_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int cypress_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{ … }
static void cypress_disconnect(struct usb_interface *interface)
{ … }
static struct usb_driver cypress_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;