blob: 9bbf11f2f7c1c0b8e445fc60989e444aa73d88cc [file] [log] [blame]
Tim Wawrzynczak103bd5e2020-05-29 13:11:00 -06001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef _DRIVERS_INTEL_DPTF_CHIP_H_
4#define _DRIVERS_INTEL_DPTF_CHIP_H_
5
Tim Wawrzynczakc41f7f12020-05-29 13:56:37 -06006#include <acpi/acpigen_dptf.h>
Elyes HAOUAS3b3d0852021-02-01 10:09:40 +01007#include <timer.h>
Tim Wawrzynczak07ac2ec2020-05-29 15:58:19 -06008
9#define DPTF_PASSIVE(src, tgt, tmp, prd) \
10 {.source = DPTF_##src, .target = DPTF_##tgt, .temp = (tmp), .period = (prd)}
11#define DPTF_CRITICAL(src, tmp, typ) \
12 {.source = DPTF_##src, .temp = (tmp), .type = DPTF_CRITICAL_##typ}
13#define TEMP_PCT(t, p) {.temp = (t), .fan_pct = (p)}
Tim Wawrzynczakc41f7f12020-05-29 13:56:37 -060014
Sumeet R Pawnikar36571872021-05-11 20:05:20 +053015/* Total number of OEM variables */
16#define DPTF_OEM_VARIABLE_COUNT 6
17
Tim Wawrzynczak103bd5e2020-05-29 13:11:00 -060018struct drivers_intel_dptf_config {
Tim Wawrzynczakc41f7f12020-05-29 13:56:37 -060019 struct {
20 struct dptf_active_policy active[DPTF_MAX_ACTIVE_POLICIES];
Tim Wawrzynczak3a9cde92020-05-29 14:19:15 -060021 struct dptf_critical_policy critical[DPTF_MAX_CRITICAL_POLICIES];
Tim Wawrzynczak7eb11362020-05-29 14:10:53 -060022 struct dptf_passive_policy passive[DPTF_MAX_PASSIVE_POLICIES];
Tim Wawrzynczakc41f7f12020-05-29 13:56:37 -060023 } policies;
Tim Wawrzynczak46f6fcf2020-05-29 14:29:53 -060024
25 struct {
26 struct dptf_charger_perf charger_perf[DPTF_MAX_CHARGER_PERF_STATES];
Tim Wawrzynczak2ad8ffe2020-05-29 14:39:02 -060027 struct dptf_fan_perf fan_perf[DPTF_MAX_FAN_PERF_STATES];
Sumeet Pawnikar2f7fa552022-06-08 17:43:36 +053028 struct dptf_multifan_perf
29 multifan_perf[DPTF_MAX_FAN_PARTICIPANTS][DPTF_MAX_FAN_PERF_STATES];
Tim Wawrzynczakbb5c2552020-05-29 14:46:19 -060030 struct dptf_power_limits power_limits;
Tim Wawrzynczak46f6fcf2020-05-29 14:29:53 -060031 } controls;
Tim Wawrzynczake4d8ebc2020-05-29 14:58:16 -060032
33 /* Note that all values in this struct are optional */
34 struct {
35 struct {
36 /* True means _FSL is percentages, False means _FSL is Control values */
37 bool fine_grained_control;
38 /*
39 * Recommended minimum step size in percentage points to adjust fan
40 * speed when utilizing fine-grained control (1-9)
41 */
42 uint8_t step_size;
43 /*
44 * True means the platform will issue a Notify (0x80) to the fan device
45 * if a a low fan speed is detected
46 */
47 bool low_speed_notify;
48 } fan;
Sumeet Pawnikar2f7fa552022-06-08 17:43:36 +053049
50 /* For multiple TFN fan options */
51 struct {
52 bool fine_grained_control;
53 uint8_t step_size;
54 bool low_speed_notify;
55 } multifan_options[DPTF_MAX_FAN_PARTICIPANTS];
56
Tim Wawrzynczake4d8ebc2020-05-29 14:58:16 -060057 struct {
58 /*
59 * The amount of hysteresis implemented in circuitry or in the platform
60 * EC's firmware implementation (using the GTSH object)
61 */
62 uint8_t hysteresis;
63 /* Name applied to TSR (using the _STR object) */
64 const char *desc;
65 } tsr[DPTF_MAX_TSR];
66 } options;
Sumeet R Pawnikar36571872021-05-11 20:05:20 +053067
68 /* OEM variables */
69 struct {
70 uint32_t oem_variables[DPTF_OEM_VARIABLE_COUNT];
71 } oem_data;
Varshit B Pandya282b3b62022-04-18 14:50:30 +053072
73 /* Rest of platform Power */
74 uint32_t prop;
Sumeet Pawnikar2f7fa552022-06-08 17:43:36 +053075
76 bool dptf_multifan_support;
Tim Wawrzynczak103bd5e2020-05-29 13:11:00 -060077};
78
79#endif /* _DRIVERS_INTEL_DPTF_CHIP_H_ */