diff options
Diffstat (limited to 'package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch')
-rw-r--r-- | package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch index 63cca526c2..9a03efdef8 100644 --- a/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch @@ -1,8 +1,8 @@ --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c -@@ -8693,6 +8693,385 @@ void rt2800_rxdcoc_calibration(struct rt +@@ -8685,6 +8685,384 @@ static void rt2800_rxdcoc_calibration(st + rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, saverfb0r2); } - EXPORT_SYMBOL_GPL(rt2800_rxdcoc_calibration); +static u32 rt2800_do_sqrt_accumulation(u32 si) { + u32 root, root_pre, bit; @@ -19,7 +19,7 @@ + return root; +} + -+void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev) { ++static void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev) { + u8 rfb0r1, rfb0r2, rfb0r42; + u8 rfb4r0, rfb4r19; + u8 rfb5r3, rfb5r4, rfb5r17, rfb5r18, rfb5r19, rfb5r20; @@ -82,11 +82,11 @@ + + rt2800_register_write(rt2x00dev, RF_CONTROL1, 0x00000202); + rt2800_register_write(rt2x00dev, RF_BYPASS1, 0x00000303); -+ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) { ++ if (test_bit(CAPABILITY_EXTERNAL_PA_TX0, &rt2x00dev->cap_flags)) + rt2800_register_write(rt2x00dev, RF_CONTROL3, 0x0101); -+ } else { ++ else + rt2800_register_write(rt2x00dev, RF_CONTROL3, 0x0000); -+ } ++ + rt2800_register_write(rt2x00dev, RF_BYPASS3, 0xf1f1); + + rfb0r1 = rt2800_rfcsr_read_bank(rt2x00dev, 0, 1); @@ -340,10 +340,10 @@ + + rt2800_bbp_write(rt2x00dev, 244, 0x00); + bbpval = rt2800_bbp_read(rt2x00dev, 21); -+ bbpval = (bbpval | 0x1); ++ bbpval |= 0x1; + rt2800_bbp_write(rt2x00dev, 21, bbpval); + usleep_range(10, 200); -+ bbpval = (bbpval & 0xfe); ++ bbpval &= 0xfe; + rt2800_bbp_write(rt2x00dev, 21, bbpval); + + rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfb0r1); @@ -381,12 +381,11 @@ + rt2800_register_write(rt2x00dev, RF_BYPASS3, orig_RF_BYPASS3); + rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, savemacsysctrl); +} -+EXPORT_SYMBOL_GPL(rt2800_rxiq_calibration); + static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { -@@ -9305,6 +9684,7 @@ static void rt2800_init_rfcsr_6352(struc +@@ -9297,6 +9675,7 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); rt2800_bw_filter_calibration(rt2x00dev, false); @@ -394,23 +393,3 @@ } static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) ---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h -@@ -246,6 +246,7 @@ void rt2800_rf_self_txdc_cal(struct rt2x - int rt2800_calcrcalibrationcode(struct rt2x00_dev *rt2x00dev, int d1, int d2); - void rt2800_r_calibration(struct rt2x00_dev *rt2x00dev); - void rt2800_rxdcoc_calibration(struct rt2x00_dev *rt2x00dev); -+void rt2800_rxiq_calibration(struct rt2x00_dev *rt2x00dev); - - int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev); - void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev); ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h -@@ -566,6 +566,7 @@ struct rt2x00lib_ops { - int (*calcrcalibrationcode) (struct rt2x00_dev *rt2x00dev, int d1, int d2); - void (*r_calibration) (struct rt2x00_dev *rt2x00dev); - void (*rxdcoc_calibration) (struct rt2x00_dev *rt2x00dev); -+ void (*rxiq_calibration) (struct rt2x00_dev *rt2x00dev); - - /* - * Data queue handlers. |