1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */ 2 /* 3 * Copyright (c) 2020 The Linux Foundation. All rights reserved. 4 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. 5 */ 6 7 #ifndef _ATH12K_THERMAL_ 8 #define _ATH12K_THERMAL_ 9 10 #define ATH12K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ) 11 12 struct ath12k_thermal { 13 struct completion wmi_sync; 14 15 /* temperature value in Celsius degree protected by data_lock. */ 16 int temperature; 17 struct device *hwmon_dev; 18 }; 19 20 #if IS_REACHABLE(CONFIG_THERMAL) 21 int ath12k_thermal_register(struct ath12k_base *ab); 22 void ath12k_thermal_unregister(struct ath12k_base *ab); 23 void ath12k_thermal_event_temperature(struct ath12k *ar, int temperature); 24 #else 25 static inline int ath12k_thermal_register(struct ath12k_base *ab) 26 { 27 return 0; 28 } 29 30 static inline void ath12k_thermal_unregister(struct ath12k_base *ab) 31 { 32 } 33 34 static inline void ath12k_thermal_event_temperature(struct ath12k *ar, 35 int temperature) 36 { 37 } 38 39 #endif 40 #endif /* _ATH12K_THERMAL_ */ 41