brcmsmac: Use cordic-related macros from common cordic library
authorPriit Laes <plaes@plaes.org>
Mon, 19 Nov 2018 18:01:23 +0000 (20:01 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 29 Nov 2018 15:30:49 +0000 (17:30 +0200)
Current driver includes macro that is available from general cordic
library. Use that and drop unused duplicate and unneeded internal
definitions.

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_int.h
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c

index 4960f7d2680430313d42e3e7e64787a21c0f8dde..e9e8337f386c65138b2895ab96b0c16828c2ec31 100644 (file)
@@ -220,13 +220,6 @@ enum phy_cal_mode {
 #define BB_MULT_MASK           0x0000ffff
 #define BB_MULT_VALID_MASK     0x80000000
 
-#define CORDIC_AG      39797
-#define        CORDIC_NI       18
-#define        FIXED(X)        ((s32)((X) << 16))
-
-#define        FLOAT(X) \
-       (((X) >= 0) ? ((((X) >> 15) + 1) >> 1) : -((((-(X)) >> 15) + 1) >> 1))
-
 #define PHY_CHAIN_TX_DISABLE_TEMP      115
 #define PHY_HYSTERESIS_DELTATEMP       5
 
index 9fb0d9fbd93958e11b4eca19428c280a198f5628..e78a93a45741bd5d18fc501bfc0c0e2e31aabc6b 100644 (file)
@@ -3447,8 +3447,8 @@ wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz, u16 max_val,
 
                theta += rot;
 
-               i_samp = (u16) (FLOAT(tone_samp.i * max_val) & 0x3ff);
-               q_samp = (u16) (FLOAT(tone_samp.q * max_val) & 0x3ff);
+               i_samp = (u16)(CORDIC_FLOAT(tone_samp.i * max_val) & 0x3ff);
+               q_samp = (u16)(CORDIC_FLOAT(tone_samp.q * max_val) & 0x3ff);
                data_buf[t] = (i_samp << 10) | q_samp;
        }
 
index a57f2711f3c02296885ef6494414ef5b099becde..f4f5e90441521eb3e25ef4f84438c37498a02ef9 100644 (file)
@@ -23089,8 +23089,8 @@ wlc_phy_gen_load_samples_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val,
 
                theta += rot;
 
-               tone_buf[t].q = (s32) FLOAT(tone_buf[t].q * max_val);
-               tone_buf[t].i = (s32) FLOAT(tone_buf[t].i * max_val);
+               tone_buf[t].q = (s32)CORDIC_FLOAT(tone_buf[t].q * max_val);
+               tone_buf[t].i = (s32)CORDIC_FLOAT(tone_buf[t].i * max_val);
        }
 
        wlc_phy_loadsampletable_nphy(pi, tone_buf, num_samps);