#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/serio.h>
#define DRIVER_DESC …
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
#define HAMPSHIRE_FORMAT_TOUCH_BIT …
#define HAMPSHIRE_FORMAT_LENGTH …
#define HAMPSHIRE_RESPONSE_BEGIN_BYTE …
#define HAMPSHIRE_MIN_XC …
#define HAMPSHIRE_MAX_XC …
#define HAMPSHIRE_MIN_YC …
#define HAMPSHIRE_MAX_YC …
#define HAMPSHIRE_GET_XC(data) …
#define HAMPSHIRE_GET_YC(data) …
#define HAMPSHIRE_GET_TOUCHED(data) …
struct hampshire { … };
static void hampshire_process_data(struct hampshire *phampshire)
{ … }
static irqreturn_t hampshire_interrupt(struct serio *serio,
unsigned char data, unsigned int flags)
{ … }
static void hampshire_disconnect(struct serio *serio)
{ … }
static int hampshire_connect(struct serio *serio, struct serio_driver *drv)
{ … }
static const struct serio_device_id hampshire_serio_ids[] = …;
MODULE_DEVICE_TABLE(serio, hampshire_serio_ids);
static struct serio_driver hampshire_drv = …;
module_serio_driver(…) …;