wifi: mt76: mt7921: Support temp sensor

Allow sensors tool to read radio's temperature, example:

mt7921_phy17-pci-1800
Adapter: PCI adapter
temp1:        +72.0°C

Signed-off-by: Ben Greear <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Ben Greear
2023-06-22 18:39:12 +02:00
committed by Felix Fietkau
parent a729242363
commit 8d52436ee0
3 changed files with 78 additions and 0 deletions
+17
View File
@@ -1313,6 +1313,23 @@ int mt7921_mcu_set_clc(struct mt7921_dev *dev, u8 *alpha2,
return 0;
}
int mt7921_mcu_get_temperature(struct mt7921_phy *phy)
{
struct mt7921_dev *dev = phy->dev;
struct {
u8 ctrl_id;
u8 action;
u8 band_idx;
u8 rsv[5];
} req = {
.ctrl_id = THERMAL_SENSOR_TEMP_QUERY,
.band_idx = phy->mt76->band_idx,
};
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(THERMAL_CTRL), &req,
sizeof(req), true);
}
int mt7921_mcu_set_rxfilter(struct mt7921_dev *dev, u32 fif,
u8 bit_op, u32 bit_map)
{