Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105667
b: refs/heads/master
c: ea51011
h: refs/heads/master
i:
  105665: 8d5091a
  105663: 418f967
v: v3
  • Loading branch information
Zhao Yakui authored and Andi Kleen committed Jul 17, 2008
1 parent 9ea1a8b commit c9f82cf
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2c789057f075022658b38b498755c29c1ba8055
refs/heads/master: ea51011a27db48ea0a80a5e20de3969b292d5d4d
43 changes: 43 additions & 0 deletions trunk/drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c9f82cf

Please sign in to comment.