wifi: mt76: mt7921: enable thermal protection
Subsystems (2)
PATCH 1/1 wifi: mt76: mt7921: enable thermal protection
From: Allen Chien <[email protected]>
Enable the firmware thermal protection for MT7920/MT7921/MT7922 by sending the DowngradeTxStreamTemp chip config command at init time.
Signed-off-by Allen Chien <[email protected]>
--- .../net/wireless/mediatek/mt76/mt7921/init.c | 6 +++++ .../net/wireless/mediatek/mt76/mt7921/mcu.c | 25 +++++++++++++++++++ .../wireless/mediatek/mt76/mt7921/mt7921.h | 1 + 3 files changed, 32 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7921/init.c +6 -0
@@ -161,6 +161,12 @@ static void mt7921_init_work(struct work_struct *work)return ; } + ret =mt7921_mcu_set_thermal_protect (dev); +if (ret) { +dev_err (dev->mt76.dev,"thermal protection enable failed\n" ); +return ; + } +/* we support chip reset now */ dev->hw_init_done = true;
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +25 -0
@@ -1474,6 +1474,31 @@ int mt7921_mcu_wf_rf_pin_ctrl(struct mt792x_phy *phy, u8 action) sizeof(req), action ? true : false); } +#define MT7921_THERMAL_PROT_LOW_TEMP 105 +#define MT7921_THERMAL_PROT_HIGH_TEMP 115 + +static int mt7921_mcu_chip_config (struct mt792x_dev *dev,const char *cmd) +{ +struct mt76_connac_config req = { + .resp_type =0 , + }; + +snprintf (req.data,sizeof (req.data),"%s" , cmd); + +return mt76_mcu_send_msg (&dev->mt76,MCU_CE_CMD (CHIP_CONFIG ), + &req,sizeof (req), false); +} + +int mt7921_mcu_set_thermal_protect (struct mt792x_dev *dev) +{ +char cmd[64 ]; + +snprintf (cmd,sizeof (cmd),"DowngradeTxStreamTemp %d %d" , +MT7921_THERMAL_PROT_LOW_TEMP ,MT7921_THERMAL_PROT_HIGH_TEMP ); + +return mt7921_mcu_chip_config (dev, cmd); +} +int mt7921_mcu_set_rxfilter (struct mt792x_dev *dev,u32 fif,u8 bit_op,u32 bit_map) {
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +1 -0
@@ -324,6 +324,7 @@ int mt7921_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,int mt7921_mcu_config_sniffer (struct mt792x_vif *vif,struct ieee80211_chanctx_conf *ctx);int mt7921_mcu_get_temperature (struct mt792x_phy *phy); +int mt7921_mcu_set_thermal_protect (struct mt792x_dev *dev); int mt7921_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, enum mt76_txq_id qid, struct mt76_wcid *wcid,
Signature · 1 line
2.45.2