diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/i8k.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index 584e9a4a6f18..6c4b3f986d0c 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -35,7 +35,8 @@ | |||
35 | #define I8K_SMM_GET_FAN 0x00a3 | 35 | #define I8K_SMM_GET_FAN 0x00a3 |
36 | #define I8K_SMM_GET_SPEED 0x02a3 | 36 | #define I8K_SMM_GET_SPEED 0x02a3 |
37 | #define I8K_SMM_GET_TEMP 0x10a3 | 37 | #define I8K_SMM_GET_TEMP 0x10a3 |
38 | #define I8K_SMM_GET_DELL_SIG 0xffa3 | 38 | #define I8K_SMM_GET_DELL_SIG1 0xfea3 |
39 | #define I8K_SMM_GET_DELL_SIG2 0xffa3 | ||
39 | #define I8K_SMM_BIOS_VERSION 0x00a6 | 40 | #define I8K_SMM_BIOS_VERSION 0x00a6 |
40 | 41 | ||
41 | #define I8K_FAN_MULT 30 | 42 | #define I8K_FAN_MULT 30 |
@@ -226,7 +227,7 @@ static int i8k_set_fan(int fan, int speed) | |||
226 | /* | 227 | /* |
227 | * Read the cpu temperature. | 228 | * Read the cpu temperature. |
228 | */ | 229 | */ |
229 | static int i8k_get_cpu_temp(void) | 230 | static int i8k_get_temp(int sensor) |
230 | { | 231 | { |
231 | struct smm_regs regs = { .eax = I8K_SMM_GET_TEMP, }; | 232 | struct smm_regs regs = { .eax = I8K_SMM_GET_TEMP, }; |
232 | int rc; | 233 | int rc; |
@@ -235,7 +236,7 @@ static int i8k_get_cpu_temp(void) | |||
235 | #ifdef I8K_TEMPERATURE_BUG | 236 | #ifdef I8K_TEMPERATURE_BUG |
236 | static int prev; | 237 | static int prev; |
237 | #endif | 238 | #endif |
238 | 239 | regs.ebx = sensor & 0xff; | |
239 | if ((rc = i8k_smm(®s)) < 0) | 240 | if ((rc = i8k_smm(®s)) < 0) |
240 | return rc; | 241 | return rc; |
241 | 242 | ||
@@ -260,9 +261,9 @@ static int i8k_get_cpu_temp(void) | |||
260 | return temp; | 261 | return temp; |
261 | } | 262 | } |
262 | 263 | ||
263 | static int i8k_get_dell_signature(void) | 264 | static int i8k_get_dell_signature(int req_fn) |
264 | { | 265 | { |
265 | struct smm_regs regs = { .eax = I8K_SMM_GET_DELL_SIG, }; | 266 | struct smm_regs regs = { .eax = req_fn, }; |
266 | int rc; | 267 | int rc; |
267 | 268 | ||
268 | if ((rc = i8k_smm(®s)) < 0) | 269 | if ((rc = i8k_smm(®s)) < 0) |
@@ -301,7 +302,7 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | |||
301 | break; | 302 | break; |
302 | 303 | ||
303 | case I8K_GET_TEMP: | 304 | case I8K_GET_TEMP: |
304 | val = i8k_get_cpu_temp(); | 305 | val = i8k_get_temp(0); |
305 | break; | 306 | break; |
306 | 307 | ||
307 | case I8K_GET_SPEED: | 308 | case I8K_GET_SPEED: |
@@ -367,7 +368,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset) | |||
367 | int fn_key, cpu_temp, ac_power; | 368 | int fn_key, cpu_temp, ac_power; |
368 | int left_fan, right_fan, left_speed, right_speed; | 369 | int left_fan, right_fan, left_speed, right_speed; |
369 | 370 | ||
370 | cpu_temp = i8k_get_cpu_temp(); /* 11100 µs */ | 371 | cpu_temp = i8k_get_temp(0); /* 11100 µs */ |
371 | left_fan = i8k_get_fan_status(I8K_FAN_LEFT); /* 580 µs */ | 372 | left_fan = i8k_get_fan_status(I8K_FAN_LEFT); /* 580 µs */ |
372 | right_fan = i8k_get_fan_status(I8K_FAN_RIGHT); /* 580 µs */ | 373 | right_fan = i8k_get_fan_status(I8K_FAN_RIGHT); /* 580 µs */ |
373 | left_speed = i8k_get_fan_speed(I8K_FAN_LEFT); /* 580 µs */ | 374 | left_speed = i8k_get_fan_speed(I8K_FAN_LEFT); /* 580 µs */ |
@@ -421,6 +422,20 @@ static struct dmi_system_id __initdata i8k_dmi_table[] = { | |||
421 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"), | 422 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"), |
422 | }, | 423 | }, |
423 | }, | 424 | }, |
425 | { | ||
426 | .ident = "Dell Inspiron 2", | ||
427 | .matches = { | ||
428 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
429 | DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"), | ||
430 | }, | ||
431 | }, | ||
432 | { | ||
433 | .ident = "Dell Latitude 2", | ||
434 | .matches = { | ||
435 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
436 | DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"), | ||
437 | }, | ||
438 | }, | ||
424 | { } | 439 | { } |
425 | }; | 440 | }; |
426 | 441 | ||
@@ -451,7 +466,8 @@ static int __init i8k_probe(void) | |||
451 | /* | 466 | /* |
452 | * Get SMM Dell signature | 467 | * Get SMM Dell signature |
453 | */ | 468 | */ |
454 | if (i8k_get_dell_signature() != 0) { | 469 | if (i8k_get_dell_signature(I8K_SMM_GET_DELL_SIG1) && |
470 | i8k_get_dell_signature(I8K_SMM_GET_DELL_SIG2)) { | ||
455 | printk(KERN_ERR "i8k: unable to get SMM Dell signature\n"); | 471 | printk(KERN_ERR "i8k: unable to get SMM Dell signature\n"); |
456 | if (!force) | 472 | if (!force) |
457 | return -ENODEV; | 473 | return -ENODEV; |