Documentation/input/gameport-programming.rst

Source file repositories/reference/linux-study-clean/Documentation/input/gameport-programming.rst

File Facts

System
Linux kernel
Corpus path
Documentation/input/gameport-programming.rst
Extension
.rst
Size
6489 bytes
Lines
234
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct gameport {

	void *port_data;

A private pointer for free use in the gameport driver. (Not the joystick
driver!)

::

	char name[32];

Driver's name as set by driver calling gameport_set_name(). Informational
purpose only.

::

	char phys[32];

gameport's physical name/description as set by driver calling gameport_set_phys().
Informational purpose only.

::

	int io;

I/O address for use with raw mode. You have to either set this, or ->read()
to some value if your gameport supports raw mode.

::

	int speed;

Raw mode speed of the gameport reads in thousands of reads per second.

::

	int fuzz;

If the gameport supports cooked mode, this should be set to a value that
represents the amount of noise in the data. See
:ref:`gameport_pgm_cooked_mode`.

::

	void (*trigger)(struct gameport *);

Trigger. This function should trigger the ns558 oneshots. If set to NULL,
outb(0xff, io) will be used.

::

	unsigned char (*read)(struct gameport *);

Read the buttons and ns558 oneshot bits. If set to NULL, inb(io) will be
used instead.

::

	int (*cooked_read)(struct gameport *, int *axes, int *buttons);

If the gameport supports cooked mode, it should point this to its cooked
read function. It should fill axes[0..3] with four values of the joystick axes
and buttons[0] with four bits representing the buttons.

::

	int (*calibrate)(struct gameport *, int *axes, int *max);

Function for calibrating the ADC hardware. When called, axes[0..3] should be
pre-filled by cooked data by the caller, max[0..3] should be pre-filled with

Annotation

Implementation Notes