Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3209
b: refs/heads/master
c: 7e0fa31
h: refs/heads/master
i:
  3207: a08e1d3
v: v3
  • Loading branch information
Dmitry Torokhov authored and Linus Torvalds committed Jun 25, 2005
1 parent f6fa2f2 commit 16c05ea
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8378b92405dd606c6f3a0b1e303b67c8f8c9f743
refs/heads/master: 7e0fa31dbf5968ce1e94f73c04a9402170432ecf
32 changes: 24 additions & 8 deletions trunk/drivers/char/i8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -226,7 +227,7 @@ static int i8k_set_fan(int fan, int speed)
/*
* 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;
Expand All @@ -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(&regs)) < 0)
return rc;

Expand All @@ -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(&regs)) < 0)
Expand Down Expand Up @@ -301,7 +302,7 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd,
break;

case I8K_GET_TEMP:
val = i8k_get_cpu_temp();
val = i8k_get_temp(0);
break;

case I8K_GET_SPEED:
Expand Down Expand Up @@ -367,7 +368,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
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 */
Expand Down Expand Up @@ -421,6 +422,20 @@ static struct dmi_system_id __initdata i8k_dmi_table[] = {
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"),
},
},
{ }
};

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 16c05ea

Please sign in to comment.