drivers/hwmon/smpro-hwmon.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/smpro-hwmon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/smpro-hwmon.c- Extension
.c- Size
- 9954 bytes
- Lines
- 467
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/bitops.hlinux/hwmon.hlinux/hwmon-sysfs.hlinux/kernel.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/property.hlinux/regmap.h
Detected Declarations
struct smpro_hwmonstruct smpro_sensorfunction smpro_read_tempfunction smpro_read_infunction smpro_read_currfunction smpro_read_powerfunction smpro_readfunction smpro_read_stringfunction smpro_is_visiblefunction smpro_hwmon_probe
Annotated Snippet
struct smpro_hwmon {
struct regmap *regmap;
};
struct smpro_sensor {
const u8 reg;
const u8 reg_ext;
const char *label;
};
static const struct smpro_sensor temperature[] = {
{
.reg = SOC_TEMP,
.label = "temp1 SoC"
},
{
.reg = SOC_VRD_TEMP,
.reg_ext = SOC_VR_HOT_THRESHOLD,
.label = "temp2 SoC VRD"
},
{
.reg = DIMM_VRD_TEMP,
.label = "temp3 DIMM VRD"
},
{
.reg = CORE_VRD_TEMP,
.label = "temp4 CORE VRD"
},
{
.reg = CH0_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp5 CH0 DIMM"
},
{
.reg = CH1_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp6 CH1 DIMM"
},
{
.reg = CH2_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp7 CH2 DIMM"
},
{
.reg = CH3_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp8 CH3 DIMM"
},
{
.reg = CH4_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp9 CH4 DIMM"
},
{
.reg = CH5_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp10 CH5 DIMM"
},
{
.reg = CH6_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp11 CH6 DIMM"
},
{
.reg = CH7_DIMM_TEMP,
.reg_ext = MEM_HOT_THRESHOLD,
.label = "temp12 CH7 DIMM"
},
{
.reg = RCA_VRD_TEMP,
.label = "temp13 RCA VRD"
},
};
static const struct smpro_sensor voltage[] = {
{
.reg = CORE_VRD_VOLT,
.label = "vout0 CORE VRD"
},
{
.reg = SOC_VRD_VOLT,
.label = "vout1 SoC VRD"
},
{
.reg = DIMM_VRD1_VOLT,
.label = "vout2 DIMM VRD1"
},
{
.reg = DIMM_VRD2_VOLT,
.label = "vout3 DIMM VRD2"
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bitops.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`, `linux/kernel.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`.
- Detected declarations: `struct smpro_hwmon`, `struct smpro_sensor`, `function smpro_read_temp`, `function smpro_read_in`, `function smpro_read_curr`, `function smpro_read_power`, `function smpro_read`, `function smpro_read_string`, `function smpro_is_visible`, `function smpro_hwmon_probe`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: source 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.