Search Linux Wireless

Re: [PATCH] mt76x0: use band parameter for LC calibration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
> index c734987a344c..ca24b5716b58 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
> @@ -522,6 +522,7 @@ void mt76x0_phy_set_txpower(struct mt76x02_dev *dev)
>  void mt76x0_phy_calibrate(struct mt76x02_dev *dev, bool power_on)
>  {
>  	struct ieee80211_channel *chan = dev->mt76.chandef.chan;
> +	int is_5ghz = (chan->band == NL80211_BAND_5GHZ) ? 1 : 0;
>  	u32 val, tx_alc, reg_val;
>  
>  	if (is_mt7630(dev))
> @@ -542,7 +543,7 @@ void mt76x0_phy_calibrate(struct mt76x02_dev *dev, bool power_on)
>  	reg_val = mt76_rr(dev, MT_BBP(IBI, 9));
>  	mt76_wr(dev, MT_BBP(IBI, 9), 0xffffff7e);
>  
> -	if (chan->band == NL80211_BAND_5GHZ) {
> +	if (is_5ghz) {
>  		if (chan->hw_value < 100)
>  			val = 0x701;
>  		else if (chan->hw_value < 140)
> @@ -555,7 +556,7 @@ void mt76x0_phy_calibrate(struct mt76x02_dev *dev, bool power_on)
>  
>  	mt76x02_mcu_calibrate(dev, MCU_CAL_FULL, val, false);
>  	msleep(350);
> -	mt76x02_mcu_calibrate(dev, MCU_CAL_LC, 1, false);
> +	mt76x02_mcu_calibrate(dev, MCU_CAL_LC, is_5ghz, false);
>  	usleep_range(15000, 20000);
>  
>  	mt76_wr(dev, MT_BBP(IBI, 9), reg_val);
> -- 
> 2.7.5
> 

Tested-by: Lorenzo Bianconi <lorenzo.bianconi@xxxxxxxxxx>

Regards,
Lorenzo



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux