From 77b9ee6a9f0e0c3697cbadf2fd59e46ea5c64def Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 26 Jan 2019 17:16:20 +0100 Subject: backports: Add CORDIC_FLOAT This was introduced in Linux commit 58d81d64e06f ("lib: cordic: Move cordic macros and defines to header file") and is used by the b43 and brcmsmac driver. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/cordic.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backport/backport-include/linux/cordic.h b/backport/backport-include/linux/cordic.h index 7f27b007..67d6a4ae 100644 --- a/backport/backport-include/linux/cordic.h +++ b/backport/backport-include/linux/cordic.h @@ -57,4 +57,16 @@ struct cordic_iq cordic_calc_iq(s32 theta); #endif /* __CORDIC_H_ */ #endif /* LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0)) */ + +#ifndef CORDIC_FLOAT +#define CORDIC_ANGLE_GEN 39797 +#define CORDIC_PRECISION_SHIFT 16 +#define CORDIC_NUM_ITER (CORDIC_PRECISION_SHIFT + 2) + +#define CORDIC_FIXED(X) ((s32)((X) << CORDIC_PRECISION_SHIFT)) +#define CORDIC_FLOAT(X) (((X) >= 0) \ + ? ((((X) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1) \ + : -((((-(X)) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1)) +#endif + #endif /* _BACKPORT_LINUX_CORDIC_H */ -- cgit v1.2.3