exynos_thermal.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * exynos_thermal.h - Samsung EXYNOS TMU (Thermal Management Unit)
  3. *
  4. * Copyright (C) 2011 Samsung Electronics
  5. * Donggeun Kim <dg77.kim@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #ifndef _LINUX_EXYNOS_THERMAL_H
  22. #define _LINUX_EXYNOS_THERMAL_H
  23. #include <linux/cpu_cooling.h>
  24. enum calibration_type {
  25. TYPE_ONE_POINT_TRIMMING,
  26. TYPE_TWO_POINT_TRIMMING,
  27. TYPE_NONE,
  28. };
  29. enum soc_type {
  30. SOC_ARCH_EXYNOS4210 = 1,
  31. SOC_ARCH_EXYNOS,
  32. };
  33. /**
  34. * struct freq_clip_table
  35. * @freq_clip_max: maximum frequency allowed for this cooling state.
  36. * @temp_level: Temperature level at which the temperature clipping will
  37. * happen.
  38. * @mask_val: cpumask of the allowed cpu's where the clipping will take place.
  39. *
  40. * This structure is required to be filled and passed to the
  41. * cpufreq_cooling_unregister function.
  42. */
  43. struct freq_clip_table {
  44. unsigned int freq_clip_max;
  45. unsigned int temp_level;
  46. const struct cpumask *mask_val;
  47. };
  48. /**
  49. * struct exynos_tmu_platform_data
  50. * @threshold: basic temperature for generating interrupt
  51. * 25 <= threshold <= 125 [unit: degree Celsius]
  52. * @threshold_falling: differntial value for setting threshold
  53. * of temperature falling interrupt.
  54. * @trigger_levels: array for each interrupt levels
  55. * [unit: degree Celsius]
  56. * 0: temperature for trigger_level0 interrupt
  57. * condition for trigger_level0 interrupt:
  58. * current temperature > threshold + trigger_levels[0]
  59. * 1: temperature for trigger_level1 interrupt
  60. * condition for trigger_level1 interrupt:
  61. * current temperature > threshold + trigger_levels[1]
  62. * 2: temperature for trigger_level2 interrupt
  63. * condition for trigger_level2 interrupt:
  64. * current temperature > threshold + trigger_levels[2]
  65. * 3: temperature for trigger_level3 interrupt
  66. * condition for trigger_level3 interrupt:
  67. * current temperature > threshold + trigger_levels[3]
  68. * @trigger_level0_en:
  69. * 1 = enable trigger_level0 interrupt,
  70. * 0 = disable trigger_level0 interrupt
  71. * @trigger_level1_en:
  72. * 1 = enable trigger_level1 interrupt,
  73. * 0 = disable trigger_level1 interrupt
  74. * @trigger_level2_en:
  75. * 1 = enable trigger_level2 interrupt,
  76. * 0 = disable trigger_level2 interrupt
  77. * @trigger_level3_en:
  78. * 1 = enable trigger_level3 interrupt,
  79. * 0 = disable trigger_level3 interrupt
  80. * @gain: gain of amplifier in the positive-TC generator block
  81. * 0 <= gain <= 15
  82. * @reference_voltage: reference voltage of amplifier
  83. * in the positive-TC generator block
  84. * 0 <= reference_voltage <= 31
  85. * @noise_cancel_mode: noise cancellation mode
  86. * 000, 100, 101, 110 and 111 can be different modes
  87. * @type: determines the type of SOC
  88. * @efuse_value: platform defined fuse value
  89. * @cal_type: calibration type for temperature
  90. * @freq_clip_table: Table representing frequency reduction percentage.
  91. * @freq_tab_count: Count of the above table as frequency reduction may
  92. * applicable to only some of the trigger levels.
  93. *
  94. * This structure is required for configuration of exynos_tmu driver.
  95. */
  96. struct exynos_tmu_platform_data {
  97. u8 threshold;
  98. u8 threshold_falling;
  99. u8 trigger_levels[4];
  100. bool trigger_level0_en;
  101. bool trigger_level1_en;
  102. bool trigger_level2_en;
  103. bool trigger_level3_en;
  104. u8 gain;
  105. u8 reference_voltage;
  106. u8 noise_cancel_mode;
  107. u32 efuse_value;
  108. enum calibration_type cal_type;
  109. enum soc_type type;
  110. struct freq_clip_table freq_tab[4];
  111. unsigned int freq_tab_count;
  112. };
  113. #endif /* _LINUX_EXYNOS_THERMAL_H */