]> Pileus Git - ~andy/linux/blob - drivers/gpu/drm/nouveau/core/include/subdev/bios/therm.h
drm/nouveau/bios: parse fan bump/slow periods, and trip points
[~andy/linux] / drivers / gpu / drm / nouveau / core / include / subdev / bios / therm.h
1 #ifndef __NVBIOS_THERM_H__
2 #define __NVBIOS_THERM_H__
3
4 struct nouveau_bios;
5
6 struct nvbios_therm_threshold {
7         u8 temp;
8         u8 hysteresis;
9 };
10
11 struct nvbios_therm_sensor {
12         /* diode */
13         s16 slope_mult;
14         s16 slope_div;
15         s16 offset_num;
16         s16 offset_den;
17         s8 offset_constant;
18
19         /* thresholds */
20         struct nvbios_therm_threshold thrs_fan_boost;
21         struct nvbios_therm_threshold thrs_down_clock;
22         struct nvbios_therm_threshold thrs_critical;
23         struct nvbios_therm_threshold thrs_shutdown;
24 };
25
26 /* no vbios have more than 6 */
27 #define NOUVEAU_TEMP_FAN_TRIP_MAX 10
28 struct nouveau_therm_trip_point {
29         int fan_duty;
30         int temp;
31         int hysteresis;
32 };
33
34 struct nvbios_therm_fan {
35         u16 pwm_freq;
36
37         u8 min_duty;
38         u8 max_duty;
39
40         u16 bump_period;
41         u16 slow_down_period;
42
43         struct nouveau_therm_trip_point trip[NOUVEAU_TEMP_FAN_TRIP_MAX];
44         u8 nr_fan_trip;
45         u8 linear_min_temp;
46         u8 linear_max_temp;
47 };
48
49 enum nvbios_therm_domain {
50         NVBIOS_THERM_DOMAIN_CORE,
51         NVBIOS_THERM_DOMAIN_AMBIENT,
52 };
53
54 int
55 nvbios_therm_sensor_parse(struct nouveau_bios *, enum nvbios_therm_domain,
56                           struct nvbios_therm_sensor *);
57
58 int
59 nvbios_therm_fan_parse(struct nouveau_bios *, struct nvbios_therm_fan *);
60
61
62 #endif