linux/drivers/input/joystick/gamecon.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * NES, SNES, N64, MultiSystem, PSX gamepad driver for Linux
 *
 *  Copyright (c) 1999-2004	Vojtech Pavlik <[email protected]>
 *  Copyright (c) 2004		Peter Nelson <[email protected]>
 *
 *  Based on the work of:
 *	Andree Borrmann		John Dahlstrom
 *	David Kuder		Nathan Hand
 *	Raphael Assenat
 */

#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();

/* see also gs_psx_delay parameter in PSX support section */

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[] =;

/*
 * N64 support.
 */

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
						/* GC_N64_DWS > 24 is known to fail */
#define GC_N64_POWER_W
#define GC_N64_POWER_R
#define GC_N64_OUT
						/* Reading the main axes of any N64 pad is known to fail if the corresponding bit */
						/* in GC_N64_OUT is pulled low on the output port (by any routine) for more */
						/* than 123 us */
#define GC_N64_CLOCK

/*
 * Used for rumble code.
 */

/* Send encoded command */
static void gc_n64_send_command(struct gc *gc, unsigned long cmd,
				unsigned char target)
{}

/* Send stop bit */
static void gc_n64_send_stop_bit(struct gc *gc, unsigned char target)
{}

/*
 * gc_n64_read_packet() reads an N64 packet.
 * Each pad uses one bit per byte. So all pads connected to this port
 * are read in parallel.
 */

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)
{}

/*
 * NES/SNES support.
 */

#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[] =;

/*
 * gc_nes_read_packet() reads a NES/SNES packet.
 * Each pad uses one bit per byte. So all pads connected to
 * this port are read in parallel.
 */

static void gc_nes_read_packet(struct gc *gc, int length, unsigned char *data)
{}

static void gc_nes_process_packet(struct gc *gc)
{}

/*
 * Multisystem joystick support
 */

#define GC_MULTI_LENGTH
#define GC_MULTI2_LENGTH

/*
 * gc_multi_read_packet() reads a Multisystem joystick packet.
 */

static void gc_multi_read_packet(struct gc *gc, int length, unsigned char *data)
{}

static void gc_multi_process_packet(struct gc *gc)
{}

/*
 * PSX support
 *
 * See documentation at:
 *	http://www.geocities.co.jp/Playtown/2004/psx/ps_eng.txt	
 *	http://www.gamesx.com/controldata/psxcont/psxcont.htm
 *
 */

#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[] =;

/*
 * gc_psx_command() writes 8bit command and reads 8bit data from
 * the psx pad.
 */

static void gc_psx_command(struct gc *gc, int b, unsigned char *data)
{}

/*
 * gc_psx_read_packet() reads a whole psx packet and returns
 * device identifier code.
 */

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)
{}

/*
 * gc_timer() initiates reads of console pads data.
 */

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);