All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] Patch: libsensors: add support for ACPI bus
Date: Thu, 01 Jan 2009 21:51:56 +0000	[thread overview]
Message-ID: <495D3AFC.5040809@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

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

[-- Attachment #2: lm_sensors-3.0.3-acpi-bus.patch --]
[-- Type: text/plain, Size: 1986 bytes --]

Index: lib/access.c
===================================================================
--- lib/access.c	(revision 5577)
+++ lib/access.c	(working copy)
@@ -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 */
Index: lib/sensors.h
===================================================================
--- lib/sensors.h	(revision 5577)
+++ lib/sensors.h	(working copy)
@@ -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)
 
Index: lib/sysfs.c
===================================================================
--- lib/sysfs.c	(revision 5577)
+++ lib/sysfs.c	(working copy)
@@ -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;
Index: lib/data.c
===================================================================
--- lib/data.c	(revision 5577)
+++ lib/data.c	(working copy)
@@ -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;

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

             reply	other threads:[~2009-01-01 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-01 21:51 Hans de Goede [this message]
2009-01-12 12:14 ` [lm-sensors] Patch: libsensors: add support for ACPI bus Jean Delvare
2009-01-13  8:08 ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=495D3AFC.5040809@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.