From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (w83627ehf) Properly report thermal
Date: Thu, 13 Oct 2011 23:59:50 +0000 [thread overview]
Message-ID: <20111013235950.GA16967@ericsson.com> (raw)
In-Reply-To: <20111013214908.2afa26d6@endymion.delvare>
On Thu, Oct 13, 2011 at 03:49:08PM -0400, Jean Delvare wrote:
> The w83627ehf driver is improperly reporting thermal diode sensors as
> type 2, instead of 3. This caused "sensors" and possibly other
> monitoring tools to report these sensors as "transistor" instead of
> "thermal diode".
>
> Furthermore, diode subtype selection (CPU vs. external) is only
> supported by the original W83627EHF/EHG. All later models only support
> CPU diode type, and some (NCT6776F) don't even have the register in
> question so we should avoid reading from it.
>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Cc: stable@kernel.org
Good catch. Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/w83627ehf.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> --- linux-3.1-rc9.orig/drivers/hwmon/w83627ehf.c 2011-10-13 18:21:43.000000000 +0200
> +++ linux-3.1-rc9/drivers/hwmon/w83627ehf.c 2011-10-13 21:40:13.000000000 +0200
> @@ -1718,7 +1718,8 @@ static void w83627ehf_device_remove_file
> }
>
> /* Get the monitoring functions started */
> -static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data)
> +static inline void __devinit w83627ehf_init_device(struct w83627ehf_data *data,
> + enum kinds kind)
> {
> int i;
> u8 tmp, diode;
> @@ -1749,10 +1750,16 @@ static inline void __devinit w83627ehf_i
> w83627ehf_write_value(data, W83627EHF_REG_VBAT, tmp | 0x01);
>
> /* Get thermal sensor types */
> - diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE);
> + switch (kind) {
> + case w83627ehf:
> + diode = w83627ehf_read_value(data, W83627EHF_REG_DIODE);
> + break;
> + default:
> + diode = 0x70;
> + }
> for (i = 0; i < 3; i++) {
> if ((tmp & (0x02 << i)))
> - data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 2;
> + data->temp_type[i] = (diode & (0x10 << i)) ? 1 : 3;
> else
> data->temp_type[i] = 4; /* thermistor */
> }
> @@ -2084,7 +2091,7 @@ static int __devinit w83627ehf_probe(str
> }
>
> /* Initialize the chip */
> - w83627ehf_init_device(data);
> + w83627ehf_init_device(data, sio_data->kind);
>
> data->vrm = vid_which_vrm();
> superio_enter(sio_data->sioreg);
>
>
> --
> Jean Delvare
>
> _______________________________________________
> lm-sensors mailing list
> lm-sensors@lm-sensors.org
> http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2011-10-13 23:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 19:49 [lm-sensors] [PATCH] hwmon: (w83627ehf) Properly report thermal Jean Delvare
2011-10-13 23:59 ` Guenter Roeck [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=20111013235950.GA16967@ericsson.com \
--to=guenter.roeck@ericsson.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.