Linux Kernel
3.7.1
|
#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>
Go to the source code of this file.
Data Structures | |
struct | gc_config |
struct | gc_pad |
struct | gc |
struct | gc_subdev |
Macros | |
#define | pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
#define | GC_MAX_PORTS 3 |
#define | GC_MAX_DEVICES 5 |
#define | GC_REFRESH_TIME HZ/100 |
#define | GC_N64_LENGTH 32 /* N64 bit length, not including stop bit */ |
#define | GC_N64_STOP_LENGTH 5 /* Length of encoded stop bit */ |
#define | GC_N64_CMD_00 0x11111111UL |
#define | GC_N64_CMD_01 0xd1111111UL |
#define | GC_N64_CMD_03 0xdd111111UL |
#define | GC_N64_CMD_1b 0xdd1dd111UL |
#define | GC_N64_CMD_c0 0x111111ddUL |
#define | GC_N64_CMD_80 0x1111111dUL |
#define | GC_N64_STOP_BIT 0x1d /* Encoded stop bit */ |
#define | GC_N64_REQUEST_DATA GC_N64_CMD_01 /* the request data command */ |
#define | GC_N64_DELAY 133 /* delay between transmit request, and response ready (us) */ |
#define | GC_N64_DWS 3 /* delay between write segments (required for sound playback because of ISA DMA) */ |
#define | GC_N64_POWER_W 0xe2 /* power during write (transmit request) */ |
#define | GC_N64_POWER_R 0xfd /* power during read */ |
#define | GC_N64_OUT 0x1d /* output bits to the 4 pads */ |
#define | GC_N64_CLOCK 0x02 /* clock bits for read */ |
#define | GC_NES_DELAY 6 /* Delay between bits - 6us */ |
#define | GC_NES_LENGTH 8 /* The NES pads use 8 bits of data */ |
#define | GC_SNES_LENGTH |
#define | GC_SNESMOUSE_LENGTH |
#define | GC_NES_POWER 0xfc |
#define | GC_NES_CLOCK 0x01 |
#define | GC_NES_LATCH 0x02 |
#define | GC_MULTI_LENGTH 5 /* Multi system joystick packet length is 5 */ |
#define | GC_MULTI2_LENGTH 6 /* One more bit for one more button */ |
#define | GC_PSX_DELAY 25 /* 25 usec */ |
#define | GC_PSX_LENGTH 8 /* talk to the controller in bits */ |
#define | GC_PSX_BYTES 6 /* the maximum number of bytes to read off the controller */ |
#define | GC_PSX_MOUSE 1 /* Mouse */ |
#define | GC_PSX_NEGCON 2 /* NegCon */ |
#define | GC_PSX_NORMAL 4 /* Digital / Analog or Rumble in Digital mode */ |
#define | GC_PSX_ANALOG 5 /* Analog in Analog mode / Rumble in Green mode */ |
#define | GC_PSX_RUMBLE 7 /* Rumble in Red mode */ |
#define | GC_PSX_CLOCK 0x04 /* Pin 4 */ |
#define | GC_PSX_COMMAND 0x01 /* Pin 2 */ |
#define | GC_PSX_POWER 0xf8 /* Pins 5-9 */ |
#define | GC_PSX_SELECT 0x02 /* Pin 3 */ |
#define | GC_PSX_ID(x) ((x) >> 4) /* High nibble is device type */ |
#define | GC_PSX_LEN(x) (((x) & 0xf) << 1) /* Low nibble is length in bytes/2 */ |
Enumerations | |
enum | gc_type { GC_NONE = 0, GC_SNES, GC_NES, GC_NES4, GC_MULTI, GC_MULTI2, GC_N64, GC_PSX, GC_DDR, GC_SNESMOUSE, GC_MAX } |
Functions | |
MODULE_AUTHOR ("Vojtech Pavlik <[email protected]>") | |
MODULE_DESCRIPTION ("NES, SNES, N64, MultiSystem, PSX gamepad driver") | |
MODULE_LICENSE ("GPL") | |
module_param_array_named (map, gc_cfg[0].args, int,&gc_cfg[0].nargs, 0) | |
MODULE_PARM_DESC (map,"Describes first set of devices (<parport#>,<pad1>,<pad2>,..<pad5>)") | |
module_param_array_named (map2, gc_cfg[1].args, int,&gc_cfg[1].nargs, 0) | |
MODULE_PARM_DESC (map2,"Describes second set of devices") | |
module_param_array_named (map3, gc_cfg[2].args, int,&gc_cfg[2].nargs, 0) | |
MODULE_PARM_DESC (map3,"Describes third set of devices") | |
module_param_named (psx_delay, gc_psx_delay, uint, 0) | |
MODULE_PARM_DESC (psx_delay,"Delay when accessing Sony PSX controller (usecs)") | |
module_init (gc_init) | |
module_exit (gc_exit) | |
#define GC_N64_POWER_W 0xe2 /* power during write (transmit request) */ |
#define GC_N64_REQUEST_DATA GC_N64_CMD_01 /* the request data command */ |
#define GC_PSX_LENGTH 8 /* talk to the controller in bits */ |
#define GC_SNES_LENGTH |
#define GC_SNESMOUSE_LENGTH |
enum gc_type |
MODULE_AUTHOR | ( | "Vojtech Pavlik <[email protected]>" | ) |
MODULE_DESCRIPTION | ( | " | NES, |
SNES | , | ||
N64 | , | ||
MultiSystem | , | ||
PSX gamepad driver" | |||
) |
module_exit | ( | gc_exit | ) |
module_init | ( | gc_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
module_param_array_named | ( | map2 | , |
gc_cfg. | args[1], | ||
int | , | ||
&gc_cfg. | nargs[1], | ||
0 | |||
) |
module_param_array_named | ( | map3 | , |
gc_cfg. | args[2], | ||
int | , | ||
&gc_cfg. | nargs[2], | ||
0 | |||
) |
module_param_named | ( | psx_delay | , |
gc_psx_delay | , | ||
uint | , | ||
0 | |||
) |
MODULE_PARM_DESC | ( | psx_delay | , |
"Delay when accessing Sony PSX controller (usecs)" | |||
) |