0001
0002 #ifndef __NVBIOS_THERM_H__
0003 #define __NVBIOS_THERM_H__
0004 struct nvbios_therm_threshold {
0005 u8 temp;
0006 u8 hysteresis;
0007 };
0008
0009 struct nvbios_therm_sensor {
0010
0011 s16 slope_mult;
0012 s16 slope_div;
0013 s16 offset_num;
0014 s16 offset_den;
0015 s8 offset_constant;
0016
0017
0018 struct nvbios_therm_threshold thrs_fan_boost;
0019 struct nvbios_therm_threshold thrs_down_clock;
0020 struct nvbios_therm_threshold thrs_critical;
0021 struct nvbios_therm_threshold thrs_shutdown;
0022 };
0023
0024 enum nvbios_therm_fan_type {
0025 NVBIOS_THERM_FAN_UNK = 0,
0026 NVBIOS_THERM_FAN_TOGGLE = 1,
0027 NVBIOS_THERM_FAN_PWM = 2,
0028 };
0029
0030
0031 #define NVKM_TEMP_FAN_TRIP_MAX 10
0032 struct nvbios_therm_trip_point {
0033 int fan_duty;
0034 int temp;
0035 int hysteresis;
0036 };
0037
0038 enum nvbios_therm_fan_mode {
0039 NVBIOS_THERM_FAN_TRIP = 0,
0040 NVBIOS_THERM_FAN_LINEAR = 1,
0041 NVBIOS_THERM_FAN_OTHER = 2,
0042 };
0043
0044 struct nvbios_therm_fan {
0045 enum nvbios_therm_fan_type type;
0046
0047 u32 pwm_freq;
0048
0049 u8 min_duty;
0050 u8 max_duty;
0051
0052 u16 bump_period;
0053 u16 slow_down_period;
0054
0055 enum nvbios_therm_fan_mode fan_mode;
0056 struct nvbios_therm_trip_point trip[NVKM_TEMP_FAN_TRIP_MAX];
0057 u8 nr_fan_trip;
0058 u8 linear_min_temp;
0059 u8 linear_max_temp;
0060 };
0061
0062 enum nvbios_therm_domain {
0063 NVBIOS_THERM_DOMAIN_CORE,
0064 NVBIOS_THERM_DOMAIN_AMBIENT,
0065 };
0066
0067 int
0068 nvbios_therm_sensor_parse(struct nvkm_bios *, enum nvbios_therm_domain,
0069 struct nvbios_therm_sensor *);
0070
0071 int
0072 nvbios_therm_fan_parse(struct nvkm_bios *, struct nvbios_therm_fan *);
0073 #endif