Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
0002 /*
0003  * Copyright (c) 2020 The Linux Foundation. All rights reserved.
0004  */
0005 
0006 #ifndef _ATH11K_THERMAL_
0007 #define _ATH11K_THERMAL_
0008 
0009 #define ATH11K_THERMAL_TEMP_LOW_MARK -100
0010 #define ATH11K_THERMAL_TEMP_HIGH_MARK 150
0011 #define ATH11K_THERMAL_THROTTLE_MAX     100
0012 #define ATH11K_THERMAL_DEFAULT_DUTY_CYCLE 100
0013 #define ATH11K_HWMON_NAME_LEN           15
0014 #define ATH11K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)
0015 
0016 struct ath11k_thermal {
0017     struct thermal_cooling_device *cdev;
0018     struct completion wmi_sync;
0019 
0020     /* protected by conf_mutex */
0021     u32 throttle_state;
0022     /* temperature value in Celcius degree
0023      * protected by data_lock
0024      */
0025     int temperature;
0026 };
0027 
0028 #if IS_REACHABLE(CONFIG_THERMAL)
0029 int ath11k_thermal_register(struct ath11k_base *sc);
0030 void ath11k_thermal_unregister(struct ath11k_base *sc);
0031 int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);
0032 void ath11k_thermal_event_temperature(struct ath11k *ar, int temperature);
0033 #else
0034 static inline int ath11k_thermal_register(struct ath11k_base *sc)
0035 {
0036     return 0;
0037 }
0038 
0039 static inline void ath11k_thermal_unregister(struct ath11k_base *sc)
0040 {
0041 }
0042 
0043 static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)
0044 {
0045     return 0;
0046 }
0047 
0048 static inline void ath11k_thermal_event_temperature(struct ath11k *ar,
0049                             int temperature)
0050 {
0051 }
0052 
0053 #endif
0054 #endif /* _ATH11K_THERMAL_ */