thermal.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: ISC */
  2. /*
  3. * Copyright (c) 2014-2016 Qualcomm Atheros, Inc.
  4. */
  5. #ifndef _THERMAL_
  6. #define _THERMAL_
  7. #define ATH10K_QUIET_PERIOD_DEFAULT 100
  8. #define ATH10K_QUIET_PERIOD_MIN 25
  9. #define ATH10K_QUIET_START_OFFSET 10
  10. #define ATH10K_HWMON_NAME_LEN 15
  11. #define ATH10K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)
  12. #define ATH10K_THERMAL_THROTTLE_MAX 100
  13. struct ath10k_thermal {
  14. struct thermal_cooling_device *cdev;
  15. struct completion wmi_sync;
  16. /* protected by conf_mutex */
  17. u32 throttle_state;
  18. u32 quiet_period;
  19. /* temperature value in Celsius degree
  20. * protected by data_lock
  21. */
  22. int temperature;
  23. };
  24. #if IS_REACHABLE(CONFIG_THERMAL)
  25. int ath10k_thermal_register(struct ath10k *ar);
  26. void ath10k_thermal_unregister(struct ath10k *ar);
  27. void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
  28. void ath10k_thermal_set_throttling(struct ath10k *ar);
  29. #else
  30. static inline int ath10k_thermal_register(struct ath10k *ar)
  31. {
  32. return 0;
  33. }
  34. static inline void ath10k_thermal_unregister(struct ath10k *ar)
  35. {
  36. }
  37. static inline void ath10k_thermal_event_temperature(struct ath10k *ar,
  38. int temperature)
  39. {
  40. }
  41. static inline void ath10k_thermal_set_throttling(struct ath10k *ar)
  42. {
  43. }
  44. #endif
  45. #endif /* _THERMAL_ */