linux/drivers/input/joystick/analog.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Copyright (c) 1996-2001 Vojtech Pavlik
 */

/*
 * Analog joystick and gamepad driver for Linux
 */

#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/gameport.h>
#include <linux/jiffies.h>
#include <linux/seq_buf.h>
#include <linux/timex.h>
#include <linux/timekeeping.h>

#define DRIVER_DESC

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

/*
 * Option parsing.
 */

#define ANALOG_PORTS

static char *js[ANALOG_PORTS];
static unsigned int js_nargs;
static int analog_options[ANALOG_PORTS];
module_param_array_named();
MODULE_PARM_DESC();

/*
 * Times, feature definitions.
 */

#define ANALOG_RUDDER
#define ANALOG_THROTTLE
#define ANALOG_AXES_STD
#define ANALOG_BTNS_STD

#define ANALOG_BTNS_CHF
#define ANALOG_HAT1_CHF
#define ANALOG_HAT2_CHF
#define ANALOG_HAT_FCS
#define ANALOG_HATS_ALL
#define ANALOG_BTN_TL
#define ANALOG_BTN_TR
#define ANALOG_BTN_TL2
#define ANALOG_BTN_TR2
#define ANALOG_BTNS_TLR
#define ANALOG_BTNS_TLR2
#define ANALOG_BTNS_GAMEPAD

#define ANALOG_HBTN_CHF
#define ANALOG_ANY_CHF
#define ANALOG_SAITEK
#define ANALOG_EXTENSIONS
#define ANALOG_GAMEPAD

#define ANALOG_MAX_TIME
#define ANALOG_LOOP_TIME
#define ANALOG_SAITEK_DELAY
#define ANALOG_SAITEK_TIME
#define ANALOG_AXIS_TIME
#define ANALOG_INIT_RETRIES
#define ANALOG_FUZZ_BITS
#define ANALOG_FUZZ_MAGIC

#define ANALOG_MAX_NAME_LENGTH
#define ANALOG_MAX_PHYS_LENGTH

static short analog_axes[] =;
static short analog_hats[] =;
static short analog_pads[] =;
static short analog_exts[] =;
static short analog_pad_btn[] =;
static short analog_joy_btn[] =;

static unsigned char analog_chf[] =;

struct analog {};

struct analog_port {};

/*
 * analog_decode() decodes analog joystick data and reports input events.
 */

static void analog_decode(struct analog *analog, int *axes, int *initial, int buttons)
{}

/*
 * analog_cooked_read() reads analog joystick data.
 */

static int analog_cooked_read(struct analog_port *port)
{}

static int analog_button_read(struct analog_port *port, char saitek, char chf)
{}

/*
 * analog_poll() repeatedly polls the Analog joysticks.
 */

static void analog_poll(struct gameport *gameport)
{}

/*
 * analog_open() is a callback from the input open routine.
 */

static int analog_open(struct input_dev *dev)
{}

/*
 * analog_close() is a callback from the input close routine.
 */

static void analog_close(struct input_dev *dev)
{}

/*
 * analog_calibrate_timer() calibrates the timer and computes loop
 * and timeout values for a joystick port.
 */

static void analog_calibrate_timer(struct analog_port *port)
{}

/*
 * analog_name() constructs a name for an analog joystick.
 */

static void analog_name(struct analog *analog)
{}

/*
 * analog_init_device()
 */

static int analog_init_device(struct analog_port *port, struct analog *analog, int index)
{}

/*
 * analog_init_devices() sets up device-specific values and registers the input devices.
 */

static int analog_init_masks(struct analog_port *port)
{}

static int analog_init_port(struct gameport *gameport, struct gameport_driver *drv, struct analog_port *port)
{}

static int analog_connect(struct gameport *gameport, struct gameport_driver *drv)
{}

static void analog_disconnect(struct gameport *gameport)
{}

struct analog_types {};

static struct analog_types analog_types[] =;

static void analog_parse_options(void)
{}

/*
 * The gameport device structure.
 */

static struct gameport_driver analog_drv =;

static int __init analog_init(void)
{}

static void __exit analog_exit(void)
{}

module_init();
module_exit(analog_exit);