From: Hans de Goede <j.w.r.degoede@hhs.nl>
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] PATCH:
Date: Wed, 31 Oct 2007 08:42:38 +0000 [thread overview]
Message-ID: <47283FFE.4000105@hhs.nl> (raw)
In-Reply-To: <46F3DD44.4070307@hhs.nl>
[-- Attachment #1: Type: text/plain, Size: 858 bytes --]
Hi All,
As discussed on the lm-sensors list, using the fixed scaling factors from the
fscpos datasheet for the fscher and newer models as wel, was nood a good idea,
as the actual scaling factors may be different and can be read from OEM DMI
entries.
This patch changes the behaviour of the merged FSC familiy fschmd driver to be
the same as the old standalone fscher driver for fscher and newer models,
leaving the scaling to userspace.
This also preserves compatibility of existing sensors.conf files.
Signed-of-by: Hans de Goede <j.w.r.degoede@hhs.nl>
---
Jean, can you review this please?
Mark, can you send this to Linus for 2.6.24 please, otherwise we will have one
official kernel release with different scaling for the voltage inputs of the
fschmd compared to the next releases.
And yes I tested my patch this time.
Thanks & Regards,
Hans
[-- Attachment #2: hwmon-fschmd-fscher-and-newer-no-fixed-scaling.patch --]
[-- Type: text/x-patch, Size: 1730 bytes --]
As discussed on the lm-sensors list, using the fixed scaling factors from the
fscpos datasheet for the fscher and newer models as wel, was nood a good idea,
as the actual scaling factors may be different and can be read from OEM DMI
entries.
This patch changes the behaviour of the merged FSC familiy fschmd driver to be
the same as the old standalone fscher driver for fscher and newer models,
leaving the scaling to userspace.
This also preserves compatibility of existing sensors.conf files.
Signed-of-by: Hans de Goede <j.w.r.degoede@hhs.nl>
diff -up linux-2.6.24-rc1-git7/drivers/hwmon/fschmd.c~ linux-2.6.24-rc1-git7/drivers/hwmon/fschmd.c
--- linux-2.6.24-rc1-git7/drivers/hwmon/fschmd.c~ 2007-10-30 22:30:43.000000000 +0100
+++ linux-2.6.24-rc1-git7/drivers/hwmon/fschmd.c 2007-10-30 22:30:43.000000000 +0100
@@ -221,8 +221,17 @@ static ssize_t show_in_value(struct devi
int index = to_sensor_dev_attr(devattr)->index;
struct fschmd_data *data = fschmd_update_device(dev);
- return sprintf(buf, "%d\n", (data->volt[index] *
- max_reading[index] + 128) / 255);
+ /* Only use fixed scaling factor for the fscpos and fscscy, the newer
+ models have the scaling factors stored in the BIOS DMI tables, so
+ here we use a scale of 10mv / step like the standalone fscher driver
+ does (did) and let userspace do the real scaling. There is a
+ userspace utility called fscher-dmi2compute to generate the proper
+ compute lines from the DMI info for the fscher and newer chips. */
+ if (data->kind == (fscpos - 1) || data->kind == (fscscy - 1))
+ return sprintf(buf, "%d\n", (data->volt[index] *
+ max_reading[index] + 128) / 255);
+ else
+ return sprintf(buf, "%d\n", data->volt[index] * 10);
}
[-- 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
next prev parent reply other threads:[~2007-10-31 8:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-21 15:03 [lm-sensors] PATCH: Hans de Goede
2007-09-24 14:28 ` Jean Delvare
2007-10-07 8:19 ` Jean Delvare
2007-10-07 11:37 ` Hans de Goede
2007-10-07 18:24 ` Mark M. Hoffman
2007-10-07 18:28 ` Mark M. Hoffman
2007-10-07 20:41 ` Jean Delvare
2007-10-07 22:05 ` Jean Delvare
2007-10-31 8:42 ` Hans de Goede [this message]
2007-10-31 15:17 ` Jean Delvare
2007-11-01 23:00 ` Jean Delvare
2007-11-02 7:35 ` Hans de Goede
2007-11-02 9:44 ` Jean Delvare
2007-11-02 19:41 ` Hans de Goede
2007-11-03 16:29 ` Jean Delvare
2007-11-04 13:21 ` Hans de Goede
2007-12-17 15:56 ` Hans de Goede
2007-12-18 13:29 ` Jean Delvare
2008-06-30 14:53 ` Hans de Goede
2009-01-30 10:29 ` Hans de Goede
2009-01-30 11:06 ` Jean Delvare
-- strict thread matches above, loose matches on Subject: below --
2006-06-28 12:35 [lm-sensors] Patch: Jean Delvare
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=47283FFE.4000105@hhs.nl \
--to=j.w.r.degoede@hhs.nl \
--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.