Merge tag 'wireless-drivers-next-for-davem-2018-11-30' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== wireless-drivers-next patches for 4.21 First set of patches for 4.21. Most notable here is support for Quantenna's QSR1000/QSR2000 chipsets and more flexible ways to provide nvram files for brcmfmac. Major changes: brcmfmac * add support for first trying to get a board specific nvram file * add support for getting nvram contents from EFI variables qtnfmac * use single PCIe driver for all platforms and rename Kconfig option CONFIG_QTNFMAC_PEARL_PCIE to CONFIG_QTNFMAC_PCIE * add support for QSR1000/QSR2000 (Topaz) family of chipsets ath10k * add support for WCN3990 firmware crash recovery * add firmware memory dump support for QCA4019 wil6210 * add firmware error recovery while in AP mode ath9k * remove experimental notice from dynack feature iwlwifi * PCI IDs for some new 9000-series cards * improve antenna usage on connection problems * new firmware debugging infrastructure * some more work on 802.11ax * improve support for multiple RF modules with 22000 devices cordic * move cordic macros and defines to a public header file * convert brcmsmac and b43 to fully use cordic library ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
23
lib/cordic.c
23
lib/cordic.c
@@ -16,15 +16,6 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/cordic.h>
|
||||
|
||||
#define CORDIC_ANGLE_GEN 39797
|
||||
#define CORDIC_PRECISION_SHIFT 16
|
||||
#define CORDIC_NUM_ITER (CORDIC_PRECISION_SHIFT + 2)
|
||||
|
||||
#define FIXED(X) ((s32)((X) << CORDIC_PRECISION_SHIFT))
|
||||
#define FLOAT(X) (((X) >= 0) \
|
||||
? ((((X) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1) \
|
||||
: -((((-(X)) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1))
|
||||
|
||||
static const s32 arctan_table[] = {
|
||||
2949120,
|
||||
1740967,
|
||||
@@ -64,16 +55,16 @@ struct cordic_iq cordic_calc_iq(s32 theta)
|
||||
coord.q = 0;
|
||||
angle = 0;
|
||||
|
||||
theta = FIXED(theta);
|
||||
theta = CORDIC_FIXED(theta);
|
||||
signtheta = (theta < 0) ? -1 : 1;
|
||||
theta = ((theta + FIXED(180) * signtheta) % FIXED(360)) -
|
||||
FIXED(180) * signtheta;
|
||||
theta = ((theta + CORDIC_FIXED(180) * signtheta) % CORDIC_FIXED(360)) -
|
||||
CORDIC_FIXED(180) * signtheta;
|
||||
|
||||
if (FLOAT(theta) > 90) {
|
||||
theta -= FIXED(180);
|
||||
if (CORDIC_FLOAT(theta) > 90) {
|
||||
theta -= CORDIC_FIXED(180);
|
||||
signx = -1;
|
||||
} else if (FLOAT(theta) < -90) {
|
||||
theta += FIXED(180);
|
||||
} else if (CORDIC_FLOAT(theta) < -90) {
|
||||
theta += CORDIC_FIXED(180);
|
||||
signx = -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user