exynos_thermal_common.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * exynos_thermal_common.h - Samsung EXYNOS common header file
  3. *
  4. * Copyright (C) 2013 Samsung Electronics
  5. * Amit Daniel Kachhap <amit.daniel@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. */
  22. #ifndef _EXYNOS_THERMAL_COMMON_H
  23. #define _EXYNOS_THERMAL_COMMON_H
  24. /* In-kernel thermal framework related macros & definations */
  25. #define SENSOR_NAME_LEN 16
  26. #define MAX_TRIP_COUNT 8
  27. #define MAX_COOLING_DEVICE 4
  28. #define MAX_THRESHOLD_LEVS 4
  29. #define ACTIVE_INTERVAL 500
  30. #define IDLE_INTERVAL 10000
  31. #define MCELSIUS 1000
  32. /* CPU Zone information */
  33. #define PANIC_ZONE 4
  34. #define WARN_ZONE 3
  35. #define MONITOR_ZONE 2
  36. #define SAFE_ZONE 1
  37. #define GET_ZONE(trip) (trip + 2)
  38. #define GET_TRIP(zone) (zone - 2)
  39. #define EXYNOS_ZONE_COUNT 3
  40. struct thermal_trip_point_conf {
  41. int trip_val[MAX_TRIP_COUNT];
  42. int trip_count;
  43. unsigned char trigger_falling;
  44. };
  45. struct thermal_cooling_conf {
  46. struct freq_clip_table freq_data[MAX_TRIP_COUNT];
  47. int freq_clip_count;
  48. };
  49. struct thermal_sensor_conf {
  50. char name[SENSOR_NAME_LEN];
  51. int (*read_temperature)(void *data);
  52. int (*write_emul_temp)(void *drv_data, unsigned long temp);
  53. struct thermal_trip_point_conf trip_data;
  54. struct thermal_cooling_conf cooling_data;
  55. void *private_data;
  56. };
  57. /*Functions used exynos based thermal sensor driver*/
  58. #ifdef CONFIG_EXYNOS_THERMAL_CORE
  59. void exynos_unregister_thermal(void);
  60. int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf);
  61. void exynos_report_trigger(void);
  62. #else
  63. static inline void
  64. exynos_unregister_thermal(void) { return; }
  65. static inline int
  66. exynos_register_thermal(struct thermal_sensor_conf *sensor_conf) { return 0; }
  67. static inline void
  68. exynos_report_trigger(void) { return; }
  69. #endif /* CONFIG_EXYNOS_THERMAL_CORE */
  70. #endif /* _EXYNOS_THERMAL_COMMON_H */