mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-25 12:14:33 +00:00
Add support for temperature offset files, which are part of the
standard sysfs interface. I don't think it makes much sense to display the offset values as part of the output of "sensors" (it would even probably confuse people) but having support for these in libsensors makes it possible to adjust the offsets in sensors.conf, which is convenient. This closes ticket #2248. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4769 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
6b3803c386
commit
61686376df
3 files changed
+5
-1
No files matched your search
@@ -521,6 +521,7 @@ static const struct feature_subtype_match temp_matches[] = {
|
||||
{ "crit_alarm", SENSORS_FEATURE_TEMP_CRIT_ALARM },
|
||||
{ "fault", SENSORS_FEATURE_TEMP_FAULT },
|
||||
{ "type", SENSORS_FEATURE_TEMP_TYPE },
|
||||
{ "offset", SENSORS_FEATURE_TEMP_OFFSET },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@ typedef enum sensors_feature_type {
|
||||
SENSORS_FEATURE_TEMP_CRIT_ALARM,
|
||||
SENSORS_FEATURE_TEMP_FAULT,
|
||||
SENSORS_FEATURE_TEMP_TYPE,
|
||||
SENSORS_FEATURE_TEMP_OFFSET,
|
||||
|
||||
SENSORS_FEATURE_VID = 0x1000,
|
||||
|
||||
|
||||
+3
-1
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
sysfs.c - Part of libsensors, a library for reading Linux sensor data
|
||||
Copyright (c) 2005 Mark M. Hoffman <mhoffman@lightlink.com>
|
||||
Copyright (C) 2007 Jean Delvare <khali@linux-fr.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -37,7 +38,7 @@
|
||||
char sensors_sysfs_mount[NAME_MAX];
|
||||
|
||||
#define MAX_SENSORS_PER_TYPE 20
|
||||
#define MAX_SUB_FEATURES 6
|
||||
#define MAX_SUB_FEATURES 7
|
||||
/* Room for all 3 types (in, fan, temp) with all their subfeatures + VID
|
||||
+ misc features */
|
||||
#define ALL_POSSIBLE_FEATURES (MAX_SENSORS_PER_TYPE * MAX_SUB_FEATURES * 6 \
|
||||
@@ -56,6 +57,7 @@ int get_type_scaling(int type)
|
||||
|
||||
switch (type) {
|
||||
case SENSORS_FEATURE_VID:
|
||||
case SENSORS_FEATURE_TEMP_OFFSET:
|
||||
return 1000;
|
||||
default:
|
||||
return 1;
|
||||
|
||||
Reference in new issue
Block a user