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.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct gameportfunction my_triggerfunction my_readfunction my_cooked_readfunction my_open
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
- Detected declarations: `struct gameport`, `function my_trigger`, `function my_read`, `function my_cooked_read`, `function my_open`.
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.