From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 6/6] I8K: add new BIOS signatures
Date: Wed, 27 Apr 2005 01:55:28 -0500 [thread overview]
Message-ID: <200504270155.28318.dtor_core@ameritech.net> (raw)
In-Reply-To: <200504270149.13450.dtor_core@ameritech.net>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2921 bytes --]
I8K: add BIOS signatures of a newer Dell laptops, also there can be
more than one temperature sensor reported by BIOS. Lifted from
driver 1.25 on Massimo Dal Zotto's site.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
i8k.c | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
Index: dtor/drivers/char/i8k.c
===================================================================
--- dtor.orig/drivers/char/i8k.c
+++ dtor/drivers/char/i8k.c
@@ -35,7 +35,8 @@
#define I8K_SMM_GET_FAN 0x00a3
#define I8K_SMM_GET_SPEED 0x02a3
#define I8K_SMM_GET_TEMP 0x10a3
-#define I8K_SMM_GET_DELL_SIG 0xffa3
+#define I8K_SMM_GET_DELL_SIG1 0xfea3
+#define I8K_SMM_GET_DELL_SIG2 0xffa3
#define I8K_SMM_BIOS_VERSION 0x00a6
#define I8K_FAN_MULT 30
@@ -226,7 +227,7 @@ static int i8k_set_fan(int fan, int spee
/*
* Read the cpu temperature.
*/
-static int i8k_get_cpu_temp(void)
+static int i8k_get_temp(int sensor)
{
struct smm_regs regs = { .eax = I8K_SMM_GET_TEMP, };
int rc;
@@ -235,7 +236,7 @@ static int i8k_get_cpu_temp(void)
#ifdef I8K_TEMPERATURE_BUG
static int prev;
#endif
-
+ regs.ebx = sensor & 0xff;
if ((rc = i8k_smm(®s)) < 0)
return rc;
@@ -260,9 +261,9 @@ static int i8k_get_cpu_temp(void)
return temp;
}
-static int i8k_get_dell_signature(void)
+static int i8k_get_dell_signature(int req_fn)
{
- struct smm_regs regs = { .eax = I8K_SMM_GET_DELL_SIG, };
+ struct smm_regs regs = { .eax = req_fn, };
int rc;
if ((rc = i8k_smm(®s)) < 0)
@@ -301,7 +302,7 @@ static int i8k_ioctl(struct inode *ip, s
break;
case I8K_GET_TEMP:
- val = i8k_get_cpu_temp();
+ val = i8k_get_temp(0);
break;
case I8K_GET_SPEED:
@@ -367,7 +368,7 @@ static int i8k_proc_show(struct seq_file
int fn_key, cpu_temp, ac_power;
int left_fan, right_fan, left_speed, right_speed;
- cpu_temp = i8k_get_cpu_temp(); /* 11100 µs */
+ cpu_temp = i8k_get_temp(0); /* 11100 µs */
left_fan = i8k_get_fan_status(I8K_FAN_LEFT); /* 580 µs */
right_fan = i8k_get_fan_status(I8K_FAN_RIGHT); /* 580 µs */
left_speed = i8k_get_fan_speed(I8K_FAN_LEFT); /* 580 µs */
@@ -421,6 +422,20 @@ static struct dmi_system_id __initdata i
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
},
},
+ {
+ .ident = "Dell Inspiron 2",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"),
+ },
+ },
+ {
+ .ident = "Dell Latitude 2",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
+ },
+ },
{ }
};
@@ -451,7 +466,8 @@ static int __init i8k_probe(void)
/*
* Get SMM Dell signature
*/
- if (i8k_get_dell_signature() != 0) {
+ if (i8k_get_dell_signature(I8K_SMM_GET_DELL_SIG1) &&
+ i8k_get_dell_signature(I8K_SMM_GET_DELL_SIG2)) {
printk(KERN_ERR "i8k: unable to get SMM Dell signature\n");
if (!force)
return -ENODEV;
prev parent reply other threads:[~2005-04-27 7:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-27 6:49 [PATCH 0/6] I8K and Toshiba legacy driver cleanup Dmitry Torokhov
2005-04-27 6:50 ` [PATCH 1/6] Toshiba " Dmitry Torokhov
2005-04-27 7:33 ` Andrew Morton
2005-04-27 13:42 ` Dmitry Torokhov
2005-04-28 4:58 ` Dmitry Torokhov
2005-04-27 6:52 ` [PATCH 2/6] I8K: pass through lindent Dmitry Torokhov
2005-04-27 6:52 ` [PATCH 3/6] I8K: use standard DMI interface Dmitry Torokhov
2005-04-28 5:02 ` Dmitry Torokhov
2005-04-27 6:53 ` [PATCH 4/6] I8K: convert to seqfile Dmitry Torokhov
2005-04-27 6:54 ` [PATCH 5/6] I8K: initialization code cleanup; formatting Dmitry Torokhov
2005-04-27 6:55 ` Dmitry Torokhov [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=200504270155.28318.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=akpm@osdl.org \
--cc=linux-kernel@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.