WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / wireless / ath / ath10k / thermal.h
blob5fdb020f4da38780c9105a06714547718523b880
1 /* SPDX-License-Identifier: ISC */
2 /*
3 * Copyright (c) 2014-2016 Qualcomm Atheros, Inc.
4 */
5 #ifndef _THERMAL_
6 #define _THERMAL_
8 #define ATH10K_QUIET_PERIOD_DEFAULT 100
9 #define ATH10K_QUIET_PERIOD_MIN 25
10 #define ATH10K_QUIET_START_OFFSET 10
11 #define ATH10K_HWMON_NAME_LEN 15
12 #define ATH10K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)
13 #define ATH10K_THERMAL_THROTTLE_MAX 100
15 struct ath10k_thermal {
16 struct thermal_cooling_device *cdev;
17 struct completion wmi_sync;
19 /* protected by conf_mutex */
20 u32 throttle_state;
21 u32 quiet_period;
22 /* temperature value in Celcius degree
23 * protected by data_lock
25 int temperature;
28 #if IS_REACHABLE(CONFIG_THERMAL)
29 int ath10k_thermal_register(struct ath10k *ar);
30 void ath10k_thermal_unregister(struct ath10k *ar);
31 void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
32 void ath10k_thermal_set_throttling(struct ath10k *ar);
33 #else
34 static inline int ath10k_thermal_register(struct ath10k *ar)
36 return 0;
39 static inline void ath10k_thermal_unregister(struct ath10k *ar)
43 static inline void ath10k_thermal_event_temperature(struct ath10k *ar,
44 int temperature)
48 static inline void ath10k_thermal_set_throttling(struct ath10k *ar)
52 #endif
53 #endif /* _THERMAL_ */