mtk_thermal_monitor.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _MTK_THERMAL_MONITOR_H
  2. #define _MTK_THERMAL_MONITOR_H
  3. #include <linux/thermal.h>
  4. /*
  5. * MTK_THERMAL_WRAPPER_BYPASS = 1 (use original Linux Thermal API)
  6. * MTK_THERMAL_WRAPPER_BYPASS = 0 (use MTK Thermal API Monitor)
  7. */
  8. #define MTK_THERMAL_WRAPPER_BYPASS 0
  9. #if MTK_THERMAL_WRAPPER_BYPASS
  10. /* Original LTF API */
  11. #define mtk_thermal_zone_device_register thermal_zone_device_register
  12. #define mtk_thermal_zone_device_unregister thermal_zone_device_unregister
  13. #define mtk_thermal_cooling_device_unregister thermal_cooling_device_unregister
  14. #define mtk_thermal_cooling_device_register thermal_cooling_device_register
  15. #define mtk_thermal_zone_bind_cooling_device thermal_zone_bind_cooling_device
  16. #else
  17. extern
  18. struct thermal_zone_device *mtk_thermal_zone_device_register_wrapper
  19. (char *type, int trips, void *devdata, const struct thermal_zone_device_ops *ops,
  20. int tc1, int tc2, int passive_delay, int polling_delay);
  21. extern
  22. void mtk_thermal_zone_device_unregister_wrapper(struct thermal_zone_device *tz);
  23. extern
  24. struct thermal_cooling_device *mtk_thermal_cooling_device_register_wrapper
  25. (char *type, void *devdata, const struct thermal_cooling_device_ops *ops);
  26. extern
  27. void mtk_thermal_cooling_device_unregister_wrapper(struct thermal_cooling_device *cdev);
  28. extern int mtk_thermal_zone_bind_cooling_device_wrapper
  29. (struct thermal_zone_device *tz, int trip, struct thermal_cooling_device *cdev);
  30. extern int mtk_thermal_zone_bind_trigger_trip(struct thermal_zone_device *tz, int trip, int mode);
  31. #define mtk_thermal_zone_device_register mtk_thermal_zone_device_register_wrapper
  32. #define mtk_thermal_zone_device_unregister mtk_thermal_zone_device_unregister_wrapper
  33. #define mtk_thermal_cooling_device_unregister mtk_thermal_cooling_device_unregister_wrapper
  34. #define mtk_thermal_cooling_device_register mtk_thermal_cooling_device_register_wrapper
  35. #define mtk_thermal_zone_bind_cooling_device mtk_thermal_zone_bind_cooling_device_wrapper
  36. #endif
  37. typedef enum {
  38. MTK_THERMAL_SENSOR_CPU = 0,
  39. MTK_THERMAL_SENSOR_ABB,
  40. MTK_THERMAL_SENSOR_PMIC,
  41. MTK_THERMAL_SENSOR_BATTERY,
  42. MTK_THERMAL_SENSOR_MD1,
  43. MTK_THERMAL_SENSOR_MD2,
  44. MTK_THERMAL_SENSOR_WIFI,
  45. MTK_THERMAL_SENSOR_BATTERY2,
  46. MTK_THERMAL_SENSOR_BUCK,
  47. MTK_THERMAL_SENSOR_AP,
  48. MTK_THERMAL_SENSOR_PCB1,
  49. MTK_THERMAL_SENSOR_PCB2,
  50. MTK_THERMAL_SENSOR_SKIN,
  51. MTK_THERMAL_SENSOR_XTAL,
  52. MTK_THERMAL_SENSOR_COUNT
  53. } MTK_THERMAL_SENSOR_ID;
  54. extern int mtk_thermal_get_temp(MTK_THERMAL_SENSOR_ID id);
  55. extern struct proc_dir_entry *mtk_thermal_get_proc_drv_therm_dir_entry(void);
  56. /* This API function is implemented in mediatek/kernel/drivers/leds/leds.c */
  57. extern int setMaxbrightness(int max_level, int enable);
  58. extern void machine_power_off(void);
  59. #endif