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.

Dependency Surface

Detected Declarations

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

Implementation Notes