drivers/hwmon/lm93.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/lm93.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/lm93.c- Extension
.c- Size
- 78718 bytes
- Lines
- 2650
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/module.hlinux/init.hlinux/slab.hlinux/i2c.hlinux/hwmon.hlinux/hwmon-sysfs.hlinux/hwmon-vid.hlinux/err.hlinux/delay.hlinux/jiffies.h
Detected Declarations
struct block1_tstruct lm93_dataenum pwm_freqfunction LM93_VID_FROM_REGfunction LM93_IN_FROM_REGfunction LM93_IN_TO_REGfunction LM93_IN_REL_FROM_REGfunction LM93_IN_REL_TO_REGfunction LM93_TEMP_FROM_REGfunction LM93_TEMP_TO_REGfunction LM93_TEMP_OFFSET_MODE_FROM_REGfunction LM93_TEMP_OFFSET_FROM_REGfunction LM93_TEMP_OFFSET_TO_REGfunction LM93_TEMP_AUTO_OFFSET_FROM_REGfunction LM93_TEMP_AUTO_OFFSET_TO_REGfunction LM93_AUTO_BOOST_HYST_FROM_REGSfunction LM93_AUTO_BOOST_HYST_TO_REGfunction LM93_PWM_FROM_REGfunction LM93_PWM_TO_REGfunction LM93_FAN_FROM_REGfunction LM93_FAN_TO_REGfunction LM93_PWM_FREQ_FROM_REGfunction LM93_PWM_FREQ_TO_REGfunction LM93_SPINUP_TIME_FROM_REGfunction LM93_SPINUP_TIME_TO_REGfunction LM93_RAMP_FROM_REGfunction LM93_RAMP_TO_REGfunction LM93_PROCHOT_TO_REGfunction LM93_INTERVAL_FROM_REGfunction LM93_INTERVAL_TO_REGfunction LM93_GPI_FROM_REGfunction LM93_ALARMS_FROM_REGfunction lm93_read_bytefunction lm93_write_bytefunction lm93_read_wordfunction lm93_write_wordfunction lm93_read_blockfunction lm93_update_client_commonfunction lm93_update_client_fullfunction lm93_update_client_minfunction in_showfunction in_min_showfunction in_min_storefunction in_max_showfunction in_max_storefunction temp_showfunction temp_min_showfunction temp_min_store
Annotated Snippet
struct block1_t {
u8 host_status_1;
u8 host_status_2;
u8 host_status_3;
u8 host_status_4;
u8 p1_prochot_status;
u8 p2_prochot_status;
u8 gpi_status;
u8 fan_status;
};
/*
* Client-specific data
*/
struct lm93_data {
struct i2c_client *client;
struct mutex update_lock;
unsigned long last_updated; /* In jiffies */
/* client update function */
void (*update)(struct lm93_data *, struct i2c_client *);
bool valid; /* true if following fields are valid */
/* register values, arranged by block read groups */
struct block1_t block1;
/*
* temp1 - temp4: unfiltered readings
* temp1 - temp2: filtered readings
*/
u8 block2[6];
/* vin1 - vin16: readings */
u8 block3[16];
/* prochot1 - prochot2: readings */
struct {
u8 cur;
u8 avg;
} block4[2];
/* fan counts 1-4 => 14-bits, LE, *left* justified */
u16 block5[4];
/* block6 has a lot of data we don't need */
struct {
u8 min;
u8 max;
} temp_lim[4];
/* vin1 - vin16: low and high limits */
struct {
u8 min;
u8 max;
} block7[16];
/* fan count limits 1-4 => same format as block5 */
u16 block8[4];
/* pwm control registers (2 pwms, 4 regs) */
u8 block9[2][4];
/* auto/pwm base temp and offset temp registers */
struct {
u8 base[4];
u8 offset[12];
} block10;
/* master config register */
u8 config;
/* VID1 & VID2 => register format, 6-bits, right justified */
u8 vid[2];
/* prochot1 - prochot2: limits */
u8 prochot_max[2];
/* vccp1 & vccp2 (in7 & in8): VID relative limits (register format) */
u8 vccp_limits[2];
/* GPIO input state (register format, i.e. inverted) */
u8 gpi;
/* #PROCHOT override (register format) */
u8 prochot_override;
/* #PROCHOT intervals (register format) */
u8 prochot_interval;
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/slab.h`, `linux/i2c.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`, `linux/hwmon-vid.h`, `linux/err.h`.
- Detected declarations: `struct block1_t`, `struct lm93_data`, `enum pwm_freq`, `function LM93_VID_FROM_REG`, `function LM93_IN_FROM_REG`, `function LM93_IN_TO_REG`, `function LM93_IN_REL_FROM_REG`, `function LM93_IN_REL_TO_REG`, `function LM93_TEMP_FROM_REG`, `function LM93_TEMP_TO_REG`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.