Lines 63-68
Link Here
|
63 |
#define ACPI_THERMAL_MODE_CRITICAL 0xff |
63 |
#define ACPI_THERMAL_MODE_CRITICAL 0xff |
64 |
#define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff" |
64 |
#define ACPI_THERMAL_PATH_POWEROFF "/sbin/poweroff" |
65 |
|
65 |
|
|
|
66 |
/* |
67 |
* ACPI spec 3.0 states default value between 300 and 3000 (i.e. 30 or |
68 |
* 3000 secs) but less polling interval proves to be safer |
69 |
*/ |
70 |
#define ACPI_THERMAL_POLLING_FREQ_DEFAULT 50 |
71 |
|
66 |
#define ACPI_THERMAL_MAX_ACTIVE 10 |
72 |
#define ACPI_THERMAL_MAX_ACTIVE 10 |
67 |
#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 |
73 |
#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 |
68 |
|
74 |
|
Lines 172-177
Link Here
|
172 |
struct acpi_thermal_trips trips; |
178 |
struct acpi_thermal_trips trips; |
173 |
struct acpi_handle_list devices; |
179 |
struct acpi_handle_list devices; |
174 |
struct timer_list timer; |
180 |
struct timer_list timer; |
|
|
181 |
u32 last_jiffies; |
175 |
}; |
182 |
}; |
176 |
|
183 |
|
177 |
static struct file_operations acpi_thermal_state_fops = { |
184 |
static struct file_operations acpi_thermal_state_fops = { |
Lines 1226-1234
Link Here
|
1226 |
|
1233 |
|
1227 |
switch (event) { |
1234 |
switch (event) { |
1228 |
case ACPI_THERMAL_NOTIFY_TEMPERATURE: |
1235 |
case ACPI_THERMAL_NOTIFY_TEMPERATURE: |
1229 |
acpi_thermal_check(tz); |
1236 |
if (jiffies - tz->last_jiffies > HZ) { |
|
|
1237 |
printk(KERN_ERR "------------------ Got thermal event 0x80\n"); |
1238 |
acpi_thermal_check(tz); |
1239 |
tz->last_jiffies = jiffies; |
1240 |
} else { |
1241 |
printk(KERN_ERR "------------------ SKIP thermal event 0x80\n"); |
1242 |
} |
1230 |
break; |
1243 |
break; |
1231 |
case ACPI_THERMAL_NOTIFY_THRESHOLDS: |
1244 |
case ACPI_THERMAL_NOTIFY_THRESHOLDS: |
|
|
1245 |
printk(KERN_ERR "------------------ Got thermal event 0x81\n"); |
1232 |
acpi_thermal_get_trip_points(tz); |
1246 |
acpi_thermal_get_trip_points(tz); |
1233 |
acpi_thermal_check(tz); |
1247 |
acpi_thermal_check(tz); |
1234 |
acpi_bus_generate_event(device, event, 0); |
1248 |
acpi_bus_generate_event(device, event, 0); |
Lines 1296-1303
Link Here
|
1296 |
/* Get default polling frequency [_TZP] (optional) */ |
1310 |
/* Get default polling frequency [_TZP] (optional) */ |
1297 |
if (tzp) |
1311 |
if (tzp) |
1298 |
tz->polling_frequency = tzp; |
1312 |
tz->polling_frequency = tzp; |
1299 |
else |
1313 |
else { |
1300 |
acpi_thermal_get_polling_frequency(tz); |
1314 |
result = acpi_thermal_get_polling_frequency(tz); |
|
|
1315 |
/* |
1316 |
* The absence of _TZP informs OSPM to implement polling |
1317 |
* using an OS-provided default frequency |
1318 |
*/ |
1319 |
if (result != 0) |
1320 |
tz->polling_frequency = |
1321 |
ACPI_THERMAL_POLLING_FREQ_DEFAULT; |
1322 |
} |
1301 |
|
1323 |
|
1302 |
/* Get devices in this thermal zone [_TZD] (optional) */ |
1324 |
/* Get devices in this thermal zone [_TZD] (optional) */ |
1303 |
result = acpi_thermal_get_devices(tz); |
1325 |
result = acpi_thermal_get_devices(tz); |