mtk_thermal_platform.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef _MTK_THERMAL_PLATFORM_H
  2. #define _MTK_THERMAL_PLATFORM_H
  3. #include <linux/thermal.h>
  4. #include <mtk_thermal_typedefs.h>
  5. extern
  6. int mtk_thermal_get_cpu_info(int *nocores, int **cpufreq, int **cpuloading);
  7. extern
  8. int mtk_thermal_get_gpu_info(int *nocores, int **gpufreq, int **gpuloading);
  9. extern
  10. int mtk_thermal_get_batt_info(int *batt_voltage, int *batt_current, int *batt_temp);
  11. extern
  12. int mtk_thermal_get_extra_info(int *no_extra_attr,
  13. char ***attr_names, int **attr_values, char ***attr_unit);
  14. extern
  15. int mtk_thermal_force_get_batt_temp(void);
  16. enum {
  17. MTK_THERMAL_SCEN_CALL = 0x1
  18. };
  19. extern
  20. unsigned int mtk_thermal_set_user_scenarios(unsigned int mask);
  21. extern
  22. unsigned int mtk_thermal_clear_user_scenarios(unsigned int mask);
  23. #if defined(CONFIG_MTK_SMART_BATTERY)
  24. /* global variable from battery driver... */
  25. extern kal_bool gFG_Is_Charging;
  26. #endif
  27. extern int force_get_tbat(void);
  28. #endif /* _MTK_THERMAL_PLATFORM_H */
  29. typedef enum {
  30. TA_DAEMON_CMD_GET_INIT_FLAG = 0,
  31. TA_DAEMON_CMD_SET_DAEMON_PID,
  32. TA_DAEMON_CMD_NOTIFY_DAEMON,
  33. TA_DAEMON_CMD_NOTIFY_DAEMON_CATMINIT,
  34. TA_DAEMON_CMD_SET_TTJ,
  35. TA_DAEMON_CMD_GET_TPCB,
  36. TA_DAEMON_CMD_TO_KERNEL_NUMBER
  37. } TA_DAEMON_CTRL_CMD_TO_KERNEL; /*must sync userspace/kernel: TA_DAEMON_CTRL_CMD_FROM_USER*/
  38. #define TAD_NL_MSG_T_HDR_LEN 12
  39. #define TAD_NL_MSG_MAX_LEN 2048
  40. struct tad_nl_msg_t {
  41. unsigned int tad_cmd;
  42. unsigned int tad_data_len;
  43. unsigned int tad_ret_data_len;
  44. char tad_data[TAD_NL_MSG_MAX_LEN];
  45. };
  46. enum {
  47. TA_CATMPLUS = 1,
  48. TA_CONTINUOUS = 2,
  49. TA_CATMPLUS_TTJ = 3
  50. };
  51. struct cATM_params_t {
  52. int CATM_ON;
  53. int K_TT;
  54. int K_SUM_TT_LOW;
  55. int K_SUM_TT_HIGH;
  56. int MIN_SUM_TT;
  57. int MAX_SUM_TT;
  58. int MIN_TTJ;
  59. int CATMP_STEADY_TTJ_DELTA;
  60. };
  61. struct continuetm_params_t {
  62. int STEADY_TARGET_TJ;
  63. int MAX_TARGET_TJ;
  64. int TRIP_TPCB;
  65. int STEADY_TARGET_TPCB;
  66. };
  67. struct CATM_T {
  68. struct cATM_params_t t_catm_par;
  69. struct continuetm_params_t t_continuetm_par;
  70. };
  71. extern struct CATM_T thermal_atm_t;
  72. int wakeup_ta_algo(int flow_state);
  73. int ta_get_ttj(void);
  74. extern int mtk_thermal_get_tpcb_target(void);
  75. extern int tsatm_thermal_get_catm_type(void);