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.

Dependency Surface

Detected Declarations

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

Implementation Notes