60 lines
3.2 KiB
C
60 lines
3.2 KiB
C
#ifndef BOARD_SENSORS_H
|
|
#define BOARD_SENSORS_H
|
|
|
|
#include <stdio.h>
|
|
|
|
#define MAX_SENSOR_NAME_LENGTH 256
|
|
|
|
struct hwmon_sensor {
|
|
char *driver_name; /* Contents of /sys/class/hwmon/hwmonX/name */
|
|
char *sensor_file_name; /* Sysfs file to read */
|
|
char *name_prefix; /* Prefix to attach to temp*_label for clarity */
|
|
char *short_name; /* 'Category' name when using compact mode */
|
|
char *units; /* Units string */
|
|
float divisor; /* Divisor to convert temp* to units */
|
|
float bad_value; /* Raw value that indicates a bad (missing) sensor TODO: verfiy most of these*/
|
|
};
|
|
|
|
/* Note the order here matters, it's the order these will be printed in */
|
|
static struct hwmon_sensor hwmon_sensor_info[] =
|
|
{
|
|
{"zenpower", "temp1", "CPU ", "CPU", "°C", 1000.0, -40.0 }, /* Tdie */
|
|
{"asusec", "temp2", "Motherboard ", "CPU", "°C", 1000.0, -40.0 }, /* CPU */
|
|
{"zenpower", "temp3", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd1 */
|
|
{"zenpower", "temp4", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd2 */
|
|
{"zenpower", "temp5", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd3 */
|
|
{"zenpower", "temp6", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd4 */
|
|
{"zenpower", "temp7", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd5 */
|
|
{"zenpower", "temp8", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd6 */
|
|
{"zenpower", "temp9", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd7 */
|
|
{"zenpower", "temp10", "CPU ", "CCD", "°C", 1000.0, -40.0 }, /* Tccd8 */
|
|
{"zen-rapl", "", "CPU ", "POW", " W", 0.0, 0.0 }, /* Zen RAPL placeholder */
|
|
{"asusec", "temp1", "Motherboard ", "CHIP", "°C", 1000.0, -40.0 }, /* Chipset */
|
|
{"asusec", "temp5", "Motherboard ", "VRM", "°C", 1000.0, -40.0 }, /* VRM */
|
|
{"asusec", "temp3", "", "MOBO", "°C", 1000.0, -40.0 }, /* Motherboard */
|
|
{"asusec", "temp4", "Motherboard ", "SENS", "°C", 1000.0, -40.0 }, /* T_Sensor */
|
|
{"asusec", "temp6", "Motherboard ", "H2O", "°C", 1000.0, -40.0 }, /* Water_In */
|
|
{"asusec", "temp7", "Motherboard ", "H2O", "°C", 1000.0, -40.0 }, /* Water_Out */
|
|
{"nvme", "temp1", "NVMe ", "NVME", "°C", 1000.0, -40.0 }, /* NVME Composite */
|
|
{"nct6798", "fan2", "CPU fan", "CPU", "%", 15.0, 0.0 }, /* cpu_fan, cpu mid */
|
|
{"asusec", "fan1", "", "CPU", "%", 15.0, 0.0 }, /* cpu_opt, cpu front */
|
|
{"nct6798", "fan5", "H amp", "CHA", "%", 12.0, 0.0 }, /* h_amp, front fan */
|
|
{"nct6798", "fan3", "Chassis 2", "CHA", "%", 12.0, 0.0 }, /* cha2, top front */
|
|
{"nct6798", "fan1", "Chassis 1", "CHA", "%", 12.0, 0.0 }, /* cha1, top rear */
|
|
{"nct6798", "fan4", "Chassis 3", "CHA", "%", 13.0, 0.0 }, /* cha3, rear */
|
|
{"nct6798", "fan6", "AIO pump", "CHA", "%", 12.0, 0.0 }, /* aio_pump? */
|
|
{"nct6798", "fan7", "W pump", "CHA", "%", 12.0, 0.0 }, /* w_pump+? */
|
|
{"asusec", "fan2", "", "CHIP", "%", 35.0, 0.0 }, /* chipset */
|
|
};
|
|
|
|
struct hwmon_avail_sensor {
|
|
char *sensor_name; /* Sensor name as read from the sysfs file */
|
|
int sort_index; /* Sort index for order to display in */
|
|
char *file; /* File to read from */
|
|
struct hwmon_sensor *sensor_info; /* Associated sensor info struct */
|
|
};
|
|
|
|
int find_board_sensors(struct hwmon_avail_sensor *board_sensors, int max_sensors);
|
|
int get_sensor_reading(struct hwmon_avail_sensor *sensor, float *reading);
|
|
|
|
#endif |