From: Gabriel C <crazy@frugalware.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Asus atk0110 driver
Date: Mon, 30 Jun 2008 22:20:06 +0000 [thread overview]
Message-ID: <48695C16.5090807@frugalware.org> (raw)
In-Reply-To: <20080618212629.GA7917@dreamland.darkstar.lan>
Luca Tettamanti wrote:
> Il Mon, Jun 23, 2008 at 11:06:01AM +0200, Jean Delvare ha scritto:
>> Hi Gabriel,
>>
>> On Sun, 22 Jun 2008 18:15:51 +0200, Gabriel C wrote:
>>> I've tested the driver with linux-next on my P5E-VM DO motherboard.
>>>
>>> The driver seems to work , the values / data in /sys/class/hwmon/hwmon0/device/*
>>> seems to be the same like what the BIOS reports.
>>>
>>> However how do I get sensors to display the data from atk driver ?
>>> I guess I have to patch lm-sensors ?
>> For lm-sensors 2.10.x, yes, you'd need to patch libsensors and sensors
>> and virtually every monitoring application out there.
>>
>> But the preferred solution is to just upgrade to lm-sensors 3.0.x,
>> which automatically detects the device features, so every new driver is
>> supported right away.
>
> Not really, the hwmon device is linked directly to the ACPI node in the
> sysfs hierarchy (via subsystem link): lm-sensors just ignores it.
>
> Patch is simple enough though:
>
> ---
> Makefile | 6 +++---
> lib/access.c | 2 ++
> lib/data.c | 5 +++++
> lib/sensors.h | 1 +
> lib/sysfs.c | 5 +++++
> 5 files changed, 16 insertions(+), 3 deletions(-)
>
> Index: lib/access.c
> =================================> --- lib/access.c (revision 5296)
> +++ 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 device";
> }
>
> /* bus types with several instances */
> Index: lib/sensors.h
> =================================> --- lib/sensors.h (revision 5296)
> +++ 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 5296)
> +++ lib/sysfs.c (working copy)
> @@ -579,6 +579,11 @@
> entry.chip.addr = 0;
> entry.chip.bus.type = SENSORS_BUS_TYPE_ISA;
> entry.chip.bus.nr = 0;
> + } else
> + if ((!subsys || !strcmp(subsys, "acpi")) &&
> + sscanf(dev_name, "%*[a-zA-Z0-9_]:%d", &entry.chip.addr) = 1) {
> + entry.chip.bus.type = SENSORS_BUS_TYPE_ACPI;
> + entry.chip.bus.nr = 0;
> } else {
> /* Ignore unknown device */
> err = 0;
> Index: lib/data.c
> =================================> --- lib/data.c (revision 5296)
> +++ 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;
>
> With the patch applied sensors is able to display all the data:
>
> atk0110-acpi-0
> Adapter: ACPI device
> Vcore Voltage: +1.12 V (min = +0.85 V, max = +1.60 V)
> +3.3 Voltage: +3.31 V (min = +2.97 V, max = +3.63 V)
> +5 Voltage: +5.12 V (min = +4.50 V, max = +5.50 V)
> +12 Voltage: +12.41 V (min = +10.20 V, max = +13.80 V)
> CPU FAN Speed: 2860 RPM (min = 600 RPM)
> CHASSIS1 FAN Speed: 0 RPM (min = 800 RPM)
> CHASSIS2 FAN Speed: 0 RPM (min = 800 RPM)
> POWER FAN Speed: 0 RPM (min = 800 RPM)
> CPU Temperature: +48.5°C (high = +60.0°C, crit = +95.0°C)
> MB Temperature: +42.0°C (high = +45.0°C, crit = +95.0°C)
Works fine here too , thx Luca :)
>
>>> Luca what do you think about creating a proper patch for the driver too and send it over to
>>> Greg to be included in his linux-staging tree ? I think that way it will get more testing.
>
> Will do ;)
Thx again :)
>
> Luca
Gabriel
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2008-06-30 22:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-18 21:26 [lm-sensors] Asus atk0110 driver Luca Tettamanti
2008-06-19 7:16 ` Jean Delvare
2008-06-22 16:15 ` Gabriel C
2008-06-23 9:06 ` Jean Delvare
2008-06-23 12:41 ` Gabriel C
2008-06-23 13:48 ` Jean Delvare
2008-06-30 19:58 ` Luca Tettamanti
2008-06-30 22:20 ` Gabriel C [this message]
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=48695C16.5090807@frugalware.org \
--to=crazy@frugalware.org \
--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.