drivers/hwmon/peci/common.h
Source file repositories/reference/linux-study-clean/drivers/hwmon/peci/common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/peci/common.h- Extension
.h- Size
- 1308 bytes
- Lines
- 56
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct peci_sensor_statestruct peci_sensor_datafunction peci_sensor_need_updatefunction peci_sensor_mark_updated
Annotated Snippet
struct peci_sensor_state {
bool valid;
unsigned long last_updated;
};
/**
* struct peci_sensor_data - PECI sensor information
* @value: sensor value in milli units
* @state: sensor update state
*/
struct peci_sensor_data {
s32 value;
struct peci_sensor_state state;
};
/**
* peci_sensor_need_update() - check whether sensor update is needed or not
* @sensor: pointer to sensor data struct
*
* Return: true if update is needed, false if not.
*/
static inline bool peci_sensor_need_update(struct peci_sensor_state *state)
{
return !state->valid ||
time_after(jiffies, state->last_updated + PECI_HWMON_UPDATE_INTERVAL);
}
/**
* peci_sensor_mark_updated() - mark the sensor is updated
* @sensor: pointer to sensor data struct
*/
static inline void peci_sensor_mark_updated(struct peci_sensor_state *state)
{
state->valid = true;
state->last_updated = jiffies;
}
#endif /* __PECI_HWMON_COMMON_H */
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct peci_sensor_state`, `struct peci_sensor_data`, `function peci_sensor_need_update`, `function peci_sensor_mark_updated`.
- 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.