1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2010 - 2015, Intel Corporation.
5  */
6 
7 #ifndef __IA_CSS_ISYS_COMM_H
8 #define __IA_CSS_ISYS_COMM_H
9 
10 #include <type_support.h>
11 #include <input_system.h>
12 
13 #include <platform_support.h>		/* inline */
14 #include <input_system_global.h>
15 #include <ia_css_stream_public.h>	/* IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH */
16 
17 #define SH_CSS_NODES_PER_THREAD		2
18 #define SH_CSS_MAX_ISYS_CHANNEL_NODES	(SH_CSS_MAX_SP_THREADS * SH_CSS_NODES_PER_THREAD)
19 
20 /*
21  * a) ia_css_isys_stream_h & ia_css_isys_stream_cfg_t come from host.
22  *
23  * b) Here it is better  to use actual structures for stream handle
24  * instead of opaque handles. Otherwise, we need to have another
25  * communication channel to interpret that opaque handle(this handle is
26  * maintained by host and needs to be populated to sp for every stream open)
27  * */
28 typedef virtual_input_system_stream_t		*ia_css_isys_stream_h;
29 typedef virtual_input_system_stream_cfg_t	ia_css_isys_stream_cfg_t;
30 
31 /*
32  * error check for ISYS APIs.
33  * */
34 typedef bool ia_css_isys_error_t;
35 
ia_css_isys_generate_stream_id(u32 sp_thread_id,uint32_t stream_id)36 static inline uint32_t ia_css_isys_generate_stream_id(
37     u32	sp_thread_id,
38     uint32_t	stream_id)
39 {
40 	return sp_thread_id * IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH + stream_id;
41 }
42 
43 #endif  /*_IA_CSS_ISYS_COMM_H */
44