mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
lib: cordic: Move cordic macros and defines to header file
Now that these macros are in header file, we can eventually clean up the duplicate macros present in the drivers that utilize the same cordic algorithm implementation. Also add CORDIC_ prefix to nonprefixed macros. Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Priit Laes <plaes@plaes.org> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
559afaa2c5
commit
58d81d64e0
2 changed files with 16 additions and 16 deletions
|
@ -18,6 +18,15 @@
|
|||
|
||||
#include <linux/types.h>
|
||||
|
||||
#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))
|
||||
|
||||
/**
|
||||
* struct cordic_iq - i/q coordinate.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue