drivers/hid/hid-nintendo.c
Source file repositories/reference/linux-study-clean/drivers/hid/hid-nintendo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-nintendo.c- Extension
.c- Size
- 90903 bytes
- Lines
- 2898
- Domain
- Driver Families
- Bucket
- drivers/hid
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
hid-ids.hlinux/unaligned.hlinux/delay.hlinux/device.hlinux/kernel.hlinux/hid.hlinux/idr.hlinux/input.hlinux/jiffies.hlinux/leds.hlinux/module.hlinux/power_supply.hlinux/spinlock.h
Detected Declarations
struct joycon_rumble_freq_datastruct joycon_rumble_amp_datastruct joycon_stick_calstruct joycon_imu_calstruct joycon_ctlr_button_mappingstruct joycon_rumble_outputstruct joycon_subcmd_requeststruct joycon_subcmd_replystruct joycon_imu_datastruct joycon_input_reportstruct joycon_ctlrenum joycon_ctlr_stateenum joycon_ctlr_typeenum joycon_msg_typefunction joycon_device_is_chrggripfunction controllersfunction joycon_type_is_right_joyconfunction joycon_type_is_proconfunction joycon_type_is_snesconfunction joycon_type_is_genconfunction joycon_type_is_n64confunction joycon_type_is_left_nesconfunction joycon_type_is_right_nesconfunction joycon_type_is_any_joyconfunction joycon_type_is_any_nesconfunction joycon_has_imufunction joycon_has_joysticksfunction joycon_has_rumblefunction joycon_using_usbfunction __joycon_hid_sendfunction joycon_wait_for_input_reportfunction joycon_enforce_subcmd_ratefunction joycon_hid_send_syncfunction joycon_send_usbfunction joycon_send_subcmdfunction joycon_set_player_ledsfunction joycon_set_home_ledfunction joycon_request_spi_flash_readfunction joycon_check_for_cal_magicfunction joycon_read_stick_calibrationfunction joycon_use_default_calibrationfunction joycon_request_calibrationfunction joycon_calc_imu_cal_divisorsfunction joycon_request_imu_calibrationfunction joycon_set_report_modefunction joycon_enable_rumblefunction joycon_enable_imufunction joycon_map_stick_val
Annotated Snippet
module_init(nintendo_init);
module_exit(nintendo_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ryan McClelland <rymcclel@gmail.com>");
MODULE_AUTHOR("Emily Strickland <linux@emily.st>");
MODULE_AUTHOR("Daniel J. Ogorchock <djogorchock@gmail.com>");
MODULE_DESCRIPTION("Driver for Nintendo Switch Controllers");
Annotation
- Immediate include surface: `hid-ids.h`, `linux/unaligned.h`, `linux/delay.h`, `linux/device.h`, `linux/kernel.h`, `linux/hid.h`, `linux/idr.h`, `linux/input.h`.
- Detected declarations: `struct joycon_rumble_freq_data`, `struct joycon_rumble_amp_data`, `struct joycon_stick_cal`, `struct joycon_imu_cal`, `struct joycon_ctlr_button_mapping`, `struct joycon_rumble_output`, `struct joycon_subcmd_request`, `struct joycon_subcmd_reply`, `struct joycon_imu_data`, `struct joycon_input_report`.
- Atlas domain: Driver Families / drivers/hid.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.