1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2016 Pengutronix
4  */
5 
6 #ifndef IMX_VDOA_H
7 #define IMX_VDOA_H
8 
9 struct vdoa_data;
10 struct vdoa_ctx;
11 
12 #if (defined CONFIG_VIDEO_IMX_VDOA || defined CONFIG_VIDEO_IMX_VDOA_MODULE)
13 
14 struct vdoa_ctx *vdoa_context_create(struct vdoa_data *vdoa);
15 int vdoa_context_configure(struct vdoa_ctx *ctx,
16 			   unsigned int width, unsigned int height,
17 			   u32 pixelformat);
18 void vdoa_context_destroy(struct vdoa_ctx *ctx);
19 
20 void vdoa_device_run(struct vdoa_ctx *ctx, dma_addr_t dst, dma_addr_t src);
21 int vdoa_wait_for_completion(struct vdoa_ctx *ctx);
22 
23 #else
24 
25 static inline struct vdoa_ctx *vdoa_context_create(struct vdoa_data *vdoa)
26 {
27 	return NULL;
28 }
29 
30 static inline int vdoa_context_configure(struct vdoa_ctx *ctx,
31 					 unsigned int width,
32 					 unsigned int height,
33 					 u32 pixelformat)
34 {
35 	return 0;
36 }
37 
38 static inline void vdoa_context_destroy(struct vdoa_ctx *ctx) { };
39 
40 static inline void vdoa_device_run(struct vdoa_ctx *ctx,
41 				   dma_addr_t dst, dma_addr_t src) { };
42 
43 static inline int vdoa_wait_for_completion(struct vdoa_ctx *ctx)
44 {
45 	return 0;
46 };
47 
48 #endif
49 
50 #endif /* IMX_VDOA_H */
51