From: "Pali Rohár" <pali.rohar@gmail.com>
To: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>, Arnd Bergmann <arnd@arndb.de>,
Steven Honeyman <stevenhoneyman@gmail.com>,
linux-kernel@vger.kernel.org,
Gabriele Mazzotta <gabriele.mzt@gmail.com>,
Jean Delvare <jdelvare@suse.de>
Subject: Re: [PATCH] i8k: Add support for temperature sensor labels
Date: Sat, 29 Nov 2014 19:04:07 +0100 [thread overview]
Message-ID: <201411291904.07644@pali> (raw)
In-Reply-To: <20141129175152.GA32510@kroah.com>
[-- Attachment #1: Type: Text/Plain, Size: 3462 bytes --]
On Saturday 29 November 2014 18:51:52 Greg Kroah-Hartman wrote:
> On Sat, Nov 29, 2014 at 06:49:43PM +0100, Pali Rohár wrote:
> > On Saturday 29 November 2014 18:43:15 Greg Kroah-Hartman
wrote:
> > > On Sat, Nov 29, 2014 at 05:04:07PM +0100, Pali Rohár wrote:
> > > > This patch adds labels for temperature sensors if SMM
> > > > function with EAX register 0x11a3 reports it. These
> > > > informations was taken from DOS binary NBSVC.MDM.
> > > >
> > > > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > > > ---
> > > >
> > > > drivers/char/i8k.c | 110
> > > > +++++++++++++++++++++++++++++++++++++++++----------- 1
> > > > file changed, 88 insertions(+), 22 deletions(-)
> > > >
> > > > diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
> > > > index e34a019..77af46b 100644
> > > > --- a/drivers/char/i8k.c
> > > > +++ b/drivers/char/i8k.c
> > > > @@ -42,6 +42,7 @@
> > > >
> > > > #define I8K_SMM_GET_FAN 0x00a3
> > > > #define I8K_SMM_GET_SPEED 0x02a3
> > > > #define I8K_SMM_GET_TEMP 0x10a3
> > > >
> > > > +#define I8K_SMM_GET_TEMP_TYPE 0x11a3
> > > >
> > > > #define I8K_SMM_GET_DELL_SIG1 0xfea3
> > > > #define I8K_SMM_GET_DELL_SIG2 0xffa3
> > > >
> > > > @@ -288,6 +289,14 @@ static int i8k_set_fan(int fan, int
> > > > speed)
> > > >
> > > > return i8k_smm(®s) ? : i8k_get_fan_status(fan);
> > > >
> > > > }
> > > >
> > > > +static int i8k_get_temp_type(int sensor)
> > > > +{
> > > > + struct smm_regs regs = { .eax = I8K_SMM_GET_TEMP_TYPE,
> > > > }; +
> > > > + regs.ebx = sensor & 0xff;
> > > > + return i8k_smm(®s) ? : regs.eax & 0xff;
> > > > +}
> > > > +
> > > >
> > > > /*
> > > >
> > > > * Read the cpu temperature.
> > > > */
> > > >
> > > > @@ -493,6 +502,29 @@ static int i8k_open_fs(struct inode
> > > > *inode, struct file *file)
> > > >
> > > > * Hwmon interface
> > > > */
> > > >
> > > > +static ssize_t i8k_hwmon_show_temp_label(struct device
> > > > *dev, + struct device_attribute *devattr,
> > > > + char *buf)
> > > > +{
> > > > + static const char * const labels[] = {
> > > > + "CPU",
> > > > + "GPU",
> > > > + "SODIMM",
> > > > + "Other",
> > > > + "Ambient",
> > > > + "Other",
> > > > + };
> > > > + int index = to_sensor_dev_attr(devattr)->index;
> > > > + int type;
> > > > +
> > > > + type = i8k_get_temp_type(index);
> > > > + if (type < 0)
> > > > + return type;
> > > > + if (type >= ARRAY_SIZE(labels))
> > > > + type = ARRAY_SIZE(labels) - 1;
> > > > + return sprintf(buf, "%s\n", labels[type]);
> > > > +}
> > >
> > > No Documentation/ABI/ entry for your new sysfs file?
> >
> > It is standard hwmon sysfs entry which is used by other
> > hwmon drivers... It is not i8k.ko driver specific.
>
> Ok, then why is this driver not in a "hwmon-standard" location
> in the kernel tree?
>
> greg k-h
This is question not for me but for maintainers of hwmon and char
trees... I just contributed patch for existing driver.
But my idea is that because this driver exported temperature data
for a long time only via /proc/i8k character file (since 2.4? or
earlier?) and only 3 years ago was added standard hwmon interface
to existing code (949a9d70020defd7c241607ab3ed037ea88f551c).
So now there are both interfaces. Standard hwmon and old /proc/.
CCing Jean Delvare (author of hwmon i8k code)
--
Pali Rohár
pali.rohar@gmail.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2014-11-29 18:04 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-29 16:04 [PATCH] i8k: Add support for temperature sensor labels Pali Rohár
2014-11-29 16:09 ` Pali Rohár
2014-11-29 16:24 ` Guenter Roeck
2014-11-29 16:32 ` Pali Rohár
2014-11-29 16:37 ` Steven Honeyman
2014-11-29 17:07 ` Gabriele Mazzotta
2014-11-29 17:18 ` Pali Rohár
2014-11-29 18:27 ` Gabriele Mazzotta
2014-11-29 18:58 ` Guenter Roeck
2014-11-29 19:07 ` Pali Rohár
2014-11-29 21:34 ` Guenter Roeck
2014-11-30 0:07 ` Guenter Roeck
2014-11-30 9:53 ` Pali Rohár
2014-11-30 16:00 ` Guenter Roeck
2014-11-30 17:44 ` Pali Rohár
2014-11-30 17:54 ` Guenter Roeck
2014-11-30 18:00 ` Pali Rohár
2014-11-30 18:22 ` Guenter Roeck
2014-11-30 1:25 ` Guenter Roeck
2014-11-30 10:11 ` Pali Rohár
2014-11-30 16:04 ` Guenter Roeck
2014-11-29 16:24 ` Guenter Roeck
2014-11-29 16:30 ` Pali Rohár
2014-11-29 18:15 ` Guenter Roeck
2014-11-29 17:43 ` Greg Kroah-Hartman
2014-11-29 17:49 ` Pali Rohár
2014-11-29 17:51 ` Greg Kroah-Hartman
2014-11-29 18:04 ` Pali Rohár [this message]
2014-12-02 13:23 ` Jean Delvare
2014-12-02 14:26 ` Guenter Roeck
2014-12-03 9:09 ` Jean Delvare
2014-12-03 9:25 ` Pali Rohár
2014-12-03 10:11 ` Jean Delvare
2014-12-03 19:14 ` Guenter Roeck
2014-12-04 10:16 ` Jean Delvare
2014-11-29 18:05 ` Guenter Roeck
2014-11-29 18:00 ` Guenter Roeck
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=201411291904.07644@pali \
--to=pali.rohar@gmail.com \
--cc=arnd@arndb.de \
--cc=gabriele.mzt@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jdelvare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=stevenhoneyman@gmail.com \
/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