exynos_tmu.h 3.6 KB

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