drivers/hwmon/mcp9982.c

Source file repositories/reference/linux-study-clean/drivers/hwmon/mcp9982.c

File Facts

System
Linux kernel
Corpus path
drivers/hwmon/mcp9982.c
Extension
.c
Size
29752 bytes
Lines
1014
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 mcp9982_features {
	const char	*name;
	u8		phys_channels;
	bool		hw_thermal_shutdown;
	bool		allow_apdd;
	bool		has_recd34;
};

static const struct mcp9982_features mcp9933_chip_config = {
	.name = "mcp9933",
	.phys_channels = 3,
	.hw_thermal_shutdown = false,
	.allow_apdd = true,
	.has_recd34 = false,
};

static const struct mcp9982_features mcp9933d_chip_config = {
	.name = "mcp9933d",
	.phys_channels = 3,
	.hw_thermal_shutdown = true,
	.allow_apdd = true,
	.has_recd34 = false,
};

static const struct mcp9982_features mcp9982_chip_config = {
	.name = "mcp9982",
	.phys_channels = 2,
	.hw_thermal_shutdown = false,
	.allow_apdd = false,
	.has_recd34 = false,
};

static const struct mcp9982_features mcp9982d_chip_config = {
	.name = "mcp9982d",
	.phys_channels = 2,
	.hw_thermal_shutdown = true,
	.allow_apdd = false,
	.has_recd34 = false,
};

static const struct mcp9982_features mcp9983_chip_config = {
	.name = "mcp9983",
	.phys_channels = 3,
	.hw_thermal_shutdown = false,
	.allow_apdd = false,
	.has_recd34 = true,
};

static const struct mcp9982_features mcp9983d_chip_config = {
	.name = "mcp9983d",
	.phys_channels = 3,
	.hw_thermal_shutdown = true,
	.allow_apdd = false,
	.has_recd34 = true,
};

static const struct mcp9982_features mcp9984_chip_config = {
	.name = "mcp9984",
	.phys_channels = 4,
	.hw_thermal_shutdown = false,
	.allow_apdd = true,
	.has_recd34 = true,
};

static const struct mcp9982_features mcp9984d_chip_config = {
	.name = "mcp9984d",
	.phys_channels = 4,
	.hw_thermal_shutdown = true,
	.allow_apdd = true,
	.has_recd34 = true,
};

static const struct mcp9982_features mcp9985_chip_config = {
	.name = "mcp9985",
	.phys_channels = 5,
	.hw_thermal_shutdown = false,
	.allow_apdd = true,
	.has_recd34 = true,
};

static const struct mcp9982_features mcp9985d_chip_config = {
	.name = "mcp9985d",
	.phys_channels = 5,
	.hw_thermal_shutdown = true,
	.allow_apdd = true,
	.has_recd34 = true,
};

static const unsigned int mcp9982_update_interval[11] = {
	16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16

Annotation

Implementation Notes