mt76: mt7915: add thermal cooling device support
authorRyder Lee <ryder.lee@mediatek.com>
Fri, 23 Apr 2021 22:02:05 +0000 (06:02 +0800)
committerFelix Fietkau <nbd@nbd.name>
Sat, 19 Jun 2021 07:22:45 +0000 (09:22 +0200)
commit34b877d972bec8cbf397a57393317672cf92996f
tree1c362e0c61a3d14b3ea828f1ce5b336f848fc8b1
parent33fe9c639c13de03ce04a1dc2c904d66d1cd02eb
mt76: mt7915: 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 by adjusting Tx period by given percentage of time. The thermal
device allows user to configure duty cycle.

Throttling 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

To set duty cycle as 80%,
echo 80 > /sys/class/ieee80211/phy*/cooling_device/cur_state

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/init.c
drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h