GNU Linux-libre 4.14.259-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / hive_isp_css_include / host / input_formatter_public.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #ifndef __INPUT_FORMATTER_PUBLIC_H_INCLUDED__
16 #define __INPUT_FORMATTER_PUBLIC_H_INCLUDED__
17
18 #include <type_support.h>
19 #include "system_types.h"
20
21 /*! Reset INPUT_FORMATTER[ID]
22  
23  \param ID[in]                          INPUT_FORMATTER identifier
24
25  \return none, reset(INPUT_FORMATTER[ID])
26  */
27 extern void input_formatter_rst(
28         const input_formatter_ID_t              ID);
29
30 /*! Set the blocking mode of INPUT_FORMATTER[ID]
31  
32  \param ID[in]                          INPUT_FORMATTER identifier
33  \param enable[in]                      blocking enable flag
34
35  \use
36         - In HW, the capture unit will deliver an infinite stream of frames,
37           the input formatter will synchronise on the first SOF. In simulation
38           there are only a fixed number of frames, presented only once. By
39           enabling blocking the inputformatter will wait on the first presented
40           frame, thus avoiding race in the simulation setup.
41
42  \return none, INPUT_FORMATTER[ID].blocking_mode = enable
43  */
44 extern void input_formatter_set_fifo_blocking_mode(
45         const input_formatter_ID_t              ID,
46         const bool                                              enable);
47
48 /*! Return the data alignment of INPUT_FORMATTER[ID]
49  
50  \param ID[in]                          INPUT_FORMATTER identifier
51
52  \return alignment(INPUT_FORMATTER[ID].data)
53  */
54 extern unsigned int input_formatter_get_alignment(
55         const input_formatter_ID_t              ID);
56
57 /*! Read the source switch state into INPUT_FORMATTER[ID]
58  
59  \param ID[in]                          INPUT_FORMATTER identifier
60  \param state[out]                      input formatter switch state structure
61
62  \return none, state = INPUT_FORMATTER[ID].switch_state
63  */
64 extern void input_formatter_get_switch_state(
65         const input_formatter_ID_t              ID,
66         input_formatter_switch_state_t  *state);
67
68 /*! Read the control registers of INPUT_FORMATTER[ID]
69  
70  \param ID[in]                          INPUT_FORMATTER identifier
71  \param state[out]                      input formatter state structure
72
73  \return none, state = INPUT_FORMATTER[ID].state
74  */
75 extern void input_formatter_get_state(
76         const input_formatter_ID_t              ID,
77         input_formatter_state_t                 *state);
78
79 /*! Read the control registers of bin copy INPUT_FORMATTER[ID]
80  
81  \param ID[in]                          INPUT_FORMATTER identifier
82  \param state[out]                      input formatter state structure
83
84  \return none, state = INPUT_FORMATTER[ID].state
85  */
86 extern void input_formatter_bin_get_state(
87         const input_formatter_ID_t              ID,
88         input_formatter_bin_state_t             *state);
89
90 /*! Write to a control register of INPUT_FORMATTER[ID]
91  
92  \param ID[in]                          INPUT_FORMATTER identifier
93  \param reg_addr[in]            register byte address
94  \param value[in]                       The data to be written
95
96  \return none, INPUT_FORMATTER[ID].ctrl[reg] = value
97  */
98 STORAGE_CLASS_INPUT_FORMATTER_H void input_formatter_reg_store(
99         const input_formatter_ID_t      ID,
100         const hrt_address               reg_addr,
101         const hrt_data                          value);
102
103 /*! Read from a control register of INPUT_FORMATTER[ID]
104  
105  \param ID[in]                          INPUT_FORMATTER identifier
106  \param reg_addr[in]            register byte address
107  \param value[in]                       The data to be written
108
109  \return INPUT_FORMATTER[ID].ctrl[reg]
110  */
111 STORAGE_CLASS_INPUT_FORMATTER_H hrt_data input_formatter_reg_load(
112         const input_formatter_ID_t      ID,
113         const unsigned int                      reg_addr);
114
115 #endif /* __INPUT_FORMATTER_PUBLIC_H_INCLUDED__ */