diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 22:57:37 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 22:57:37 +0200 |
commit | 1481b9109fe771ec8b035d7760f42e36d2bed5d4 (patch) | |
tree | abf3f6e7aa1aa98dc76ae8f04accc235918da53c /drivers/acpi/thermal.c | |
parent | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jba... (diff) | |
parent | acpi: fix crash in core ACPI code, triggered by CONFIG_ACPI_PCI_SLOT=y (diff) | |
download | linux-1481b9109fe771ec8b035d7760f42e36d2bed5d4.tar.xz linux-1481b9109fe771ec8b035d7760f42e36d2bed5d4.zip |
Merge branch 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6
* 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6:
acpi: fix crash in core ACPI code, triggered by CONFIG_ACPI_PCI_SLOT=y
ACPI: thinkpad-acpi: don't misdetect in get_thinkpad_model_data() on -ENOMEM
ACPI: thinkpad-acpi: bump up version to 0.21
ACPI: thinkpad-acpi: add bluetooth and WWAN rfkill support
ACPI: thinkpad-acpi: WLSW overrides other rfkill switches
ACPI: thinkpad-acpi: prepare for bluetooth and wwan rfkill support
ACPI: thinkpad-acpi: consolidate wlsw notification function
ACPI: thinkpad-acpi: minor refactor on radio switch init
Revert "ACPI: don't walk tables if ACPI was disabled"
Revert "dock: bay: Don't call acpi_walk_namespace() when ACPI is disabled."
Revert "Fix FADT parsing"
ACPI : Set FAN device to correct state in boot phase
ACPI: Ignore _BQC object when registering backlight device
ACPI: stop complaints about interrupt link End Tags and blank IRQ descriptors
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | drivers/acpi/thermal.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 30a341337933..912703691d36 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -769,6 +769,47 @@ static void acpi_thermal_run(unsigned long data) acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data); } +static void acpi_thermal_active_off(void *data) +{ + int result = 0; + struct acpi_thermal *tz = data; + int i = 0; + int j = 0; + struct acpi_thermal_active *active = NULL; + + if (!tz) { + printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); + return; + } + + result = acpi_thermal_get_temperature(tz); + if (result) + return; + + for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { + active = &(tz->trips.active[i]); + if (!active || !active->flags.valid) + break; + if (tz->temperature >= active->temperature) { + /* + * If the thermal temperature is greater than the + * active threshod, unnecessary to turn off the + * the active cooling device. + */ + continue; + } + /* + * Below Threshold? + * ---------------- + * Turn OFF all cooling devices associated with this + * threshold. + */ + for (j = 0; j < active->devices.count; j++) + result = acpi_bus_set_power(active->devices.handles[j], + ACPI_STATE_D3); + } +} + static void acpi_thermal_check(void *data) { int result = 0; @@ -1624,6 +1665,8 @@ static int acpi_thermal_add(struct acpi_device *device) init_timer(&tz->timer); + acpi_thermal_active_off(tz); + acpi_thermal_check(tz); status = acpi_install_notify_handler(device->handle, |