#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/parport.h>
#include <linux/input.h>
#include <linux/mutex.h>
#include <linux/slab.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
struct db9_config { … };
#define DB9_MAX_PORTS …
static struct db9_config db9_cfg[DB9_MAX_PORTS];
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
#define DB9_ARG_PARPORT …
#define DB9_ARG_MODE …
#define DB9_MULTI_STICK …
#define DB9_MULTI2_STICK …
#define DB9_GENESIS_PAD …
#define DB9_GENESIS5_PAD …
#define DB9_GENESIS6_PAD …
#define DB9_SATURN_PAD …
#define DB9_MULTI_0802 …
#define DB9_MULTI_0802_2 …
#define DB9_CD32_PAD …
#define DB9_SATURN_DPP …
#define DB9_SATURN_DPP_2 …
#define DB9_MAX_PAD …
#define DB9_UP …
#define DB9_DOWN …
#define DB9_LEFT …
#define DB9_RIGHT …
#define DB9_FIRE1 …
#define DB9_FIRE2 …
#define DB9_FIRE3 …
#define DB9_FIRE4 …
#define DB9_NORMAL …
#define DB9_NOSELECT …
#define DB9_GENESIS6_DELAY …
#define DB9_REFRESH_TIME …
#define DB9_MAX_DEVICES …
struct db9_mode_data { … };
struct db9 { … };
static struct db9 *db9_base[3];
static const short db9_multi_btn[] = …;
static const short db9_genesis_btn[] = …;
static const short db9_cd32_btn[] = …;
static const short db9_abs[] = …;
static const struct db9_mode_data db9_modes[] = …;
#define DB9_SATURN_DELAY …
static const int db9_saturn_byte[] = …;
static const unsigned char db9_saturn_mask[] = …;
static void db9_saturn_write_sub(struct parport *port, int type, unsigned char data, int powered, int pwr_sub)
{ … }
static unsigned char db9_saturn_read_sub(struct parport *port, int type)
{ … }
static unsigned char db9_saturn_read_analog(struct parport *port, int type, int powered)
{ … }
static unsigned char db9_saturn_read_packet(struct parport *port, unsigned char *data, int type, int powered)
{ … }
static int db9_saturn_report(unsigned char id, unsigned char data[60], struct input_dev *devs[], int n, int max_pads)
{ … }
static int db9_saturn(int mode, struct parport *port, struct input_dev *devs[])
{ … }
static void db9_timer(struct timer_list *t)
{ … }
static int db9_open(struct input_dev *dev)
{ … }
static void db9_close(struct input_dev *dev)
{ … }
static void db9_attach(struct parport *pp)
{ … }
static void db9_detach(struct parport *port)
{ … }
static struct parport_driver db9_parport_driver = …;
static int __init db9_init(void)
{ … }
static void __exit db9_exit(void)
{ … }
module_init(…) …;
module_exit(db9_exit);