GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / runtime / isys / interface / ia_css_isys_comm.h
1 #ifndef ISP2401
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 #else
16 /**
17 Support for Intel Camera Imaging ISP subsystem.
18 Copyright (c) 2010 - 2015, Intel Corporation.
19
20 This program is free software; you can redistribute it and/or modify it
21 under the terms and conditions of the GNU General Public License,
22 version 2, as published by the Free Software Foundation.
23
24 This program is distributed in the hope it will be useful, but WITHOUT
25 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
26 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
27 more details.
28 */
29 #endif
30
31 #ifndef __IA_CSS_ISYS_COMM_H
32 #define __IA_CSS_ISYS_COMM_H
33
34 #include <type_support.h>
35 #include <input_system.h>
36
37 #ifdef USE_INPUT_SYSTEM_VERSION_2401
38 #include <platform_support.h>           /* inline */
39 #include <input_system_global.h>
40 #include <ia_css_stream_public.h>       /* IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH */
41
42 #define SH_CSS_NODES_PER_THREAD         2
43 #define SH_CSS_MAX_ISYS_CHANNEL_NODES   (SH_CSS_MAX_SP_THREADS * SH_CSS_NODES_PER_THREAD)
44
45 /*
46  * a) ia_css_isys_stream_h & ia_css_isys_stream_cfg_t come from host.
47  *
48  * b) Here it is better  to use actual structures for stream handle
49  * instead of opaque handles. Otherwise, we need to have another
50  * communication channel to interpret that opaque handle(this handle is
51  * maintained by host and needs to be populated to sp for every stream open)
52  * */
53 typedef virtual_input_system_stream_t           *ia_css_isys_stream_h;
54 typedef virtual_input_system_stream_cfg_t       ia_css_isys_stream_cfg_t;
55
56 /*
57  * error check for ISYS APIs.
58  * */
59 typedef bool ia_css_isys_error_t;
60
61 static inline uint32_t ia_css_isys_generate_stream_id(
62         uint32_t        sp_thread_id,
63         uint32_t        stream_id)
64 {
65         return sp_thread_id * IA_CSS_STREAM_MAX_ISYS_STREAM_PER_CH + stream_id;
66 }
67
68 #endif  /* USE_INPUT_SYSTEM_VERSION_2401*/
69 #endif  /*_IA_CSS_ISYS_COMM_H */