Skip to contentSkip to conversation

Patch: libsensors: add support for ACPI bus

lm-sensors Hans de Goede 2 participants 3 messages Jan 1, 2009 – Jan 13, 2009

lore
Share & tools
lore
#0 lore raw

Hi All,

The way the new atk0110 driver work it ends up being connected to an "ACPI" bus, this patch adds support for this to lm_sensors-3.0.3

With this patch the sensors output on an Asus board looks like this:

atk0110-acpi-0
Adapter: ACPI interface
Vcore Voltage: +1.45 V (min = +1.45 V, max = +1.75 V)

 +3.3 Voltage:          +3.38 V  (min =  +3.00 V, max =  +3.60 V)
 +5.0 Voltage:          +5.16 V  (min =  +4.50 V, max =  +5.50 V)
+12.0 Voltage:         +12.24 V  (min = +11.20 V, max = +13.20 V)
CPU FAN Speed:         1516 RPM  (min =    0 RPM)
CHASSIS FAN Speed:        0 RPM  (min =    0 RPM)
POWER FAN Speed:          0 RPM  (min =    0 RPM)
CHASSIS4 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CHASSIS2 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CHASSIS3 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CPU Temperature:        +43.0°C  (high = +90.0°C, crit = +125.0°C)
MB Temperature:         +44.0°C  (high = +45.0°C, crit = +90.0°C)

Jean, can you please review this patch, if its ok I can apply it myself.

Thanks & Regards,

Hans

p.s.

Also see my related (to be written) ACPI versus native IC drivers post

access.c +2 -0
Index: lib/access.c
===================================================================
@@ -349,6 +349,8 @@
 		return "SPI adapter";
 	case SENSORS_BUS_TYPE_VIRTUAL:
 		return "Virtual device";
+	case SENSORS_BUS_TYPE_ACPI:
+		return "ACPI interface";
 	}
 
 	/* bus types with several instances */
sensors.h +1 -0
Index: lib/sensors.h
===================================================================
@@ -42,6 +42,7 @@
 #define SENSORS_BUS_TYPE_PCI		2
 #define SENSORS_BUS_TYPE_SPI		3
 #define SENSORS_BUS_TYPE_VIRTUAL	4
+#define SENSORS_BUS_TYPE_ACPI		5
 #define SENSORS_BUS_NR_ANY		(-1)
 #define SENSORS_BUS_NR_IGNORE		(-2)
 
sysfs.c +5 -0
Index: lib/sysfs.c
===================================================================
@@ -596,6 +596,11 @@
 			entry.chip.addr = 0;
 		entry.chip.bus.type = SENSORS_BUS_TYPE_ISA;
 		entry.chip.bus.nr = 0;
+	} else if (subsys && !strcmp(subsys, "acpi")) {
+		entry.chip.bus.type = SENSORS_BUS_TYPE_ACPI;
+		/* For now we assume that acpi devices are unique */
+		entry.chip.bus.nr = 0;
+		entry.chip.addr = 0;
 	} else {
 		/* Ignore unknown device */
 		err = 0;
data.c +5 -0
Index: lib/data.c
===================================================================
@@ -111,6 +111,8 @@
 		res->bus.type = SENSORS_BUS_TYPE_SPI;
 	else if (!strncmp(name, "virtual", dash - name))
 		res->bus.type = SENSORS_BUS_TYPE_VIRTUAL;
+	else if (!strncmp(name, "acpi", dash - name))
+		res->bus.type = SENSORS_BUS_TYPE_ACPI;
 	else
 		goto ERROR;
 	name = dash + 1;
@@ -174,6 +176,9 @@
 	case SENSORS_BUS_TYPE_VIRTUAL:
 		return snprintf(str, size, "%s-virtual-%x", chip->prefix,
 				chip->addr);
+	case SENSORS_BUS_TYPE_ACPI:
+		return snprintf(str, size, "%s-acpi-%x", chip->prefix,
+				chip->addr);
 	}
 
 	return -SENSORS_ERR_CHIP_NAME;

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw

Hi Hans,

Sorry for the late answer.

Quoted 21 lines · Hans de Goede

The way the new atk0110 driver work it ends up being connected to an "ACPI" bus, this patch adds support for this to lm_sensors-3.0.3

With this patch the sensors output on an Asus board looks like this:

atk0110-acpi-0
Adapter: ACPI interface
Vcore Voltage: +1.45 V (min = +1.45 V, max = +1.75 V)

  +3.3 Voltage:          +3.38 V  (min =  +3.00 V, max =  +3.60 V)
  +5.0 Voltage:          +5.16 V  (min =  +4.50 V, max =  +5.50 V)
+12.0 Voltage:         +12.24 V  (min = +11.20 V, max = +13.20 V)
CPU FAN Speed:         1516 RPM  (min =    0 RPM)
CHASSIS FAN Speed:        0 RPM  (min =    0 RPM)
POWER FAN Speed:          0 RPM  (min =    0 RPM)
CHASSIS4 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CHASSIS2 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CHASSIS3 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CPU Temperature:        +43.0°C  (high = +90.0°C, crit = +125.0°C)
MB Temperature:         +44.0°C  (high = +45.0°C, crit = +90.0°C)
Quoted 1 line

Jean, can you please review this patch, if its ok I can apply it myself.

I have no objection, the patch looks just fine to me, just go ahead and apply it. Please don't forget to apply the libsensors-API document.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Hans de Goede
Quoted 26 lines · Jean Delvare

Hi Hans,

Sorry for the late answer.

Quoted 21 lines · Hans de Goede

The way the new atk0110 driver work it ends up being connected to an "ACPI" bus, this patch adds support for this to lm_sensors-3.0.3

With this patch the sensors output on an Asus board looks like this:

atk0110-acpi-0
Adapter: ACPI interface
Vcore Voltage: +1.45 V (min = +1.45 V, max = +1.75 V)

  +3.3 Voltage:          +3.38 V  (min =  +3.00 V, max =  +3.60 V)
  +5.0 Voltage:          +5.16 V  (min =  +4.50 V, max =  +5.50 V)
+12.0 Voltage:         +12.24 V  (min = +11.20 V, max = +13.20 V)
CPU FAN Speed:         1516 RPM  (min =    0 RPM)
CHASSIS FAN Speed:        0 RPM  (min =    0 RPM)
POWER FAN Speed:          0 RPM  (min =    0 RPM)
CHASSIS4 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CHASSIS2 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CHASSIS3 FAN FAN Speed:   0 RPM  (min =    0 RPM)
CPU Temperature:        +43.0°C  (high = +90.0°C, crit = +125.0°C)
MB Temperature:         +44.0°C  (high = +45.0°C, crit = +90.0°C)
Quoted 5 lines
Quoted 1 line

Jean, can you please review this patch, if its ok I can apply it myself.

I have no objection, the patch looks just fine to me, just go ahead and apply it. Please don't forget to apply the libsensors-API document.

Thanks for the review, API doc updated and committed.

Regards,

Hans

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors