Raul E Rangel | 9bf32b9 | 2021-05-12 17:03:40 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef __DRIVERS_ACPI_THERMAL_ZONE_H__ |
| 4 | #define __DRIVERS_ACPI_THERMAL_ZONE_H__ |
| 5 | |
| 6 | #include <types.h> |
| 7 | |
| 8 | /* |
| 9 | * All temperature units are in Celsius. |
| 10 | * All time units are in seconds. |
| 11 | */ |
| 12 | struct drivers_acpi_thermal_zone_config { |
| 13 | /* Description of the thermal zone */ |
| 14 | const char *description; |
| 15 | |
| 16 | /* |
| 17 | * Device that will provide the temperature reading |
| 18 | * |
| 19 | * This device must have an ACPI method named `TMP` that accepts the |
| 20 | * sensor ID as the first argument. It must then return an Integer containing the |
| 21 | * sensor's temperature in deci-Kelvin. |
| 22 | */ |
| 23 | DEVTREE_CONST struct device *temperature_controller; |
| 24 | |
| 25 | /* Used to identify the temperature sensor */ |
| 26 | unsigned int sensor_id; |
| 27 | |
| 28 | /* The polling period in seconds for this thermal zone. */ |
| 29 | unsigned int polling_period; |
| 30 | |
| 31 | /* The temperature (_CRT) at which the OS must shutdown the system. */ |
| 32 | unsigned int critical_temperature; |
| 33 | |
| 34 | /* The temperature (_HOT) at which the OS may choose to hibernate the system */ |
| 35 | unsigned int hibernate_temperature; |
| 36 | |
| 37 | struct acpi_thermal_zone_passive_config { |
| 38 | /* |
| 39 | * The temperature (_PSV) at which the OS must activate passive cooling (i.e., |
| 40 | * throttle the CPUs). |
| 41 | */ |
| 42 | unsigned int temperature; |
| 43 | |
| 44 | /** |
| 45 | * DeltaP[%] = _TC1 * (Tn - Tn-1) + _TC2 * (Tn - Tt) |
| 46 | * Where: |
| 47 | * Tn = current temperature |
| 48 | * Tt = target temperature (_PSV) |
| 49 | * |
| 50 | * If any of these values are 0, then one of the following defaults will be |
| 51 | * used: TC1: 2, TC2: 5, TSP: 10 |
| 52 | */ |
| 53 | unsigned int time_constant_1; |
| 54 | unsigned int time_constant_2; |
| 55 | unsigned int time_sampling_period; |
| 56 | |
| 57 | } passive_config; |
| 58 | |
| 59 | /* Place the ThermalZone in the \_TZ scope */ |
| 60 | bool use_acpi1_thermal_zone_scope; |
| 61 | }; |
| 62 | |
| 63 | #endif /* __DRIVERS_ACPI_THERMAL_ZONE_H__ */ |