exynos_thermal.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. * @trigger_levels: array for each interrupt levels
  53. * [unit: degree Celsius]
  54. * 0: temperature for trigger_level0 interrupt
  55. * condition for trigger_level0 interrupt:
  56. * current temperature > threshold + trigger_levels[0]
  57. * 1: temperature for trigger_level1 interrupt
  58. * condition for trigger_level1 interrupt:
  59. * current temperature > threshold + trigger_levels[1]
  60. * 2: temperature for trigger_level2 interrupt
  61. * condition for trigger_level2 interrupt:
  62. * current temperature > threshold + trigger_levels[2]
  63. * 3: temperature for trigger_level3 interrupt
  64. * condition for trigger_level3 interrupt:
  65. * current temperature > threshold + trigger_levels[3]
  66. * @trigger_level0_en:
  67. * 1 = enable trigger_level0 interrupt,
  68. * 0 = disable trigger_level0 interrupt
  69. * @trigger_level1_en:
  70. * 1 = enable trigger_level1 interrupt,
  71. * 0 = disable trigger_level1 interrupt
  72. * @trigger_level2_en:
  73. * 1 = enable trigger_level2 interrupt,
  74. * 0 = disable trigger_level2 interrupt
  75. * @trigger_level3_en:
  76. * 1 = enable trigger_level3 interrupt,
  77. * 0 = disable trigger_level3 interrupt
  78. * @gain: gain of amplifier in the positive-TC generator block
  79. * 0 <= gain <= 15
  80. * @reference_voltage: reference voltage of amplifier
  81. * in the positive-TC generator block
  82. * 0 <= reference_voltage <= 31
  83. * @noise_cancel_mode: noise cancellation mode
  84. * 000, 100, 101, 110 and 111 can be different modes
  85. * @type: determines the type of SOC
  86. * @efuse_value: platform defined fuse value
  87. * @cal_type: calibration type for temperature
  88. * @freq_clip_table: Table representing frequency reduction percentage.
  89. * @freq_tab_count: Count of the above table as frequency reduction may
  90. * applicable to only some of the trigger levels.
  91. *
  92. * This structure is required for configuration of exynos_tmu driver.
  93. */
  94. struct exynos_tmu_platform_data {
  95. u8 threshold;
  96. u8 trigger_levels[4];
  97. bool trigger_level0_en;
  98. bool trigger_level1_en;
  99. bool trigger_level2_en;
  100. bool trigger_level3_en;
  101. u8 gain;
  102. u8 reference_voltage;
  103. u8 noise_cancel_mode;
  104. u32 efuse_value;
  105. enum calibration_type cal_type;
  106. enum soc_type type;
  107. struct freq_clip_table freq_tab[4];
  108. unsigned int freq_tab_count;
  109. };
  110. #endif /* _LINUX_EXYNOS_THERMAL_H */