diff --git a/mt76x0/phy.c b/mt76x0/phy.c index ec554a059..c96dc53d9 100644 --- a/mt76x0/phy.c +++ b/mt76x0/phy.c @@ -1036,15 +1036,16 @@ static void mt76x0_phy_temp_sensor(struct mt76x02_dev *dev) val = mt76_rr(dev, MT_BBP(CORE, 35)); val = (35 * (val - dev->cal.rx.temp_offset)) / 10 + 25; + dev->cal.temp = val; if (abs(val - dev->cal.temp_vco) > 20) { mt76x02_mcu_calibrate(dev, MCU_CAL_VCO, dev->mphy.chandef.chan->hw_value); dev->cal.temp_vco = val; } - if (abs(val - dev->cal.temp) > 30) { + if (abs(val - dev->cal.temp_phy) > 30) { mt76x0_phy_calibrate(dev, false); - dev->cal.temp = val; + dev->cal.temp_phy = val; } done: diff --git a/mt76x02.h b/mt76x02.h index 4cd63bacd..913990641 100644 --- a/mt76x02.h +++ b/mt76x02.h @@ -46,6 +46,7 @@ struct mt76x02_calibration { s8 agc_lowest_gain; s8 low_gain; + s8 temp_phy; s8 temp_vco; s8 temp; diff --git a/mt76x02_debugfs.c b/mt76x02_debugfs.c index 8ce4bf447..661fb1b96 100644 --- a/mt76x02_debugfs.c +++ b/mt76x02_debugfs.c @@ -139,7 +139,11 @@ void mt76x02_init_debugfs(struct mt76x02_dev *dev) debugfs_create_devm_seqfile(dev->mt76.dev, "xmit-queues", dir, mt76_queues_read); + + debugfs_create_u8("phy_cal_temperature", 0400, dir, &dev->cal.temp_phy); + debugfs_create_u8("vco_cal_temperature", 0400, dir, &dev->cal.temp_vco); debugfs_create_u8("temperature", 0400, dir, &dev->cal.temp); + debugfs_create_bool("tpc", 0600, dir, &dev->enable_tpc); debugfs_create_file("edcca", 0600, dir, dev, &fops_edcca);