1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  */
6 
7 #ifndef __MATH_SUPPORT_H
8 #define __MATH_SUPPORT_H
9 
10 /* Override the definition of max/min from Linux kernel */
11 #include <linux/minmax.h>
12 
13 #define CEIL_DIV(a, b)       (((b) != 0) ? ((a) + (b) - 1) / (b) : 0)
14 #define CEIL_MUL(a, b)       (CEIL_DIV(a, b) * (b))
15 #define CEIL_SHIFT(a, b)     (((a) + (1 << (b)) - 1) >> (b))
16 
17 /*
18  * For SP and ISP, SDK provides the definition of OP_std_modadd.
19  * We need it only for host
20  */
21 #define OP_std_modadd(base, offset, size) ((base + offset) % (size))
22 
23 #endif /* __MATH_SUPPORT_H */
24