ti-thermal.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * OMAP thermal definitions
  3. *
  4. * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
  5. * Contact:
  6. * Eduardo Valentin <eduardo.valentin@ti.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. *
  22. */
  23. #ifndef __TI_THERMAL_H
  24. #define __TI_THERMAL_H
  25. #include "ti-bandgap.h"
  26. /* PCB sensor calculation constants */
  27. #define OMAP_GRADIENT_SLOPE_W_PCB_4430 0
  28. #define OMAP_GRADIENT_CONST_W_PCB_4430 20000
  29. #define OMAP_GRADIENT_SLOPE_W_PCB_4460 1142
  30. #define OMAP_GRADIENT_CONST_W_PCB_4460 -393
  31. #define OMAP_GRADIENT_SLOPE_W_PCB_4470 1063
  32. #define OMAP_GRADIENT_CONST_W_PCB_4470 -477
  33. #define OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU 100
  34. #define OMAP_GRADIENT_CONST_W_PCB_5430_CPU 484
  35. #define OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU 464
  36. #define OMAP_GRADIENT_CONST_W_PCB_5430_GPU -5102
  37. #define DRA752_GRADIENT_SLOPE_W_PCB 0
  38. #define DRA752_GRADIENT_CONST_W_PCB 2000
  39. /* trip points of interest in milicelsius (at hotspot level) */
  40. #define OMAP_TRIP_COLD 100000
  41. #define OMAP_TRIP_HOT 110000
  42. #define OMAP_TRIP_SHUTDOWN 125000
  43. #define OMAP_TRIP_NUMBER 2
  44. #define OMAP_TRIP_STEP \
  45. ((OMAP_TRIP_SHUTDOWN - OMAP_TRIP_HOT) / (OMAP_TRIP_NUMBER - 1))
  46. /* Update rates */
  47. #define FAST_TEMP_MONITORING_RATE 250
  48. /* helper macros */
  49. /**
  50. * ti_thermal_get_trip_value - returns trip temperature based on index
  51. * @i: trip index
  52. */
  53. #define ti_thermal_get_trip_value(i) \
  54. (OMAP_TRIP_HOT + ((i) * OMAP_TRIP_STEP))
  55. /**
  56. * ti_thermal_is_valid_trip - check for trip index
  57. * @i: trip index
  58. */
  59. #define ti_thermal_is_valid_trip(trip) \
  60. ((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER)
  61. #ifdef CONFIG_TI_THERMAL
  62. int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain);
  63. int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id);
  64. int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id);
  65. int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id);
  66. int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id);
  67. #else
  68. static inline
  69. int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain)
  70. {
  71. return 0;
  72. }
  73. static inline
  74. int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
  75. {
  76. return 0;
  77. }
  78. static inline
  79. int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id)
  80. {
  81. return 0;
  82. }
  83. static inline
  84. int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
  85. {
  86. return 0;
  87. }
  88. static inline
  89. int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
  90. {
  91. return 0;
  92. }
  93. #endif
  94. #endif