diff options
author | Len Brown <len.brown@intel.com> | 2007-08-12 00:13:02 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-08-12 00:13:02 -0400 |
commit | 0b5bfa1cbefdc6e4c60f30ed545389b5ffe0f75f (patch) | |
tree | d6d9165f003bed59b0dc223babeadb2b667f92fb | |
parent | f8707ec9643769957065405b5090e4aa64fd8214 (diff) |
ACPI: thermal: add DMI hooks to handle AOpen's broken Award BIOS
Use DMI to:
1. enable polling (BIOS thermal events are broken)
2. disable active trip points (BIOS fan control is broken)
3. disable passive trip point (BIOS hard-codes it too low)
The actual temperature reading does work,
and with the aid of polling, the critical
trip point should work too.
http://bugzilla.kernel.org/show_bug.cgi?id=8842
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/thermal.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 3521c37bbd33..1e06159fd9c4 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/dmi.h> | ||
36 | #include <linux/init.h> | 37 | #include <linux/init.h> |
37 | #include <linux/types.h> | 38 | #include <linux/types.h> |
38 | #include <linux/proc_fs.h> | 39 | #include <linux/proc_fs.h> |
@@ -1328,10 +1329,74 @@ static int acpi_thermal_resume(struct acpi_device *device) | |||
1328 | return AE_OK; | 1329 | return AE_OK; |
1329 | } | 1330 | } |
1330 | 1331 | ||
1332 | #ifdef CONFIG_DMI | ||
1333 | static int thermal_act(struct dmi_system_id *d) { | ||
1334 | |||
1335 | if (act == 0) { | ||
1336 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1337 | "disabling all active thermal trip points\n", d->ident); | ||
1338 | act = -1; | ||
1339 | } | ||
1340 | return 0; | ||
1341 | } | ||
1342 | static int thermal_tzp(struct dmi_system_id *d) { | ||
1343 | |||
1344 | if (tzp == 0) { | ||
1345 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1346 | "enabling thermal zone polling\n", d->ident); | ||
1347 | tzp = 300; /* 300 dS = 30 Seconds */ | ||
1348 | } | ||
1349 | return 0; | ||
1350 | } | ||
1351 | static int thermal_psv(struct dmi_system_id *d) { | ||
1352 | |||
1353 | if (psv == 0) { | ||
1354 | printk(KERN_NOTICE "ACPI: %s detected: " | ||
1355 | "disabling all passive thermal trip points\n", d->ident); | ||
1356 | psv = -1; | ||
1357 | } | ||
1358 | return 0; | ||
1359 | } | ||
1360 | |||
1361 | static struct dmi_system_id thermal_dmi_table[] __initdata = { | ||
1362 | /* | ||
1363 | * Award BIOS on this AOpen makes thermal control almost worthless. | ||
1364 | * http://bugzilla.kernel.org/show_bug.cgi?id=8842 | ||
1365 | */ | ||
1366 | { | ||
1367 | .callback = thermal_act, | ||
1368 | .ident = "AOpen i915GMm-HFS", | ||
1369 | .matches = { | ||
1370 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
1371 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
1372 | }, | ||
1373 | }, | ||
1374 | { | ||
1375 | .callback = thermal_psv, | ||
1376 | .ident = "AOpen i915GMm-HFS", | ||
1377 | .matches = { | ||
1378 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
1379 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
1380 | }, | ||
1381 | }, | ||
1382 | { | ||
1383 | .callback = thermal_tzp, | ||
1384 | .ident = "AOpen i915GMm-HFS", | ||
1385 | .matches = { | ||
1386 | DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), | ||
1387 | DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), | ||
1388 | }, | ||
1389 | }, | ||
1390 | {} | ||
1391 | }; | ||
1392 | #endif /* CONFIG_DMI */ | ||
1393 | |||
1331 | static int __init acpi_thermal_init(void) | 1394 | static int __init acpi_thermal_init(void) |
1332 | { | 1395 | { |
1333 | int result = 0; | 1396 | int result = 0; |
1334 | 1397 | ||
1398 | dmi_check_system(thermal_dmi_table); | ||
1399 | |||
1335 | if (off) { | 1400 | if (off) { |
1336 | printk(KERN_NOTICE "ACPI: thermal control disabled\n"); | 1401 | printk(KERN_NOTICE "ACPI: thermal control disabled\n"); |
1337 | return -ENODEV; | 1402 | return -ENODEV; |