mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-15 19:13:10 +00:00
Fill the magnitude field of dynamically generated device entries.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4420 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
b33986c2ac
commit
1bd9212065
1 file changed
+25
+25
@@ -37,6 +37,29 @@ char sensors_sysfs_mount[NAME_MAX];
|
|||||||
|
|
||||||
#define MAX_SENSORS_PER_TYPE 16
|
#define MAX_SENSORS_PER_TYPE 16
|
||||||
|
|
||||||
|
static
|
||||||
|
int get_type_scaling(int type)
|
||||||
|
{
|
||||||
|
switch (type & 0xFF10) {
|
||||||
|
case SENSORS_FEATURE_IN:
|
||||||
|
case SENSORS_FEATURE_TEMP:
|
||||||
|
return 3;
|
||||||
|
case SENSORS_FEATURE_FAN:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case SENSORS_FEATURE_VID:
|
||||||
|
return 3;
|
||||||
|
case SENSORS_FEATURE_VRM:
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
sensors_chip_features sensors_read_dynamic_chip(struct sysfs_device *sysdir)
|
sensors_chip_features sensors_read_dynamic_chip(struct sysfs_device *sysdir)
|
||||||
{
|
{
|
||||||
@@ -149,6 +172,8 @@ sensors_chip_features sensors_read_dynamic_chip(struct sysfs_device *sysdir)
|
|||||||
SENSORS_MODE_R : (attr->method & SYSFS_METHOD_STORE) ?
|
SENSORS_MODE_R : (attr->method & SYSFS_METHOD_STORE) ?
|
||||||
SENSORS_MODE_W : SENSORS_MODE_NO_RW;
|
SENSORS_MODE_W : SENSORS_MODE_NO_RW;
|
||||||
|
|
||||||
|
feature.scaling = get_type_scaling(type);
|
||||||
|
|
||||||
features[i] = feature;
|
features[i] = feature;
|
||||||
fnum++;
|
fnum++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user