mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-10 17:02:26 +07:00
Add ISA ACPI sensor driver name support
ACPI hwmon sensor driver name has a different format such as APMC0D29:00 APMC0D29:01 compared with DTB. This patch supports this format and gives the correct device address as below apm_xgene-isa-0000 => APMC0D29:00 Adapter: ISA adapter SoC Temperature: +35.0°C CPU power: 11.00 W IO power: 20.00 W apm_xgene-isa-0001 => APMC0D29:01 Adapter: ISA adapter SoC Temperature: +33.0°C CPU power: 13.00 W IO power: 23.83 W Signed-off-by: Hoan Tran <hoan@os.amperecomputing.com>
This commit is contained in:
committed by
Ondřej Lysoněk
parent
347bdf9491
commit
00a5fadd2e
+3
-3
@@ -663,7 +663,7 @@ static int classify_device(const char *dev_name,
|
||||
if ((!subsys || !strcmp(subsys, "platform") ||
|
||||
!strcmp(subsys, "of_platform"))) {
|
||||
/* must be new ISA (platform driver) */
|
||||
if (sscanf(dev_name, "%*[a-z0-9_].%d", &entry->chip.addr) != 1)
|
||||
if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &entry->chip.addr) != 1)
|
||||
entry->chip.addr = 0;
|
||||
entry->chip.bus.type = SENSORS_BUS_TYPE_ISA;
|
||||
entry->chip.bus.nr = 0;
|
||||
@@ -938,7 +938,7 @@ int sensors_read_sysfs_attr(const sensors_chip_name *name,
|
||||
if (res == EOF) {
|
||||
if (errno == EIO)
|
||||
return -SENSORS_ERR_IO;
|
||||
else
|
||||
else
|
||||
return -SENSORS_ERR_ACCESS_R;
|
||||
}
|
||||
*value /= get_type_scaling(subfeature->type);
|
||||
@@ -972,7 +972,7 @@ int sensors_write_sysfs_attr(const sensors_chip_name *name,
|
||||
if (res == EOF) {
|
||||
if (errno == EIO)
|
||||
return -SENSORS_ERR_IO;
|
||||
else
|
||||
else
|
||||
return -SENSORS_ERR_ACCESS_W;
|
||||
}
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user