drivers/hwmon/nzxt-smart2.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/nzxt-smart2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/nzxt-smart2.c- Extension
.c- Size
- 20384 bytes
- Lines
- 834
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- 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/hid.hlinux/hwmon.hlinux/math.hlinux/module.hlinux/mutex.hlinux/spinlock.hlinux/wait.hasm/byteorder.hlinux/unaligned.h
Detected Declarations
struct unknown_static_datastruct fan_config_reportstruct fan_status_reportstruct set_fan_speed_reportstruct drvdatafunction scale_pwm_valuefunction handle_fan_config_reportfunction handle_fan_status_reportfunction nzxt_smart2_hwmon_is_visiblefunction nzxt_smart2_hwmon_readfunction casesfunction send_output_reportfunction set_pwmfunction set_pwm_enablefunction update_interval_to_control_bytefunction control_byte_to_update_intervalfunction set_update_intervalfunction init_devicefunction nzxt_smart2_hwmon_writefunction nzxt_smart2_hwmon_read_stringfunction nzxt_smart2_hid_raw_eventfunction nzxt_smart2_hid_reset_resumefunction nzxt_smart2_hid_probefunction nzxt_smart2_hid_removefunction nzxt_smart2_initfunction nzxt_smart2_exit
Annotated Snippet
* With module_init()/module_hid_driver() and the driver built into the kernel:
*
* Driver 'nzxt_smart2' was unable to register with bus_type 'hid' because the
* bus was not initialized.
*/
late_initcall(nzxt_smart2_init);
module_exit(nzxt_smart2_exit);
Annotation
- Immediate include surface: `linux/hid.h`, `linux/hwmon.h`, `linux/math.h`, `linux/module.h`, `linux/mutex.h`, `linux/spinlock.h`, `linux/wait.h`, `asm/byteorder.h`.
- Detected declarations: `struct unknown_static_data`, `struct fan_config_report`, `struct fan_status_report`, `struct set_fan_speed_report`, `struct drvdata`, `function scale_pwm_value`, `function handle_fan_config_report`, `function handle_fan_status_report`, `function nzxt_smart2_hwmon_is_visible`, `function nzxt_smart2_hwmon_read`.
- Atlas domain: Driver Families / drivers/hwmon.
- 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.