aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/include/subdev/bios/therm.h
blob: a2c4296fc5f67ce06fa5a0e7c7558b4957bf1e93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __NVBIOS_THERM_H__
#define __NVBIOS_THERM_H__

struct nouveau_bios;

struct nvbios_therm_threshold {
	u8 temp;
	u8 hysteresis;
};

struct nvbios_therm_sensor {
	/* diode */
	s16 slope_mult;
	s16 slope_div;
	s16 offset_num;
	s16 offset_den;
	s8 offset_constant;

	/* thresholds */
	struct nvbios_therm_threshold thrs_fan_boost;
	struct nvbios_therm_threshold thrs_down_clock;
	struct nvbios_therm_threshold thrs_critical;
	struct nvbios_therm_threshold thrs_shutdown;
};

struct nvbios_therm_fan {
	u16 pwm_freq;

	u8 min_duty;
	u8 max_duty;
};

enum nvbios_therm_domain {
	NVBIOS_THERM_DOMAIN_CORE,
	NVBIOS_THERM_DOMAIN_AMBIENT,
};

int
nvbios_therm_sensor_parse(struct nouveau_bios *, enum nvbios_therm_domain,
			  struct nvbios_therm_sensor *);

int
nvbios_therm_fan_parse(struct nouveau_bios *, struct nvbios_therm_fan *);


#endif