drivers/hwmon/lm90.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/lm90.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/lm90.c- Extension
.c- Size
- 89289 bytes
- Lines
- 3003
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/bits.hlinux/device.hlinux/err.hlinux/i2c.hlinux/init.hlinux/interrupt.hlinux/jiffies.hlinux/hwmon.hlinux/kstrtox.hlinux/module.hlinux/of.hlinux/regulator/consumer.hlinux/slab.hlinux/workqueue.h
Detected Declarations
struct lm90_paramsstruct lm90_dataenum chipsenum lm90_temp_reg_indexfunction lm90_write_no_pecfunction lm90_read_regfunction lm90_write_reg_addrfunction lm90_write_regfunction lm90_write16function lm90_read16function lm90_update_confregfunction lm90_select_remote_channelfunction lm90_write_convratefunction lm90_set_convratefunction lm90_set_faultqueuefunction lm90_update_limitsfunction lm90_report_alarmsfunction lm90_update_alarms_lockedfunction Otherwisefunction lm90_update_alarmsfunction lm90_alert_workfunction lm90_update_devicefunction lm90_temp_get_resolutionfunction lm90_temp_from_regfunction lm90_get_tempfunction lm90_temp_to_regfunction lm90_set_tempfunction lm90_get_temphystfunction lm90_set_temphystfunction lm90_get_temp_offsetfunction lm90_set_temp_offsetfunction lm90_temp_readfunction lm90_temp_writefunction lm90_temp_is_visiblefunction lm90_chip_readfunction lm90_chip_writefunction lm90_chip_is_visiblefunction lm90_readfunction lm90_read_stringfunction lm90_writefunction lm90_is_visiblefunction lm90_detectfunction lm90_restore_conffunction lm90_stop_workfunction scoped_guardfunction lm90_init_clientfunction lm90_is_trippedfunction lm90_irq_thread
Annotated Snippet
struct lm90_params {
u32 flags; /* Capabilities */
u16 alert_alarms; /* Which alarm bits trigger ALERT# */
/* Upper 8 bits for max6695/96 */
u8 max_convrate; /* Maximum conversion rate register value */
u8 resolution; /* 16-bit resolution (default 11 bit) */
u8 reg_status2; /* 2nd status register (optional) */
u8 reg_local_ext; /* Extended local temp register (optional) */
u8 faultqueue_mask; /* fault queue bit mask */
u8 faultqueue_depth; /* fault queue depth if mask is used */
};
static const struct lm90_params lm90_params[] = {
[adm1023] = {
.flags = LM90_HAVE_ALARMS | LM90_HAVE_OFFSET | LM90_HAVE_BROKEN_ALERT
| LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
| LM90_HAVE_REMOTE_EXT,
.alert_alarms = 0x7c,
.resolution = 8,
.max_convrate = 7,
},
[adm1032] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT
| LM90_HAVE_PARTIAL_PEC | LM90_HAVE_ALARMS
| LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
| LM90_HAVE_FAULTQUEUE,
.alert_alarms = 0x7c,
.max_convrate = 10,
},
[adt7461] = {
/*
* Standard temperature range is supposed to be unsigned,
* but that does not match reality. Negative temperatures
* are always reported.
*/
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
| LM90_HAVE_CRIT | LM90_HAVE_PARTIAL_PEC
| LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
| LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
.alert_alarms = 0x7c,
.max_convrate = 10,
.resolution = 10,
},
[adt7461a] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
| LM90_HAVE_CRIT | LM90_HAVE_PEC | LM90_HAVE_ALARMS
| LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
| LM90_HAVE_FAULTQUEUE,
.alert_alarms = 0x7c,
.max_convrate = 10,
},
[adt7481] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
| LM90_HAVE_UNSIGNED_TEMP | LM90_HAVE_PEC
| LM90_HAVE_TEMP3 | LM90_HAVE_CRIT | LM90_HAVE_LOW
| LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
| LM90_HAVE_FAULTQUEUE,
.alert_alarms = 0x1c7c,
.max_convrate = 11,
.resolution = 10,
.reg_status2 = ADT7481_REG_STATUS2,
},
[g781] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT
| LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
| LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
.alert_alarms = 0x7c,
.max_convrate = 7,
},
[lm84] = {
.flags = LM90_HAVE_ALARMS,
.resolution = 8,
},
[lm90] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
| LM90_HAVE_CRIT | LM90_HAVE_ALARMS | LM90_HAVE_LOW
| LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
| LM90_HAVE_FAULTQUEUE,
.alert_alarms = 0x7b,
.max_convrate = 9,
.faultqueue_mask = BIT(0),
.faultqueue_depth = 3,
},
[lm99] = {
.flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
Annotation
- Immediate include surface: `linux/bits.h`, `linux/device.h`, `linux/err.h`, `linux/i2c.h`, `linux/init.h`, `linux/interrupt.h`, `linux/jiffies.h`, `linux/hwmon.h`.
- Detected declarations: `struct lm90_params`, `struct lm90_data`, `enum chips`, `enum lm90_temp_reg_index`, `function lm90_write_no_pec`, `function lm90_read_reg`, `function lm90_write_reg_addr`, `function lm90_write_reg`, `function lm90_write16`, `function lm90_read16`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.