WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / wireless / ath / ath11k / thermal.h
blobf9af55f3682def093b461eb33530bda4719d3f3f
1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2 /*
3 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
4 */
6 #ifndef _ATH11K_THERMAL_
7 #define _ATH11K_THERMAL_
9 #define ATH11K_THERMAL_TEMP_LOW_MARK -100
10 #define ATH11K_THERMAL_TEMP_HIGH_MARK 150
11 #define ATH11K_THERMAL_THROTTLE_MAX 100
12 #define ATH11K_THERMAL_DEFAULT_DUTY_CYCLE 100
13 #define ATH11K_HWMON_NAME_LEN 15
14 #define ATH11K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)
16 struct ath11k_thermal {
17 struct thermal_cooling_device *cdev;
18 struct completion wmi_sync;
20 /* protected by conf_mutex */
21 u32 throttle_state;
22 /* temperature value in Celcius degree
23 * protected by data_lock
25 int temperature;
28 #if IS_REACHABLE(CONFIG_THERMAL)
29 int ath11k_thermal_register(struct ath11k_base *sc);
30 void ath11k_thermal_unregister(struct ath11k_base *sc);
31 int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);
32 void ath11k_thermal_event_temperature(struct ath11k *ar, int temperature);
33 #else
34 static inline int ath11k_thermal_register(struct ath11k_base *sc)
36 return 0;
39 static inline void ath11k_thermal_unregister(struct ath11k_base *sc)
43 static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)
45 return 0;
48 static inline void ath11k_thermal_event_temperature(struct ath11k *ar,
49 int temperature)
53 #endif
54 #endif /* _ATH11K_THERMAL_ */