aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging/media/atomisp/pci/hive_isp_css_include/host/input_formatter_public.h
blob: e5758cb8beddbc5b1e30e0b3cdf32537f132a2ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

#ifndef __INPUT_FORMATTER_PUBLIC_H_INCLUDED__
#define __INPUT_FORMATTER_PUBLIC_H_INCLUDED__

#include <type_support.h>
#include "system_types.h"

/*! Reset INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier

 \return none, reset(INPUT_FORMATTER[ID])
 */
void input_formatter_rst(
    const input_formatter_ID_t		ID);

/*! Set the blocking mode of INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier
 \param	enable[in]			blocking enable flag

 \use
	- In HW, the capture unit will deliver an infinite stream of frames,
	  the input formatter will synchronise on the first SOF. In simulation
	  there are only a fixed number of frames, presented only once. By
	  enabling blocking the inputformatter will wait on the first presented
	  frame, thus avoiding race in the simulation setup.

 \return none, INPUT_FORMATTER[ID].blocking_mode = enable
 */
void input_formatter_set_fifo_blocking_mode(
    const input_formatter_ID_t		ID,
    const bool						enable);

/*! Return the data alignment of INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier

 \return alignment(INPUT_FORMATTER[ID].data)
 */
unsigned int input_formatter_get_alignment(
    const input_formatter_ID_t		ID);

/*! Read the source switch state into INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier
 \param	state[out]			input formatter switch state structure

 \return none, state = INPUT_FORMATTER[ID].switch_state
 */
void input_formatter_get_switch_state(
    const input_formatter_ID_t		ID,
    input_formatter_switch_state_t	*state);

/*! Read the control registers of INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier
 \param	state[out]			input formatter state structure

 \return none, state = INPUT_FORMATTER[ID].state
 */
void input_formatter_get_state(
    const input_formatter_ID_t		ID,
    input_formatter_state_t			*state);

/*! Read the control registers of bin copy INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier
 \param	state[out]			input formatter state structure

 \return none, state = INPUT_FORMATTER[ID].state
 */
void input_formatter_bin_get_state(
    const input_formatter_ID_t		ID,
    input_formatter_bin_state_t		*state);

/*! Write to a control register of INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier
 \param	reg_addr[in]		register byte address
 \param value[in]			The data to be written

 \return none, INPUT_FORMATTER[ID].ctrl[reg] = value
 */
STORAGE_CLASS_INPUT_FORMATTER_H void input_formatter_reg_store(
    const input_formatter_ID_t	ID,
    const hrt_address		reg_addr,
    const hrt_data				value);

/*! Read from a control register of INPUT_FORMATTER[ID]

 \param	ID[in]				INPUT_FORMATTER identifier
 \param	reg_addr[in]		register byte address
 \param value[in]			The data to be written

 \return INPUT_FORMATTER[ID].ctrl[reg]
 */
STORAGE_CLASS_INPUT_FORMATTER_H hrt_data input_formatter_reg_load(
    const input_formatter_ID_t	ID,
    const unsigned int			reg_addr);

#endif /* __INPUT_FORMATTER_PUBLIC_H_INCLUDED__ */