aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 19f3ea48475e..e7fe3a14fdaf 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -82,6 +82,7 @@ MODULE_PARM_DESC(tzp, "Thermal zone polling frequency, in 1/10 seconds.\n");
82 82
83static int acpi_thermal_add(struct acpi_device *device); 83static int acpi_thermal_add(struct acpi_device *device);
84static int acpi_thermal_remove(struct acpi_device *device, int type); 84static int acpi_thermal_remove(struct acpi_device *device, int type);
85static int acpi_thermal_resume(struct acpi_device *device, int state);
85static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file); 86static int acpi_thermal_state_open_fs(struct inode *inode, struct file *file);
86static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file); 87static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file);
87static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file); 88static int acpi_thermal_trip_open_fs(struct inode *inode, struct file *file);
@@ -103,6 +104,7 @@ static struct acpi_driver acpi_thermal_driver = {
103 .ops = { 104 .ops = {
104 .add = acpi_thermal_add, 105 .add = acpi_thermal_add,
105 .remove = acpi_thermal_remove, 106 .remove = acpi_thermal_remove,
107 .resume = acpi_thermal_resume,
106 }, 108 },
107}; 109};
108 110
@@ -684,8 +686,7 @@ static void acpi_thermal_run(unsigned long data)
684{ 686{
685 struct acpi_thermal *tz = (struct acpi_thermal *)data; 687 struct acpi_thermal *tz = (struct acpi_thermal *)data;
686 if (!tz->zombie) 688 if (!tz->zombie)
687 acpi_os_queue_for_execution(OSD_PRIORITY_GPE, 689 acpi_os_execute(OSL_GPE_HANDLER, acpi_thermal_check, (void *)data);
688 acpi_thermal_check, (void *)data);
689} 690}
690 691
691static void acpi_thermal_check(void *data) 692static void acpi_thermal_check(void *data)
@@ -942,8 +943,10 @@ acpi_thermal_write_trip_points(struct file *file,
942 memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN); 943 memset(limit_string, 0, ACPI_THERMAL_MAX_LIMIT_STR_LEN);
943 944
944 active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL); 945 active = kmalloc(ACPI_THERMAL_MAX_ACTIVE * sizeof(int), GFP_KERNEL);
945 if (!active) 946 if (!active) {
947 kfree(limit_string);
946 return_VALUE(-ENOMEM); 948 return_VALUE(-ENOMEM);
949 }
947 950
948 if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) { 951 if (!tz || (count > ACPI_THERMAL_MAX_LIMIT_STR_LEN - 1)) {
949 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n")); 952 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid argument\n"));
@@ -1342,7 +1345,7 @@ static int acpi_thermal_add(struct acpi_device *device)
1342 1345
1343 result = acpi_thermal_add_fs(device); 1346 result = acpi_thermal_add_fs(device);
1344 if (result) 1347 if (result)
1345 return_VALUE(result); 1348 goto end;
1346 1349
1347 init_timer(&tz->timer); 1350 init_timer(&tz->timer);
1348 1351
@@ -1416,6 +1419,20 @@ static int acpi_thermal_remove(struct acpi_device *device, int type)
1416 return_VALUE(0); 1419 return_VALUE(0);
1417} 1420}
1418 1421
1422static int acpi_thermal_resume(struct acpi_device *device, int state)
1423{
1424 struct acpi_thermal *tz = NULL;
1425
1426 if (!device || !acpi_driver_data(device))
1427 return_VALUE(-EINVAL);
1428
1429 tz = (struct acpi_thermal *)acpi_driver_data(device);
1430
1431 acpi_thermal_check(tz);
1432
1433 return AE_OK;
1434}
1435
1419static int __init acpi_thermal_init(void) 1436static int __init acpi_thermal_init(void)
1420{ 1437{
1421 int result = 0; 1438 int result = 0;