]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
7d70e9c1 MP |
2 | #ifndef __NVBIOS_THERM_H__ |
3 | #define __NVBIOS_THERM_H__ | |
7d70e9c1 MP |
4 | struct nvbios_therm_threshold { |
5 | u8 temp; | |
6 | u8 hysteresis; | |
7 | }; | |
8 | ||
9 | struct nvbios_therm_sensor { | |
10 | /* diode */ | |
11 | s16 slope_mult; | |
12 | s16 slope_div; | |
13 | s16 offset_num; | |
14 | s16 offset_den; | |
15 | s8 offset_constant; | |
16 | ||
17 | /* thresholds */ | |
18 | struct nvbios_therm_threshold thrs_fan_boost; | |
19 | struct nvbios_therm_threshold thrs_down_clock; | |
20 | struct nvbios_therm_threshold thrs_critical; | |
21 | struct nvbios_therm_threshold thrs_shutdown; | |
22 | }; | |
23 | ||
288c17bd MP |
24 | enum nvbios_therm_fan_type { |
25 | NVBIOS_THERM_FAN_UNK = 0, | |
26 | NVBIOS_THERM_FAN_TOGGLE = 1, | |
27 | NVBIOS_THERM_FAN_PWM = 2, | |
28 | }; | |
29 | ||
06afd4e8 | 30 | /* no vbios have more than 6 */ |
d390b480 BS |
31 | #define NVKM_TEMP_FAN_TRIP_MAX 10 |
32 | struct nvbios_therm_trip_point { | |
06afd4e8 MP |
33 | int fan_duty; |
34 | int temp; | |
35 | int hysteresis; | |
36 | }; | |
37 | ||
0e994d64 MP |
38 | enum nvbios_therm_fan_mode { |
39 | NVBIOS_THERM_FAN_TRIP = 0, | |
40 | NVBIOS_THERM_FAN_LINEAR = 1, | |
41 | NVBIOS_THERM_FAN_OTHER = 2, | |
42 | }; | |
43 | ||
7d70e9c1 | 44 | struct nvbios_therm_fan { |
288c17bd MP |
45 | enum nvbios_therm_fan_type type; |
46 | ||
47 | u32 pwm_freq; | |
7d70e9c1 MP |
48 | |
49 | u8 min_duty; | |
50 | u8 max_duty; | |
06afd4e8 MP |
51 | |
52 | u16 bump_period; | |
53 | u16 slow_down_period; | |
54 | ||
0e994d64 | 55 | enum nvbios_therm_fan_mode fan_mode; |
d390b480 | 56 | struct nvbios_therm_trip_point trip[NVKM_TEMP_FAN_TRIP_MAX]; |
06afd4e8 MP |
57 | u8 nr_fan_trip; |
58 | u8 linear_min_temp; | |
59 | u8 linear_max_temp; | |
7d70e9c1 MP |
60 | }; |
61 | ||
62 | enum nvbios_therm_domain { | |
63 | NVBIOS_THERM_DOMAIN_CORE, | |
64 | NVBIOS_THERM_DOMAIN_AMBIENT, | |
65 | }; | |
66 | ||
67 | int | |
d390b480 | 68 | nvbios_therm_sensor_parse(struct nvkm_bios *, enum nvbios_therm_domain, |
7d70e9c1 MP |
69 | struct nvbios_therm_sensor *); |
70 | ||
71 | int | |
d390b480 | 72 | nvbios_therm_fan_parse(struct nvkm_bios *, struct nvbios_therm_fan *); |
7d70e9c1 | 73 | #endif |