54 lines · c
1/* SPDX-License-Identifier: ISC */2/*3 * Copyright (c) 2014-2016 Qualcomm Atheros, Inc.4 */5#ifndef _THERMAL_6#define _THERMAL_7 8#define ATH10K_QUIET_PERIOD_DEFAULT 1009#define ATH10K_QUIET_PERIOD_MIN 2510#define ATH10K_QUIET_START_OFFSET 1011#define ATH10K_HWMON_NAME_LEN 1512#define ATH10K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)13#define ATH10K_THERMAL_THROTTLE_MAX 10014 15struct ath10k_thermal {16 struct thermal_cooling_device *cdev;17 struct completion wmi_sync;18 19 /* protected by conf_mutex */20 u32 throttle_state;21 u32 quiet_period;22 /* temperature value in Celsius degree23 * protected by data_lock24 */25 int temperature;26};27 28#if IS_REACHABLE(CONFIG_THERMAL)29int ath10k_thermal_register(struct ath10k *ar);30void ath10k_thermal_unregister(struct ath10k *ar);31void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);32void ath10k_thermal_set_throttling(struct ath10k *ar);33#else34static inline int ath10k_thermal_register(struct ath10k *ar)35{36 return 0;37}38 39static inline void ath10k_thermal_unregister(struct ath10k *ar)40{41}42 43static inline void ath10k_thermal_event_temperature(struct ath10k *ar,44 int temperature)45{46}47 48static inline void ath10k_thermal_set_throttling(struct ath10k *ar)49{50}51 52#endif53#endif /* _THERMAL_ */54