brintos

brintos / linux-shallow public Read only

0
0
Text · 1.4 KiB · cdaf4e0 Raw
56 lines · c
1/* SPDX-License-Identifier: BSD-3-Clause-Clear */2/*3 * Copyright (c) 2020 The Linux Foundation. All rights reserved.4 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.5 */6 7#ifndef _ATH11K_THERMAL_8#define _ATH11K_THERMAL_9 10#define ATH11K_THERMAL_TEMP_LOW_MARK -10011#define ATH11K_THERMAL_TEMP_HIGH_MARK 15012#define ATH11K_THERMAL_THROTTLE_MAX     10013#define ATH11K_THERMAL_DEFAULT_DUTY_CYCLE 10014#define ATH11K_HWMON_NAME_LEN           1515#define ATH11K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)16 17struct ath11k_thermal {18	struct thermal_cooling_device *cdev;19	struct completion wmi_sync;20 21	/* protected by conf_mutex */22	u32 throttle_state;23	/* temperature value in Celsius degree24	 * protected by data_lock25	 */26	int temperature;27};28 29#if IS_REACHABLE(CONFIG_THERMAL)30int ath11k_thermal_register(struct ath11k_base *ab);31void ath11k_thermal_unregister(struct ath11k_base *ab);32int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);33void ath11k_thermal_event_temperature(struct ath11k *ar, int temperature);34#else35static inline int ath11k_thermal_register(struct ath11k_base *ab)36{37	return 0;38}39 40static inline void ath11k_thermal_unregister(struct ath11k_base *ab)41{42}43 44static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)45{46	return 0;47}48 49static inline void ath11k_thermal_event_temperature(struct ath11k *ar,50						    int temperature)51{52}53 54#endif55#endif /* _ATH11K_THERMAL_ */56