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 __PRINT_SUPPORT_H_INCLUDED__
8 #define __PRINT_SUPPORT_H_INCLUDED__
9 
10 #include <linux/stdarg.h>
11 
12 extern int (*sh_css_printf)(const char *fmt, va_list args);
13 /* depends on host supplied print function in ia_css_init() */
ia_css_print(const char * fmt,...)14 static inline  __printf(1, 2) void ia_css_print(const char *fmt, ...)
15 {
16 	va_list ap;
17 
18 	if (sh_css_printf) {
19 		va_start(ap, fmt);
20 		sh_css_printf(fmt, ap);
21 		va_end(ap);
22 	}
23 }
24 
25 /* Start adding support for bxt tracing functions for poc. From
26  * bxt_sandbox/support/print_support.h. */
27 /* TODO: support these macros in userspace. */
28 #define PWARN(format, ...) ia_css_print("warning: ", ##__VA_ARGS__)
29 #define PRINT(format, ...) ia_css_print(format, ##__VA_ARGS__)
30 #define PERROR(format, ...) ia_css_print("error: " format, ##__VA_ARGS__)
31 #define PDEBUG(format, ...) ia_css_print("debug: " format, ##__VA_ARGS__)
32 
33 #endif /* __PRINT_SUPPORT_H_INCLUDED__ */
34