therm.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef __NVBIOS_THERM_H__
  2. #define __NVBIOS_THERM_H__
  3. struct nvbios_therm_threshold {
  4. u8 temp;
  5. u8 hysteresis;
  6. };
  7. struct nvbios_therm_sensor {
  8. /* diode */
  9. s16 slope_mult;
  10. s16 slope_div;
  11. s16 offset_num;
  12. s16 offset_den;
  13. s8 offset_constant;
  14. /* thresholds */
  15. struct nvbios_therm_threshold thrs_fan_boost;
  16. struct nvbios_therm_threshold thrs_down_clock;
  17. struct nvbios_therm_threshold thrs_critical;
  18. struct nvbios_therm_threshold thrs_shutdown;
  19. };
  20. enum nvbios_therm_fan_type {
  21. NVBIOS_THERM_FAN_UNK = 0,
  22. NVBIOS_THERM_FAN_TOGGLE = 1,
  23. NVBIOS_THERM_FAN_PWM = 2,
  24. };
  25. /* no vbios have more than 6 */
  26. #define NVKM_TEMP_FAN_TRIP_MAX 10
  27. struct nvbios_therm_trip_point {
  28. int fan_duty;
  29. int temp;
  30. int hysteresis;
  31. };
  32. enum nvbios_therm_fan_mode {
  33. NVBIOS_THERM_FAN_TRIP = 0,
  34. NVBIOS_THERM_FAN_LINEAR = 1,
  35. NVBIOS_THERM_FAN_OTHER = 2,
  36. };
  37. struct nvbios_therm_fan {
  38. enum nvbios_therm_fan_type type;
  39. u32 pwm_freq;
  40. u8 min_duty;
  41. u8 max_duty;
  42. u16 bump_period;
  43. u16 slow_down_period;
  44. enum nvbios_therm_fan_mode fan_mode;
  45. struct nvbios_therm_trip_point trip[NVKM_TEMP_FAN_TRIP_MAX];
  46. u8 nr_fan_trip;
  47. u8 linear_min_temp;
  48. u8 linear_max_temp;
  49. };
  50. enum nvbios_therm_domain {
  51. NVBIOS_THERM_DOMAIN_CORE,
  52. NVBIOS_THERM_DOMAIN_AMBIENT,
  53. };
  54. int
  55. nvbios_therm_sensor_parse(struct nvkm_bios *, enum nvbios_therm_domain,
  56. struct nvbios_therm_sensor *);
  57. int
  58. nvbios_therm_fan_parse(struct nvkm_bios *, struct nvbios_therm_fan *);
  59. #endif