/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * tmon.h contains data structures and constants used by TMON * * Copyright (C) 2012 Intel Corporation. All rights reserved. * * Author Name Jacob Pan <jacob.jun.pan@linux.intel.com>
*/
#ifndef TMON_H #define TMON_H
#define MAX_DISP_TEMP 125 #define MAX_CTRL_TEMP 105 #define MIN_CTRL_TEMP 40 #define MAX_NR_TZONE 16 #define MAX_NR_CDEV 32 #define MAX_NR_TRIP 16 #define MAX_NR_CDEV_TRIP 12 /* number of cooling devices that can bind * to a thermal zone trip.
*/ #define MAX_TEMP_KC 140000 /* starting char position to draw sensor data, such as tz names * trip point list, etc.
*/ #define DATA_LEFT_ALIGN 10 #define NR_LINES_TZDATA 1 #define TMON_LOG_FILE "/var/tmp/tmon.log"
#include <sys/time.h> #include <pthread.h>
externunsignedlong ticktime; externdouble time_elapsed; externunsignedlong target_temp_user; externint dialogue_on; externchar ctrl_cdev[]; extern pthread_mutex_t input_lock; externint tmon_exit; externint target_thermal_zone; /* use fixed size record to simplify data processing and transfer * TBD: more info to be added, e.g. programmable trip point data.
*/ struct thermal_data_record { struct timeval tv; unsignedlong temp[MAX_NR_TZONE]; double pid_out_pct;
};
struct trip_point { enum trip_type type; unsignedlong temp; unsignedlong 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]; unsignedlong cdev_binding; /* bitmap for attached cdevs */ /* cdev bind trip points, allow one cdev bind to multiple trips */ unsignedlong 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;
};
/* 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;
/* each thermal zone uses 12 chars, 8 for name, 2 for instance, 2 space * also used to list trip points in forms of AAAC, which represents * A: Active * C: Critical
*/ #define TZONE_RECORD_SIZE 12 #define TZ_LEFT_ALIGN 32 #define CDEV_NAME_SIZE 20 #define CDEV_FLAG_IN_CONTROL (1 << 0)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.