exynos_tmu.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 calibration_mode {
  32. SW_MODE,
  33. HW_MODE,
  34. };
  35. enum soc_type {
  36. SOC_ARCH_EXYNOS4210 = 1,
  37. SOC_ARCH_EXYNOS,
  38. };
  39. /**
  40. * struct exynos_tmu_platform_data
  41. * @threshold: basic temperature for generating interrupt
  42. * 25 <= threshold <= 125 [unit: degree Celsius]
  43. * @threshold_falling: differntial value for setting threshold
  44. * of temperature falling interrupt.
  45. * @trigger_levels: array for each interrupt levels
  46. * [unit: degree Celsius]
  47. * 0: temperature for trigger_level0 interrupt
  48. * condition for trigger_level0 interrupt:
  49. * current temperature > threshold + trigger_levels[0]
  50. * 1: temperature for trigger_level1 interrupt
  51. * condition for trigger_level1 interrupt:
  52. * current temperature > threshold + trigger_levels[1]
  53. * 2: temperature for trigger_level2 interrupt
  54. * condition for trigger_level2 interrupt:
  55. * current temperature > threshold + trigger_levels[2]
  56. * 3: temperature for trigger_level3 interrupt
  57. * condition for trigger_level3 interrupt:
  58. * current temperature > threshold + trigger_levels[3]
  59. * @trigger_type: defines the type of trigger. Possible values are,
  60. * THROTTLE_ACTIVE trigger type
  61. * THROTTLE_PASSIVE trigger type
  62. * SW_TRIP trigger type
  63. * HW_TRIP
  64. * @trigger_enable[]: array to denote which trigger levels are enabled.
  65. * 1 = enable trigger_level[] interrupt,
  66. * 0 = disable trigger_level[] interrupt
  67. * @max_trigger_level: max trigger level supported by the TMU
  68. * @gain: gain of amplifier in the positive-TC generator block
  69. * 0 <= gain <= 15
  70. * @reference_voltage: reference voltage of amplifier
  71. * in the positive-TC generator block
  72. * 0 <= reference_voltage <= 31
  73. * @noise_cancel_mode: noise cancellation mode
  74. * 000, 100, 101, 110 and 111 can be different modes
  75. * @type: determines the type of SOC
  76. * @efuse_value: platform defined fuse value
  77. * @min_efuse_value: minimum valid trimming data
  78. * @max_efuse_value: maximum valid trimming data
  79. * @first_point_trim: temp value of the first point trimming
  80. * @second_point_trim: temp value of the second point trimming
  81. * @default_temp_offset: default temperature offset in case of no trimming
  82. * @cal_type: calibration type for temperature
  83. * @cal_mode: calibration mode for temperature
  84. * @freq_clip_table: Table representing frequency reduction percentage.
  85. * @freq_tab_count: Count of the above table as frequency reduction may
  86. * applicable to only some of the trigger levels.
  87. *
  88. * This structure is required for configuration of exynos_tmu driver.
  89. */
  90. struct exynos_tmu_platform_data {
  91. u8 threshold;
  92. u8 threshold_falling;
  93. u8 trigger_levels[MAX_TRIP_COUNT];
  94. enum trigger_type trigger_type[MAX_TRIP_COUNT];
  95. bool trigger_enable[MAX_TRIP_COUNT];
  96. u8 max_trigger_level;
  97. u8 gain;
  98. u8 reference_voltage;
  99. u8 noise_cancel_mode;
  100. u32 efuse_value;
  101. u32 min_efuse_value;
  102. u32 max_efuse_value;
  103. u8 first_point_trim;
  104. u8 second_point_trim;
  105. u8 default_temp_offset;
  106. enum calibration_type cal_type;
  107. enum calibration_mode cal_mode;
  108. enum soc_type type;
  109. struct freq_clip_table freq_tab[4];
  110. unsigned int freq_tab_count;
  111. };
  112. #endif /* _EXYNOS_TMU_H */