#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/hid.h>
#include <linux/hidraw.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include "hid-ids.h"
#define SET_CLEAR_OUTPUTS …
#define CONFIGURE …
#define READ_EE …
#define WRITE_EE …
#define READ_ALL …
enum MCP_IO_DIR { … };
#define TXLED …
#define RXLED …
#define USBCFG …
#define SSPND …
#define MCP_NGPIO …
struct mcp_set_clear_outputs { … } __packed;
struct mcp_configure { … } __packed;
struct mcp_read_all { … } __packed;
struct mcp_read_all_resp { … } __packed;
struct mcp2200 { … };
static int mcp_cmd_read_all(struct mcp2200 *mcp)
{ … }
static void mcp_set_multiple(struct gpio_chip *gc, unsigned long *mask,
unsigned long *bits)
{ … }
static void mcp_set(struct gpio_chip *gc, unsigned int gpio_nr, int value)
{ … }
static int mcp_get_multiple(struct gpio_chip *gc, unsigned long *mask,
unsigned long *bits)
{ … }
static int mcp_get(struct gpio_chip *gc, unsigned int gpio_nr)
{ … }
static int mcp_get_direction(struct gpio_chip *gc, unsigned int gpio_nr)
{ … }
static int mcp_set_direction(struct gpio_chip *gc, unsigned int gpio_nr,
enum MCP_IO_DIR io_direction)
{ … }
static int mcp_direction_input(struct gpio_chip *gc, unsigned int gpio_nr)
{ … }
static int mcp_direction_output(struct gpio_chip *gc, unsigned int gpio_nr,
int value)
{ … }
static const struct gpio_chip template_chip = …;
static int mcp2200_raw_event(struct hid_device *hdev, struct hid_report *report,
u8 *data, int size)
{ … }
static int mcp2200_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ … }
static void mcp2200_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id mcp2200_devices[] = …;
MODULE_DEVICE_TABLE(hid, mcp2200_devices);
static struct hid_driver mcp2200_driver = …;
module_hid_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;