drivers/hwmon/vt8231.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/vt8231.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/vt8231.c- Extension
.c- Size
- 30901 bytes
- Lines
- 1065
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/module.hlinux/init.hlinux/slab.hlinux/pci.hlinux/jiffies.hlinux/platform_device.hlinux/hwmon.hlinux/hwmon-sysfs.hlinux/err.hlinux/mutex.hlinux/acpi.hlinux/io.h
Detected Declarations
struct vt8231_datafunction FAN_TO_REGfunction fan_from_regfunction vt8231_read_valuefunction vt8231_write_valuefunction in_showfunction in_min_showfunction in_max_showfunction in_min_storefunction in_max_storefunction in5_input_showfunction in5_min_showfunction in5_max_showfunction in5_min_storefunction in5_max_storefunction temp1_input_showfunction temp1_max_showfunction temp1_max_hyst_showfunction temp1_max_storefunction temp1_max_hyst_storefunction temp_showfunction temp_max_showfunction temp_min_showfunction temp_max_storefunction temp_min_storefunction fan_showfunction fan_min_showfunction fan_div_showfunction fan_min_storefunction fan_div_storefunction alarms_showfunction alarm_showfunction name_showfunction vt8231_init_devicefunction vt8231_probefunction vt8231_removefunction vt8231_device_addfunction vt8231_pci_probefunction sm_vt8231_initfunction sm_vt8231_exitmodule init sm_vt8231_init
Annotated Snippet
static struct pci_driver vt8231_pci_driver = {
.name = DRIVER_NAME,
.id_table = vt8231_pci_ids,
.probe = vt8231_pci_probe,
};
static int __init sm_vt8231_init(void)
{
return pci_register_driver(&vt8231_pci_driver);
}
static void __exit sm_vt8231_exit(void)
{
pci_unregister_driver(&vt8231_pci_driver);
if (s_bridge != NULL) {
platform_device_unregister(pdev);
platform_driver_unregister(&vt8231_driver);
pci_dev_put(s_bridge);
s_bridge = NULL;
}
}
MODULE_AUTHOR("Roger Lucas <vt8231@hiddenengine.co.uk>");
MODULE_DESCRIPTION("VT8231 sensors");
MODULE_LICENSE("GPL");
module_init(sm_vt8231_init);
module_exit(sm_vt8231_exit);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/slab.h`, `linux/pci.h`, `linux/jiffies.h`, `linux/platform_device.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`.
- Detected declarations: `struct vt8231_data`, `function FAN_TO_REG`, `function fan_from_reg`, `function vt8231_read_value`, `function vt8231_write_value`, `function in_show`, `function in_min_show`, `function in_max_show`, `function in_min_store`, `function in_max_store`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: pattern 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.