0001
0002
0003
0004
0005 #ifndef _THERMAL_
0006 #define _THERMAL_
0007
0008 #define ATH10K_QUIET_PERIOD_DEFAULT 100
0009 #define ATH10K_QUIET_PERIOD_MIN 25
0010 #define ATH10K_QUIET_START_OFFSET 10
0011 #define ATH10K_HWMON_NAME_LEN 15
0012 #define ATH10K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)
0013 #define ATH10K_THERMAL_THROTTLE_MAX 100
0014
0015 struct ath10k_thermal {
0016 struct thermal_cooling_device *cdev;
0017 struct completion wmi_sync;
0018
0019
0020 u32 throttle_state;
0021 u32 quiet_period;
0022
0023
0024
0025 int temperature;
0026 };
0027
0028 #if IS_REACHABLE(CONFIG_THERMAL)
0029 int ath10k_thermal_register(struct ath10k *ar);
0030 void ath10k_thermal_unregister(struct ath10k *ar);
0031 void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
0032 void ath10k_thermal_set_throttling(struct ath10k *ar);
0033 #else
0034 static inline int ath10k_thermal_register(struct ath10k *ar)
0035 {
0036 return 0;
0037 }
0038
0039 static inline void ath10k_thermal_unregister(struct ath10k *ar)
0040 {
0041 }
0042
0043 static inline void ath10k_thermal_event_temperature(struct ath10k *ar,
0044 int temperature)
0045 {
0046 }
0047
0048 static inline void ath10k_thermal_set_throttling(struct ath10k *ar)
0049 {
0050 }
0051
0052 #endif
0053 #endif