tools/thermal/tmon/tmon.h
Source file repositories/reference/linux-study-clean/tools/thermal/tmon/tmon.h
File Facts
- System
- Linux kernel
- Corpus path
tools/thermal/tmon/tmon.h- Extension
.h- Size
- 5204 bytes
- Lines
- 199
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sys/time.hpthread.h
Detected Declarations
struct thermal_data_recordstruct cdev_infostruct trip_pointstruct tz_infostruct tmon_platform_datastruct control_opsstruct pid_paramsenum trip_typeenum cdev_typesenum tzone_types
Annotated Snippet
struct thermal_data_record {
struct timeval tv;
unsigned long temp[MAX_NR_TZONE];
double pid_out_pct;
};
struct cdev_info {
char type[64];
int instance;
unsigned long max_state;
unsigned long cur_state;
unsigned long flag;
};
enum trip_type {
THERMAL_TRIP_CRITICAL,
THERMAL_TRIP_HOT,
THERMAL_TRIP_PASSIVE,
THERMAL_TRIP_ACTIVE,
NR_THERMAL_TRIP_TYPE,
};
struct trip_point {
enum trip_type type;
unsigned long temp;
unsigned long hysteresis;
int attribute; /* programmability etc. */
};
/* thermal zone configuration information, binding with cooling devices could
* change at runtime.
*/
struct tz_info {
char type[256]; /* e.g. acpitz */
int instance;
int passive; /* active zone has passive node to force passive mode */
int nr_cdev; /* number of cooling device binded */
int nr_trip_pts;
struct trip_point tp[MAX_NR_TRIP];
unsigned long cdev_binding; /* bitmap for attached cdevs */
/* cdev bind trip points, allow one cdev bind to multiple trips */
unsigned long trip_binding[MAX_NR_CDEV];
};
struct tmon_platform_data {
int nr_tz_sensor;
int nr_cooling_dev;
/* keep track of instance ids since there might be gaps */
int max_tz_instance;
int max_cdev_instance;
struct tz_info *tzi;
struct cdev_info *cdi;
};
struct control_ops {
void (*set_ratio)(unsigned long ratio);
unsigned long (*get_ratio)(unsigned long ratio);
};
enum cdev_types {
CDEV_TYPE_PROC,
CDEV_TYPE_FAN,
CDEV_TYPE_MEM,
CDEV_TYPE_NR,
};
/* REVISIT: the idea is to group sensors if possible, e.g. on intel mid
* we have "skin0", "skin1", "sys", "msicdie"
* on DPTF enabled systems, we might have PCH, TSKN, TAMB, etc.
*/
enum tzone_types {
TZONE_TYPE_ACPI,
TZONE_TYPE_PCH,
TZONE_TYPE_NR,
};
/* limit the output of PID controller adjustment */
#define LIMIT_HIGH (95)
#define LIMIT_LOW (2)
struct pid_params {
double kp; /* Controller gain from Dialog Box */
double ki; /* Time-constant for I action from Dialog Box */
double kd; /* Time-constant for D action from Dialog Box */
double ts;
double k_lpf;
double t_target;
double y_k;
Annotation
- Immediate include surface: `sys/time.h`, `pthread.h`.
- Detected declarations: `struct thermal_data_record`, `struct cdev_info`, `struct trip_point`, `struct tz_info`, `struct tmon_platform_data`, `struct control_ops`, `struct pid_params`, `enum trip_type`, `enum cdev_types`, `enum tzone_types`.
- Atlas domain: Support Tooling And Documentation / tools.
- 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.