rt2800: comment and simplify AGC init for RT6352
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 13 Feb 2019 10:09:16 +0000 (11:09 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 19 Feb 2019 15:18:57 +0000 (17:18 +0200)
We do not need separate lines for calculating register values.
Also add comment that value is different than in vendor driver.

Suggested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ralink/rt2x00/rt2800lib.c

index 6886e09c0b279c42269003077be6c677c64b3a44..a03b5284a050952448f806d3e74cc164bea5a4a1 100644 (file)
@@ -3989,9 +3989,12 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev,
                rt2800_bbp_write(rt2x00dev, 195, 141);
                rt2800_bbp_write(rt2x00dev, 196, reg);
 
-               /* AGC init */
-               reg = rf->channel <= 14 ? 0x1c : 0x24;
-               reg += 2 * rt2x00dev->lna_gain;
+               /* AGC init.
+                * Despite the vendor driver using different values here for
+                * RT6352 chip, we use 0x1c for now. This may have to be changed
+                * once TSSI got implemented.
+                */
+               reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain;
                rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, reg);
 
                rt2800_iq_calibrate(rt2x00dev, rf->channel);