Rajkumar Manoharan | fe6f36d | 2014-12-17 12:22:07 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2014 Qualcomm Atheros, Inc. |
| 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for any |
| 5 | * purpose with or without fee is hereby granted, provided that the above |
| 6 | * copyright notice and this permission notice appear in all copies. |
| 7 | * |
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 15 | */ |
| 16 | #ifndef _THERMAL_ |
| 17 | #define _THERMAL_ |
| 18 | |
| 19 | #define ATH10K_QUIET_PERIOD_DEFAULT 100 |
| 20 | #define ATH10K_QUIET_PERIOD_MIN 25 |
| 21 | #define ATH10K_QUIET_START_OFFSET 10 |
Rajkumar Manoharan | a13e6ae | 2015-02-19 23:25:05 +0530 | [diff] [blame^] | 22 | #define ATH10K_QUIET_DUTY_CYCLE_MAX 100 |
Rajkumar Manoharan | ac2953f | 2014-12-17 12:22:26 +0200 | [diff] [blame] | 23 | #define ATH10K_HWMON_NAME_LEN 15 |
| 24 | #define ATH10K_THERMAL_SYNC_TIMEOUT_HZ (5*HZ) |
Rajkumar Manoharan | fe6f36d | 2014-12-17 12:22:07 +0200 | [diff] [blame] | 25 | |
| 26 | struct ath10k_thermal { |
| 27 | struct thermal_cooling_device *cdev; |
Rajkumar Manoharan | ac2953f | 2014-12-17 12:22:26 +0200 | [diff] [blame] | 28 | struct completion wmi_sync; |
Rajkumar Manoharan | fe6f36d | 2014-12-17 12:22:07 +0200 | [diff] [blame] | 29 | |
| 30 | /* protected by conf_mutex */ |
| 31 | u32 duty_cycle; |
Rajkumar Manoharan | ac2953f | 2014-12-17 12:22:26 +0200 | [diff] [blame] | 32 | /* temperature value in Celcius degree |
| 33 | * protected by data_lock |
| 34 | */ |
| 35 | int temperature; |
Rajkumar Manoharan | fe6f36d | 2014-12-17 12:22:07 +0200 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | #ifdef CONFIG_THERMAL |
| 39 | int ath10k_thermal_register(struct ath10k *ar); |
| 40 | void ath10k_thermal_unregister(struct ath10k *ar); |
Rajkumar Manoharan | ac2953f | 2014-12-17 12:22:26 +0200 | [diff] [blame] | 41 | void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature); |
Rajkumar Manoharan | fe6f36d | 2014-12-17 12:22:07 +0200 | [diff] [blame] | 42 | #else |
| 43 | static inline int ath10k_thermal_register(struct ath10k *ar) |
| 44 | { |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | static inline void ath10k_thermal_unregister(struct ath10k *ar) |
| 49 | { |
| 50 | } |
Rajkumar Manoharan | ac2953f | 2014-12-17 12:22:26 +0200 | [diff] [blame] | 51 | |
| 52 | static inline void ath10k_thermal_event_temperature(struct ath10k *ar, |
| 53 | int temperature) |
| 54 | { |
| 55 | } |
| 56 | |
Rajkumar Manoharan | fe6f36d | 2014-12-17 12:22:07 +0200 | [diff] [blame] | 57 | #endif |
| 58 | #endif /* _THERMAL_ */ |