drivers/hwmon/fam15h_power.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/fam15h_power.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/fam15h_power.c- Extension
.c- Size
- 12777 bytes
- Lines
- 500
- 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.
- 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/err.hlinux/hwmon.hlinux/hwmon-sysfs.hlinux/init.hlinux/module.hlinux/pci.hlinux/bitops.hlinux/cpu.hlinux/cpumask.hlinux/time.hlinux/sched.hlinux/topology.hasm/processor.hasm/cpuid/api.hasm/msr.h
Detected Declarations
struct fam15h_power_datafunction is_carrizo_or_laterfunction power1_input_showfunction power1_crit_showfunction do_read_registers_on_cufunction read_registersfunction for_each_online_cpufunction power1_average_showfunction power1_average_interval_showfunction power1_average_interval_storefunction fam15h_power_init_attrsfunction should_load_on_this_nodefunction tweak_runavg_rangefunction fam15h_power_resumefunction fam15h_power_init_datafunction fam15h_power_probe
Annotated Snippet
static struct pci_driver fam15h_power_driver = {
.name = "fam15h_power",
.id_table = fam15h_power_id_table,
.probe = fam15h_power_probe,
.driver.pm = &fam15h_power_ops,
};
module_pci_driver(fam15h_power_driver);
Annotation
- Immediate include surface: `linux/err.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`, `linux/init.h`, `linux/module.h`, `linux/pci.h`, `linux/bitops.h`, `linux/cpu.h`.
- Detected declarations: `struct fam15h_power_data`, `function is_carrizo_or_later`, `function power1_input_show`, `function power1_crit_show`, `function do_read_registers_on_cu`, `function read_registers`, `function for_each_online_cpu`, `function power1_average_show`, `function power1_average_interval_show`, `function power1_average_interval_store`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: pattern implementation candidate.
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.