43
43
#define ACPI_THERMAL_MAX_ACTIVE 10
44
44
#define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65
45
45
46
- #define ACPI_TRIPS_PASSIVE BIT(0)
47
- #define ACPI_TRIPS_ACTIVE BIT(1)
48
- #define ACPI_TRIPS_DEVICES BIT(2)
49
-
50
- #define ACPI_TRIPS_THRESHOLDS (ACPI_TRIPS_PASSIVE | ACPI_TRIPS_ACTIVE)
51
-
52
- #define ACPI_TRIPS_INIT (ACPI_TRIPS_THRESHOLDS | ACPI_TRIPS_DEVICES)
53
-
54
46
/*
55
47
* This exception is thrown out in two cases:
56
48
* 1.An invalid trip point becomes invalid or a valid trip point becomes invalid
57
49
* when re-evaluating the AML code.
58
50
* 2.TODO: Devices listed in _PSL, _ALx, _TZD may change.
59
51
* We need to re-bind the cooling devices of a thermal zone when this occurs.
60
52
*/
61
- #define ACPI_THERMAL_TRIPS_EXCEPTION (flags , tz , str ) \
53
+ #define ACPI_THERMAL_TRIPS_EXCEPTION (tz , str ) \
62
54
do { \
63
- if (flags != ACPI_TRIPS_INIT) \
64
- acpi_handle_info(tz->device->handle, \
65
- "ACPI thermal trip point %s changed\n" \
66
- "Please report to
[email protected] \n", str); \
55
+ acpi_handle_info(tz->device->handle, \
56
+ "ACPI thermal trip point %s changed\n" \
57
+ "Please report to
[email protected] \n", str); \
67
58
} while (0)
68
59
69
60
static int act ;
@@ -212,7 +203,7 @@ static void acpi_thermal_update_passive_trip(struct acpi_thermal *tz)
212
203
213
204
update_acpi_thermal_trip_temp (acpi_trip , get_passive_temp (tz ));
214
205
if (!acpi_trip -> valid )
215
- ACPI_THERMAL_TRIPS_EXCEPTION (ACPI_TRIPS_PASSIVE , tz , "state" );
206
+ ACPI_THERMAL_TRIPS_EXCEPTION (tz , "state" );
216
207
}
217
208
218
209
static bool update_passive_devices (struct acpi_thermal * tz , bool compare )
@@ -230,7 +221,7 @@ static bool update_passive_devices(struct acpi_thermal *tz, bool compare)
230
221
}
231
222
232
223
if (compare && memcmp (& tz -> trips .passive .devices , & devices , sizeof (devices )))
233
- ACPI_THERMAL_TRIPS_EXCEPTION (ACPI_TRIPS_PASSIVE , tz , "device" );
224
+ ACPI_THERMAL_TRIPS_EXCEPTION (tz , "device" );
234
225
235
226
memcpy (& tz -> trips .passive .devices , & devices , sizeof (devices ));
236
227
return true;
@@ -247,7 +238,7 @@ static void acpi_thermal_update_passive_devices(struct acpi_thermal *tz)
247
238
return ;
248
239
249
240
update_acpi_thermal_trip_temp (acpi_trip , THERMAL_TEMP_INVALID );
250
- ACPI_THERMAL_TRIPS_EXCEPTION (ACPI_TRIPS_PASSIVE , tz , "state" );
241
+ ACPI_THERMAL_TRIPS_EXCEPTION (tz , "state" );
251
242
}
252
243
253
244
static long get_active_temp (struct acpi_thermal * tz , int index )
@@ -282,7 +273,7 @@ static void acpi_thermal_update_active_trip(struct acpi_thermal *tz, int index)
282
273
283
274
update_acpi_thermal_trip_temp (acpi_trip , get_active_temp (tz , index ));
284
275
if (!acpi_trip -> valid )
285
- ACPI_THERMAL_TRIPS_EXCEPTION (ACPI_TRIPS_ACTIVE , tz , "state" );
276
+ ACPI_THERMAL_TRIPS_EXCEPTION (tz , "state" );
286
277
}
287
278
288
279
static bool update_active_devices (struct acpi_thermal * tz , int index , bool compare )
@@ -302,7 +293,7 @@ static bool update_active_devices(struct acpi_thermal *tz, int index, bool compa
302
293
}
303
294
304
295
if (compare && memcmp (& tz -> trips .active [index ].devices , & devices , sizeof (devices )))
305
- ACPI_THERMAL_TRIPS_EXCEPTION (ACPI_TRIPS_ACTIVE , tz , "device" );
296
+ ACPI_THERMAL_TRIPS_EXCEPTION (tz , "device" );
306
297
307
298
memcpy (& tz -> trips .active [index ].devices , & devices , sizeof (devices ));
308
299
return true;
@@ -319,7 +310,7 @@ static void acpi_thermal_update_active_devices(struct acpi_thermal *tz, int inde
319
310
return ;
320
311
321
312
update_acpi_thermal_trip_temp (acpi_trip , THERMAL_TEMP_INVALID );
322
- ACPI_THERMAL_TRIPS_EXCEPTION (ACPI_TRIPS_ACTIVE , tz , "state" );
313
+ ACPI_THERMAL_TRIPS_EXCEPTION (tz , "state" );
323
314
}
324
315
325
316
static int acpi_thermal_adjust_trip (struct thermal_trip * trip , void * data )
0 commit comments