Skip to content
Permalink
Browse files

mac80211: rt2x00: cleanup ePA, RXIQ and TX-LOFT code

consolidate patch 651-rt2x00-remove-unneccesary-code.patch.
fixup the most obvious whitespace problems in RXIQ and TX-LOFT code.
always backup registers bbpr1, bbpr4, bbpr241 and bbpr242 to avoid
compiler warning about them being potentially uninitialized.
no functional changes (intended)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information...
dangowrt committed Mar 1, 2019
1 parent 7cf6e11 commit 98f86e61ea95b482f4613795a79626c353b135c4
@@ -6,8 +6,13 @@ To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>,
linux-wireless@vger.kernel.org,
Kalle Valo <kvalo@codeaurora.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
[pozega.tomislav@gmail.com: use chanreg and dccal helpers.]

---
drivers/net/wireless/ralink/rt2x00/rt2800.h | 1 +
drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 70 +++++++++++++++++++++++++-
@@ -25,7 +30,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* EEPROM LNA
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -4290,6 +4290,61 @@ static void rt2800_config_channel(struct
@@ -4290,6 +4290,45 @@ static void rt2800_config_channel(struct
rt2800_iq_calibrate(rt2x00dev, rf->channel);
}

@@ -42,38 +47,22 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+ reg |= 0x00000101;
+ rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
+
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 43, 0x73);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 43, 0x73);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 44, 0x73);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 44, 0x73);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 45, 0x73);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0x73);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 46, 0x27);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 46, 0x27);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 47, 0xC8);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 47, 0xC8);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 48, 0xA4);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 48, 0xA4);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 49, 0x05);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 49, 0x05);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 54, 0x27);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 54, 0x27);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 55, 0xC8);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 55, 0xC8);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 56, 0xA4);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 56, 0xA4);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 57, 0x05);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 57, 0x05);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 58, 0x27);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 58, 0x27);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 59, 0xC8);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 59, 0xC8);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 60, 0xA4);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 60, 0xA4);
+ rt2800_rfcsr_write_bank(rt2x00dev, 4, 61, 0x05);
+ rt2800_rfcsr_write_bank(rt2x00dev, 6, 61, 0x05);
+ rt2800_rfcsr_write_bank(rt2x00dev, 5, 05, 0x00);
+ rt2800_rfcsr_write_bank(rt2x00dev, 7, 05, 0x00);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xC8);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xA4);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xC8);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xA4);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xC8);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xA4);
+ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05);
+ rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00);
+
+ rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT,
+ 0x36303636);
@@ -87,7 +76,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
bbp = rt2800_bbp_read(rt2x00dev, 4);
rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf));
rt2800_bbp_write(rt2x00dev, 4, bbp);
@@ -9487,7 +9542,8 @@ static int rt2800_init_eeprom(struct rt2
@@ -9487,7 +9526,8 @@ static int rt2800_init_eeprom(struct rt2
*/
eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1);

@@ -97,7 +86,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
if (rt2x00_get_field16(eeprom,
EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
__set_bit(CAPABILITY_EXTERNAL_PA_TX0,
@@ -9498,6 +9554,18 @@ static int rt2800_init_eeprom(struct rt2
@@ -9498,6 +9538,18 @@ static int rt2800_init_eeprom(struct rt2
&rt2x00dev->cap_flags);
}

This file was deleted.

@@ -274,7 +274,7 @@
+ vga_idx = vga_idx + 3;
+ else if (bbpval1 <= 2511)
+ vga_idx = vga_idx + 2;
+ else
+ else
+ vga_idx = vga_idx + 1;
+ }
+
@@ -285,7 +285,7 @@
+ rt2x00_dbg(rt2x00dev, "Sigma_i=%d, Sigma_q=%d, R_iq=%d", sigma_i, sigma_q, r_iq);
+
+ if (((sigma_i <= 1400 ) && (sigma_i >= 1000))
+ && ((sigma_i - sigma_q) <= 112)
+ && ((sigma_i - sigma_q) <= 112)
+ && ((sigma_i - sigma_q) >= -112)
+ && ((mi <= 32) && (mi >= -32))
+ && ((mq <= 32) && (mq >= -32))) {

0 comments on commit 98f86e6

Please sign in to comment.
You can’t perform that action at this time.