summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath10k/thermal.c
AgeCommit message (Collapse)Author
2015-10-14ath10k: fix cleanup in ath10k_thermal_unregisterMohammed Shafi Shajakhan
First remove the 'cooling_device#n' syslink created for ath10k and then unregsiter from the thermal subsystem(cooling) Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-04-01ath10k: don't call quiet mode if it's not implementedMichal Kazior
qca6174 and wmi-tlv doesn't have quiet mode implemented. Don't even attempt to call it. This fixes a warning when bringing first interface up: failed to set quiet mode period 100 duarion 0 enabled 0 ret -95 Fixes: 8515b5c79a54 ("ath10k: configure thermal throttle while powering up") Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-04-01ath10k: thermal: match wait_for_completion_timeout return typeNicholas Mc Guire
Return type of wait_for_completion_timeout is unsigned long not int. An appropriately named unsigned long is added and the assignments fixed up. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-23ath10k: move driver state check before setting throttleRajkumar Manoharan
Since thermal daemon is unaware of the device state, it might try to adjust the throttle state when the device is powered down. So the driver caches the value and will configure it while powering up the target. The cached value will be programed later once the device is brought up. In such case, returning error status is confusing and misleading the user application. Hence moving the driver state check before sending wmi command to target. Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-23ath10k: cache throttle state when device is downRajkumar Manoharan
Allow driver to cache the throttle state when the devie is not yet started. Configure the cached throttle state while powering up the device. Since thermal daemon is unaware of the up/down cycle, it assumes that device is throttled. Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-23ath10k: do not restrict thermal throttling to ap modeRajkumar Manoharan
Recently thermal mitigation is validated in station mode as well. Hence allowing thermal throttling for all interfaces. This enables user to validate thermal mitigation with different modes. Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-23ath10k: configure thermal throttle while powering upRajkumar Manoharan
Thermal throttling is not handled in software restart and device bootup. Also it needs to be configured whenever quiet period got updated. Fix that. Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-23ath10k: fix interpretation of cooling device stateRajkumar Manoharan
Setting the sysfs attribute ends up configuring the duty cycle, but the interface through which the attribute is exposed (cooling_device) is for setting the throttle/cooling state. This is confusing the user. Hence renaming the cooling device interfaces for better readability. Cc: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-23ath10k: add debugfs entry to configure quiet periodRajkumar Manoharan
Add support to configure quiet period (in milliseconds) via debugfs. This is useful to experiment different quiet period values along with different throttle ratio. echo 100 > /sys/kernel/debug/ieee80211/phyX/ath10k/quiet_period Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-19ath10k: fix wrong symlink name on error pathRajkumar Manoharan
Wrong symlink name is used on error path of thermal registration and also correcting the error message. Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15ath10k: fix hwmon temperature input unitsRajkumar Manoharan
To be compliant with the hwmon interface the unit needs to be millidegree Celsius. Fix that. Reported-by: Matthias Kaehlcke <mka@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15ath10k: fix duration calculation for quiet paramRajkumar Manoharan
The duty cycle (% of quiet duration) is used to put the device in quiet mode for the given period. Currently the quiet duration is wrongly calculated which results in not enabling quiet mode. Fix the calculation as below duration = (period * duty cycle) / 100 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-13ath10k: fix config_enabled check for hwmonRajkumar Manoharan
Because of wrong macro check in commit 96bba98393f9 ("ath10k: fix build error when hwmon is off"), hwmon never be enabled. Fix that. Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-09ath10k: fix build error when hwmon is offKalle Valo
kbuild reported a linking error: ERROR: "devm_hwmon_device_register_with_groups" [drivers/net/wireless/ath/ath10k/ath10k_core.ko] undefined! Fix it by returning early and letting the compiler to optimise out the function call. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-12-23ath10k: add thermal sensor device supportRajkumar Manoharan
Temperature sensor generates electrical analog voltage from temperature of each chain. The analog voltage is converted to digital value through ADC. For reading temperature values fom user space, hw monitoring device is used. Whenever the user requests for current temperature, the driver sends WMI command and wait for response. For reading temperature, cat /sys/class/ieee80211/phy*/device/hwmon/hwmon2/temp1_input Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2014-12-23ath10k: add thermal cooling device supportRajkumar Manoharan
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>