aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 16:57:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 16:57:37 -0400
commit1481b9109fe771ec8b035d7760f42e36d2bed5d4 (patch)
treeabf3f6e7aa1aa98dc76ae8f04accc235918da53c /drivers/acpi/thermal.c
parent5042d99795d3d817bef2f4cc46e953bee9bf7398 (diff)
parentf88133d76ea38761b7379d6233b752ed82250a4a (diff)
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.c43
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)
769 acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data); 769 acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data);
770} 770}
771 771
772static void acpi_thermal_active_off(void *data)
773{
774 int result = 0;
775 struct acpi_thermal *tz = data;
776 int i = 0;
777 int j = 0;
778 struct acpi_thermal_active *active = NULL;
779
780 if (!tz) {
781 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
782 return;
783 }
784
785 result = acpi_thermal_get_temperature(tz);
786 if (result)
787 return;
788
789 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
790 active = &(tz->trips.active[i]);
791 if (!active || !active->flags.valid)
792 break;
793 if (tz->temperature >= active->temperature) {
794 /*
795 * If the thermal temperature is greater than the
796 * active threshod, unnecessary to turn off the
797 * the active cooling device.
798 */
799 continue;
800 }
801 /*
802 * Below Threshold?
803 * ----------------
804 * Turn OFF all cooling devices associated with this
805 * threshold.
806 */
807 for (j = 0; j < active->devices.count; j++)
808 result = acpi_bus_set_power(active->devices.handles[j],
809 ACPI_STATE_D3);
810 }
811}
812
772static void acpi_thermal_check(void *data) 813static void acpi_thermal_check(void *data)
773{ 814{
774 int result = 0; 815 int result = 0;
@@ -1624,6 +1665,8 @@ static int acpi_thermal_add(struct acpi_device *device)
1624 1665
1625 init_timer(&tz->timer); 1666 init_timer(&tz->timer);
1626 1667
1668 acpi_thermal_active_off(tz);
1669
1627 acpi_thermal_check(tz); 1670 acpi_thermal_check(tz);
1628 1671
1629 status = acpi_install_notify_handler(device->handle, 1672 status = acpi_install_notify_handler(device->handle,