From: "Pali Rohár" <pali.rohar@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Arnd Bergmann <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/10] i8k: Add support for fan labels
Date: Mon, 22 Dec 2014 09:07:36 +0100 [thread overview]
Message-ID: <201412220907.37405@pali> (raw)
In-Reply-To: <5497515D.9060106@roeck-us.net>
[-- Attachment #1: Type: Text/Plain, Size: 1246 bytes --]
On Monday 22 December 2014 00:01:49 Guenter Roeck wrote:
> > +static ssize_t i8k_hwmon_show_fan_label(struct device *dev,
> > + struct device_attribute *devattr,
> > + char *buf)
> > +{
> > + static const char * const labels[] = {
> > + "Processor Fan",
> > + "Motherboard Fan",
> > + "Video Fan",
> > + "Power Supply Fan",
> > + "Chipset Fan",
> > + "Other Fan",
> > + };
> > + int index = to_sensor_dev_attr(devattr)->index;
> > + bool dock = false;
> > + int type;
> > +
> > + type = i8k_get_fan_type(index);
> > + if (type < 0)
> > + return type;
> > +
> > + if (type & 0x10) {
> > + dock = true;
> > + type &= 0x0F;
> > + }
> > +
>
> What if bit 5..7 is set ? This would result in a result of
> "other fan", which given the above does not seem to be
> correct. Given that, I wonder why the type mask is only
> applied if bit 4 is set and not unconditionally.
>
> Thanks,
> Guenter
>
NBSVC.MDM maps values 0x0-0x5 to exactly to strings in labels[].
Next it maps 0x10-0x15 to values same values in strings labels[]
but with prefix "Docking". I do not see nothing more in NBSVC.MDM
so for other values is "Other Fan" better than nothing.
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2014-12-22 8:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-21 19:54 [PATCH 00/10] i8k patches Pali Rohár
2014-12-21 19:54 ` [PATCH 01/10] i8k: Add support for temperature sensor labels Pali Rohár
2014-12-21 19:54 ` [PATCH 02/10] i8k: Register only temperature sensors which have labels Pali Rohár
2014-12-21 19:54 ` [PATCH 03/10] i8k: Return -ENODATA for invalid temperature Pali Rohár
2014-12-21 19:54 ` [PATCH 04/10] MAINTAINERS: Fix up entry for Dell laptop SMM driver Pali Rohár
2014-12-21 19:54 ` [PATCH 05/10] i8k: Rework error retries Pali Rohár
2014-12-21 19:54 ` [PATCH 06/10] i8k: Add support for Dell XPS 13 Pali Rohár
2014-12-21 19:54 ` [PATCH 07/10] i8k: Make fan module parameters an unsigned Pali Rohár
2014-12-21 19:54 ` [PATCH 08/10] i8k: Autodetect maximal fan speed and fan RPM multiplier Pali Rohár
2014-12-21 22:58 ` Guenter Roeck
2014-12-21 19:54 ` [PATCH 09/10] i8k: Remove DMI config data for Latitude E6440 and E6540 Pali Rohár
2014-12-21 22:58 ` Guenter Roeck
2014-12-21 19:54 ` [PATCH 10/10] i8k: Add support for fan labels Pali Rohár
2014-12-21 23:01 ` Guenter Roeck
2014-12-22 8:07 ` Pali Rohár [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=201412220907.37405@pali \
--to=pali.rohar@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox