mtk_thermal_ext_control.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2009 Travis Geiselbrecht
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining
  5. * a copy of this software and associated documentation files
  6. * (the "Software"), to deal in the Software without restriction,
  7. * including without limitation the rights to use, copy, modify, merge,
  8. * publish, distribute, sublicense, and/or sell copies of the Software,
  9. * and to permit persons to whom the Software is furnished to do so,
  10. * subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be
  13. * included in all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  19. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  20. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  21. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. #ifndef _MTK_THERMAL_EXT_CONTROL_H
  24. #define _MTK_THERMAL_EXT_CONTROL_H
  25. #define THERMAL_MD32_IPI_MSG_BASE 0x1F00
  26. #define THERMAL_AP_IPI_MSG_BASE 0x2F00
  27. typedef enum {
  28. THERMAL_AP_IPI_MSG_SET_TZ_THRESHOLD = THERMAL_AP_IPI_MSG_BASE,
  29. THERMAL_AP_IPI_MSG_MD32_START,
  30. THERMAL_MD32_IPI_MSG_READY = THERMAL_MD32_IPI_MSG_BASE,
  31. THERMAL_MD32_IPI_MSG_MD32_START_ACK,
  32. THERMAL_MD32_IPI_MSG_REACH_THRESHOLD,
  33. } thermal_ipi_msg_id;
  34. typedef enum {
  35. /* MTK_THERMAL_EXT_SENSOR_CPU = 0, */
  36. MTK_THERMAL_EXT_SENSOR_ABB = 0,
  37. MTK_THERMAL_EXT_SENSOR_PMIC,
  38. MTK_THERMAL_EXT_SENSOR_BATTERY,
  39. MTK_THERMAL_EXT_SENSOR_COUNT
  40. } MTK_THERMAL_EXT_SENSOR_ID;
  41. typedef struct {
  42. int id; /* id of this tz */
  43. int polling_delay; /* polling delay of this tz */
  44. long high_trip_point; /* high threshold of this tz */
  45. long low_trip_point; /* low threshold of this tz */
  46. } thermal_zone_data;
  47. typedef struct {
  48. int id; /* id of this tz */
  49. long high_trip_point; /* high threshold of this tz */
  50. long low_trip_point; /* low threshold of this tz */
  51. long temperature; /* Current temperature gotten from TS */
  52. } thermal_zone_status;
  53. typedef struct {
  54. short id;
  55. union {
  56. thermal_zone_data tz;
  57. thermal_zone_status tz_status;
  58. } data;
  59. } thermal_ipi_msg;
  60. #endif /* _MTK_THERMAL_EXT_CONTROL_H */