]> git.ipfire.org Git - thirdparty/linux.git/blame - drivers/net/wireless/ath/ath11k/thermal.h
Merge tag 'drm/tegra/for-5.7-fixes' of git://anongit.freedesktop.org/tegra/linux...
[thirdparty/linux.git] / drivers / net / wireless / ath / ath11k / thermal.h
CommitLineData
2a63bbca
PKC
1/* SPDX-License-Identifier: BSD-3-Clause-Clear */
2/*
3 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
4 */
5
6#ifndef _ATH11K_THERMAL_
7#define _ATH11K_THERMAL_
8
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
a41d1034
PKC
13#define ATH11K_HWMON_NAME_LEN 15
14#define ATH11K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)
2a63bbca
PKC
15
16struct ath11k_thermal {
17 struct thermal_cooling_device *cdev;
a41d1034 18 struct completion wmi_sync;
2a63bbca
PKC
19
20 /* protected by conf_mutex */
21 u32 throttle_state;
a41d1034
PKC
22 /* temperature value in Celcius degree
23 * protected by data_lock
24 */
25 int temperature;
2a63bbca
PKC
26};
27
28#if IS_REACHABLE(CONFIG_THERMAL)
29int ath11k_thermal_register(struct ath11k_base *sc);
30void ath11k_thermal_unregister(struct ath11k_base *sc);
31int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);
a41d1034 32void ath11k_thermal_event_temperature(struct ath11k *ar, int temperature);
2a63bbca
PKC
33#else
34static inline int ath11k_thermal_register(struct ath11k_base *sc)
35{
36 return 0;
37}
38
c9be1a64 39static inline void ath11k_thermal_unregister(struct ath11k_base *sc)
2a63bbca
PKC
40{
41}
42
43static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)
44{
c9be1a64 45 return 0;
2a63bbca
PKC
46}
47
a41d1034
PKC
48static inline void ath11k_thermal_event_temperature(struct ath11k *ar,
49 int temperature)
50{
51}
52
2a63bbca
PKC
53#endif
54#endif /* _ATH11K_THERMAL_ */