drivers/hwmon/max6697.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/max6697.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/max6697.c- Extension
.c- Size
- 17453 bytes
- Lines
- 640
- 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/bits.hlinux/err.hlinux/hwmon.hlinux/i2c.hlinux/init.hlinux/module.hlinux/of.hlinux/regmap.hlinux/slab.h
Detected Declarations
struct max6697_chip_datastruct max6697_dataenum chipsfunction max6697_alarm_channel_mapfunction max6697_readfunction max6697_writefunction max6697_is_visiblefunction max6697_config_offunction max6697_init_chipfunction max6697_volatile_regfunction max6697_writeable_regfunction max6697_probe
Annotated Snippet
struct max6697_chip_data {
int channels;
u32 have_ext;
u32 have_crit;
u32 have_fault;
u8 valid_conf;
};
struct max6697_data {
struct regmap *regmap;
enum chips type;
const struct max6697_chip_data *chip;
int temp_offset; /* in degrees C */
#define MAX6697_TEMP_INPUT 0
#define MAX6697_TEMP_EXT 1
#define MAX6697_TEMP_MAX 2
#define MAX6697_TEMP_CRIT 3
u32 alarms;
};
static const struct max6697_chip_data max6697_chip_data[] = {
[max6581] = {
.channels = 8,
.have_crit = 0xff,
.have_ext = 0x7f,
.have_fault = 0xfe,
.valid_conf = MAX6581_CONF_EXTENDED | MAX6697_CONF_TIMEOUT,
},
[max6602] = {
.channels = 5,
.have_crit = 0x12,
.have_ext = 0x02,
.have_fault = 0x1e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6697_CONF_TIMEOUT,
},
[max6622] = {
.channels = 5,
.have_crit = 0x12,
.have_ext = 0x02,
.have_fault = 0x1e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6697_CONF_TIMEOUT,
},
[max6636] = {
.channels = 7,
.have_crit = 0x72,
.have_ext = 0x02,
.have_fault = 0x7e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6697_CONF_TIMEOUT,
},
[max6689] = {
.channels = 7,
.have_crit = 0x72,
.have_ext = 0x02,
.have_fault = 0x7e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6697_CONF_TIMEOUT,
},
[max6693] = {
.channels = 7,
.have_crit = 0x72,
.have_ext = 0x02,
.have_fault = 0x7e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6693_CONF_BETA |
MAX6697_CONF_TIMEOUT,
},
[max6694] = {
.channels = 5,
.have_crit = 0x12,
.have_ext = 0x02,
.have_fault = 0x1e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6693_CONF_BETA |
MAX6697_CONF_TIMEOUT,
},
[max6697] = {
.channels = 7,
.have_crit = 0x72,
.have_ext = 0x02,
.have_fault = 0x7e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6697_CONF_TIMEOUT,
},
[max6698] = {
.channels = 7,
.have_crit = 0x72,
.have_ext = 0x02,
.have_fault = 0x0e,
.valid_conf = MAX6697_CONF_RESISTANCE | MAX6697_CONF_TIMEOUT,
},
[max6699] = {
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/err.h`, `linux/hwmon.h`, `linux/i2c.h`, `linux/init.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `struct max6697_chip_data`, `struct max6697_data`, `enum chips`, `function max6697_alarm_channel_map`, `function max6697_read`, `function max6697_write`, `function max6697_is_visible`, `function max6697_config_of`, `function max6697_init_chip`, `function max6697_volatile_reg`.
- 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.