#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/module.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(…) …;
#define GC_MAX_PORTS …
#define GC_MAX_DEVICES …
struct gc_config { … };
static struct gc_config gc_cfg[GC_MAX_PORTS];
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
module_param_array_named(…);
MODULE_PARM_DESC(…) …;
enum gc_type { … };
#define GC_REFRESH_TIME …
struct gc_pad { … };
struct gc { … };
struct gc_subdev { … };
static struct gc *gc_base[3];
static const int gc_status_bit[] = …;
static const char *gc_names[] = …;
static const unsigned char gc_n64_bytes[] = …;
static const short gc_n64_btn[] = …;
#define GC_N64_LENGTH …
#define GC_N64_STOP_LENGTH …
#define GC_N64_CMD_00 …
#define GC_N64_CMD_01 …
#define GC_N64_CMD_03 …
#define GC_N64_CMD_1b …
#define GC_N64_CMD_c0 …
#define GC_N64_CMD_80 …
#define GC_N64_STOP_BIT …
#define GC_N64_REQUEST_DATA …
#define GC_N64_DELAY …
#define GC_N64_DWS …
#define GC_N64_POWER_W …
#define GC_N64_POWER_R …
#define GC_N64_OUT …
#define GC_N64_CLOCK …
static void gc_n64_send_command(struct gc *gc, unsigned long cmd,
unsigned char target)
{ … }
static void gc_n64_send_stop_bit(struct gc *gc, unsigned char target)
{ … }
static void gc_n64_read_packet(struct gc *gc, unsigned char *data)
{ … }
static void gc_n64_process_packet(struct gc *gc)
{ … }
static int gc_n64_play_effect(struct input_dev *dev, void *data,
struct ff_effect *effect)
{ … }
static int gc_n64_init_ff(struct input_dev *dev, int i)
{ … }
#define GC_NES_DELAY …
#define GC_NES_LENGTH …
#define GC_SNES_LENGTH …
#define GC_SNESMOUSE_LENGTH …
#define GC_NES_POWER …
#define GC_NES_CLOCK …
#define GC_NES_LATCH …
static const unsigned char gc_nes_bytes[] = …;
static const unsigned char gc_snes_bytes[] = …;
static const short gc_snes_btn[] = …;
static void gc_nes_read_packet(struct gc *gc, int length, unsigned char *data)
{ … }
static void gc_nes_process_packet(struct gc *gc)
{ … }
#define GC_MULTI_LENGTH …
#define GC_MULTI2_LENGTH …
static void gc_multi_read_packet(struct gc *gc, int length, unsigned char *data)
{ … }
static void gc_multi_process_packet(struct gc *gc)
{ … }
#define GC_PSX_DELAY …
#define GC_PSX_LENGTH …
#define GC_PSX_BYTES …
#define GC_PSX_MOUSE …
#define GC_PSX_NEGCON …
#define GC_PSX_NORMAL …
#define GC_PSX_ANALOG …
#define GC_PSX_RUMBLE …
#define GC_PSX_CLOCK …
#define GC_PSX_COMMAND …
#define GC_PSX_POWER …
#define GC_PSX_SELECT …
#define GC_PSX_ID(x) …
#define GC_PSX_LEN(x) …
static int gc_psx_delay = …;
module_param_named(psx_delay, gc_psx_delay, uint, 0);
MODULE_PARM_DESC(…) …;
static const short gc_psx_abs[] = …;
static const short gc_psx_btn[] = …;
static const short gc_psx_ddr_btn[] = …;
static void gc_psx_command(struct gc *gc, int b, unsigned char *data)
{ … }
static void gc_psx_read_packet(struct gc *gc,
unsigned char data[GC_MAX_DEVICES][GC_PSX_BYTES],
unsigned char id[GC_MAX_DEVICES])
{ … }
static void gc_psx_report_one(struct gc_pad *pad, unsigned char psx_type,
unsigned char *data)
{ … }
static void gc_psx_process_packet(struct gc *gc)
{ … }
static void gc_timer(struct timer_list *t)
{ … }
static int gc_open(struct input_dev *dev)
{ … }
static void gc_close(struct input_dev *dev)
{ … }
static int gc_setup_pad(struct gc *gc, int idx, int pad_type)
{ … }
static void gc_attach(struct parport *pp)
{ … }
static void gc_detach(struct parport *port)
{ … }
static struct parport_driver gc_parport_driver = …;
static int __init gc_init(void)
{ … }
static void __exit gc_exit(void)
{ … }
module_init(…) …;
module_exit(gc_exit);