drivers/hid/hid-playstation.c
Source file repositories/reference/linux-study-clean/drivers/hid/hid-playstation.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/hid-playstation.c- Extension
.c- Size
- 94073 bytes
- Lines
- 2991
- 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
linux/bitfield.hlinux/bits.hlinux/cleanup.hlinux/crc32.hlinux/device.hlinux/hid.hlinux/idr.hlinux/input/mt.hlinux/leds.hlinux/led-class-multicolor.hlinux/module.hlinux/unaligned.hhid-ids.h
Detected Declarations
struct ps_devicestruct ps_calibration_datastruct ps_led_infostruct dualsensestruct dualsense_touch_pointstruct dualsense_input_reportstruct dualsense_output_report_commonstruct dualsense_output_report_btstruct dualsense_output_report_usbstruct dualsense_output_reportstruct dualshock4struct dualshock4_touch_pointstruct dualshock4_touch_reportstruct dualshock4_input_report_commonstruct dualshock4_input_report_usbstruct dualshock4_input_report_btstruct dualshock4_output_report_commonstruct dualshock4_output_report_usbstruct dualshock4_output_report_btstruct dualshock4_output_reportenum PS_TYPEenum dualshock4_dongle_statefunction ps_devices_list_addfunction list_for_each_entryfunction ps_devices_list_removefunction ps_device_set_player_idfunction ps_device_release_player_idfunction ps_battery_get_propertyfunction scoped_guardfunction ps_device_register_batteryfunction ps_check_crc32function ps_gamepad_createfunction ps_get_reportfunction ps_led_registerfunction ps_lightbar_registerfunction firmware_version_showfunction hardware_version_showfunction dualsense_get_calibration_datafunction dualsense_get_firmware_infofunction dualsense_get_mac_addressfunction dualsense_lightbar_set_brightnessfunction dualsense_player_led_get_brightnessfunction dualsense_player_led_set_brightnessfunction scoped_guardfunction dualsense_init_output_reportfunction dualsense_schedule_workfunction dualsense_send_output_reportfunction dualsense_output_worker
Annotated Snippet
module_init(ps_init);
module_exit(ps_exit);
MODULE_AUTHOR("Sony Interactive Entertainment");
MODULE_DESCRIPTION("HID Driver for PlayStation peripherals.");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/cleanup.h`, `linux/crc32.h`, `linux/device.h`, `linux/hid.h`, `linux/idr.h`, `linux/input/mt.h`.
- Detected declarations: `struct ps_device`, `struct ps_calibration_data`, `struct ps_led_info`, `struct dualsense`, `struct dualsense_touch_point`, `struct dualsense_input_report`, `struct dualsense_output_report_common`, `struct dualsense_output_report_bt`, `struct dualsense_output_report_usb`, `struct dualsense_output_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.