A simple fan daemon for OpenPOWER systems
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

76 lignes
2.1 KiB

  1. /**
  2. * Copyright 2019 Shawn Anastasio
  3. *
  4. * This file is part of op-fan-daemon.
  5. *
  6. * op-fan-daemon is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * op-fan-daemon is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with op-fan-daemon. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. #ifndef OP_FAN_DAEMON_CURVE_H
  20. #define OP_FAN_DAEMON_CURVE_H 1
  21. #include <stdint.h>
  22. #include "util.h"
  23. struct fan_curve_point {
  24. // Trigger temperature in millidegrees celcius
  25. uint32_t temp;
  26. // Fan speed (0-255) to set
  27. uint8_t speed;
  28. /**
  29. * Hysteresis value. The temperature has to drop
  30. * below `temp` - `hysteresis` in order to go back
  31. * to the previous setting
  32. */
  33. uint32_t hysteresis;
  34. };
  35. #ifdef DECLARE_CURVES
  36. /**
  37. * Fan curves are defined here.
  38. *
  39. * The format is described above.
  40. * Each point contains a minimum temperature threshold at which it triggers,
  41. * a speed to set when it triggers, and a hysteresis value that the temperature
  42. * must fall by before a previous point is selected.
  43. */
  44. #define hist 2500
  45. // Curve used by ZONE_CPU0
  46. static struct fan_curve_point zone_cpu0_curve[] = {
  47. {30000, 50}, {35000, 65, hist}, {40000, 80, hist}, {50000, 82, 6000}, {64000, 84, 6000}, {70000, 255, hist}
  48. };
  49. // Curve used by ZONE_CPU1
  50. static struct fan_curve_point zone_cpu1_curve[] = {
  51. {30000, 50}, {35000, 65, hist}, {40000, 80, hist}, {50000, 82, 6000}, {64000, 84, 6000}, {70000, 255, hist}
  52. };
  53. // Curve used by ZONE_CHASSIS
  54. static struct fan_curve_point zone_chassis_curve[] = {
  55. {30000, 50}, {35000, 65, hist}, {40000, 80, hist}, {50000, 85, hist}, {55000, 90, hist}, {60000, 100, hist}, {65000, 255, hist},
  56. };
  57. #undef hist
  58. #endif
  59. #endif // OP_FAN_DAEMON_CURVE_H