diff options
author | Rajkumar Manoharan <rmanohar@qti.qualcomm.com> | 2014-12-17 12:22:07 +0200 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-12-23 17:18:27 +0200 |
commit | fe6f36d62152ba85a8928e46fc2cbb919538c51d (patch) | |
tree | bd2bdba90078f7af4b53b54a7eda3ff8a8a4bb42 /drivers/net/wireless/ath/ath10k/thermal.h | |
parent | ffdd738d90f0d9d609e3d790059ab4d351a75963 (diff) | |
download | lwn-fe6f36d62152ba85a8928e46fc2cbb919538c51d.tar.gz lwn-fe6f36d62152ba85a8928e46fc2cbb919538c51d.zip |
ath10k: add thermal cooling device support
Thermal cooling device support is added to control the temperature
by throttling the data transmission for the given duration. Throttling
is done using hw MAC quiet time setting. Period, duration and offset
from TBTT can be set up to quiet the MAC transmits for the required duty
cycle (% of quiet duration). The thermal device allows user to configure
duty cycle.
The quiet params are derived as follows.
period = max(25TU, beacon interval / number of bss)
duration = period * duty cycle / 100
Quiet mode can be disabled by setting the duty cycle to 0. The cooling
device can be found under /sys/class/thermal/cooling_deviceX/.
Corresponding soft link to this device can be found under phy folder.
/sys/class/ieee80211/phy*/device/cooling_device.
To set duty cycle as 40%,
echo 40 >/sys/class/ieee80211/phy*/device/cooling_device/cur_state
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/thermal.h')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/thermal.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/thermal.h b/drivers/net/wireless/ath/ath10k/thermal.h new file mode 100644 index 000000000000..e20bb87849ae --- /dev/null +++ b/drivers/net/wireless/ath/ath10k/thermal.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2014 Qualcomm Atheros, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +#ifndef _THERMAL_ +#define _THERMAL_ + +#define ATH10K_QUIET_PERIOD_DEFAULT 100 +#define ATH10K_QUIET_PERIOD_MIN 25 +#define ATH10K_QUIET_START_OFFSET 10 +#define ATH10K_QUIET_DUTY_CYCLE_MAX 70 + +struct ath10k_thermal { + struct thermal_cooling_device *cdev; + + /* protected by conf_mutex */ + u32 duty_cycle; +}; + +#ifdef CONFIG_THERMAL +int ath10k_thermal_register(struct ath10k *ar); +void ath10k_thermal_unregister(struct ath10k *ar); +#else +static inline int ath10k_thermal_register(struct ath10k *ar) +{ + return 0; +} + +static inline void ath10k_thermal_unregister(struct ath10k *ar) +{ +} +#endif +#endif /* _THERMAL_ */ |