[PATCH 4/7] backports: Add CORDIC_FLOAT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <hauke@xxxxxxxxxx>
---
 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 */
-- 
2.20.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux