drivers/hwmon/hwmon.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/hwmon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/hwmon.c- Extension
.c- Size
- 35766 bytes
- Lines
- 1347
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/bitops.hlinux/device.hlinux/err.hlinux/gfp.hlinux/hwmon.hlinux/i2c.hlinux/idr.hlinux/kstrtox.hlinux/list.hlinux/module.hlinux/mutex.hlinux/pci.hlinux/property.hlinux/slab.hlinux/string.hlinux/thermal.htrace/events/hwmon.h
Detected Declarations
struct hwmon_devicestruct hwmon_device_attributestruct hwmon_thermal_datafunction name_showfunction label_showfunction hwmon_dev_attr_is_visiblefunction hwmon_free_attrsfunction hwmon_dev_releasefunction hwmon_is_visiblefunction hwmon_thermal_get_tempfunction hwmon_thermal_set_tripsfunction hwmon_thermal_remove_sensorfunction hwmon_thermal_add_sensorfunction hwmon_thermal_register_sensorsfunction hwmon_thermal_notifyfunction list_for_each_entryfunction hwmon_attr_basefunction hwmon_match_devicefunction pec_showfunction pec_storefunction hwmon_remove_pecfunction hwmon_pec_registerfunction hwmon_pec_registerfunction hwmon_attr_showfunction hwmon_attr_show_stringfunction hwmon_attr_storefunction is_string_attrfunction hwmon_notify_eventfunction hwmon_lockfunction hwmon_unlockfunction hwmon_num_channel_attrsfunction hwmon_genattrsfunction __hwmon_create_attrsfunction __hwmon_device_registerfunction hwmon_device_unregisterfunction hwmon_device_unregisterfunction hwmon_device_unregisterfunction hwmon_device_unregisterfunction hwmon_device_unregisterfunction devm_hwmon_releasefunction devm_hwmon_device_register_with_groupsfunction devm_hwmon_device_register_with_infofunction hwmon_pci_quirksfunction hwmon_initfunction hwmon_exitmodule init hwmon_initexport hwmon_notify_eventexport hwmon_lock
Annotated Snippet
subsys_initcall(hwmon_init);
module_exit(hwmon_exit);
MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
MODULE_DESCRIPTION("hardware monitoring sysfs/class support");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/device.h`, `linux/err.h`, `linux/gfp.h`, `linux/hwmon.h`, `linux/i2c.h`, `linux/idr.h`, `linux/kstrtox.h`.
- Detected declarations: `struct hwmon_device`, `struct hwmon_device_attribute`, `struct hwmon_thermal_data`, `function name_show`, `function label_show`, `function hwmon_dev_attr_is_visible`, `function hwmon_free_attrs`, `function hwmon_dev_release`, `function hwmon_is_visible`, `function hwmon_thermal_get_temp`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.