#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 MAGELLAN_MAX_LENGTH …
static int magellan_buttons[] = …;
static int magellan_axes[] = …;
struct magellan { … };
static int magellan_crunch_nibbles(unsigned char *data, int count)
{ … }
static void magellan_process_packet(struct magellan* magellan)
{ … }
static irqreturn_t magellan_interrupt(struct serio *serio,
unsigned char data, unsigned int flags)
{ … }
static void magellan_disconnect(struct serio *serio)
{ … }
static int magellan_connect(struct serio *serio, struct serio_driver *drv)
{ … }
static const struct serio_device_id magellan_serio_ids[] = …;
MODULE_DEVICE_TABLE(serio, magellan_serio_ids);
static struct serio_driver magellan_drv = …;
module_serio_driver(…) …;