1 /* SPDX-License-Identifier: GPL-2.0 */
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 
16 #ifndef __CSI_RX_PUBLIC_H_INCLUDED__
17 #define __CSI_RX_PUBLIC_H_INCLUDED__
18 
19 /*****************************************************
20  *
21  * Native command interface (NCI).
22  *
23  *****************************************************/
24 /**
25  * @brief Get the csi rx frontend state.
26  * Get the state of the csi rx frontend regiester-set.
27  *
28  * @param[in]	id	The global unique ID of the csi rx fe controller.
29  * @param[out]	state	Point to the register-state.
30  */
31 void csi_rx_fe_ctrl_get_state(
32     const csi_rx_frontend_ID_t ID,
33     csi_rx_fe_ctrl_state_t *state);
34 /**
35  * @brief Dump the csi rx frontend state.
36  * Dump the state of the csi rx frontend regiester-set.
37  *
38  * @param[in]	id	The global unique ID of the csi rx fe controller.
39  * @param[in]	state	Point to the register-state.
40  */
41 void csi_rx_fe_ctrl_dump_state(
42     const csi_rx_frontend_ID_t ID,
43     csi_rx_fe_ctrl_state_t *state);
44 /**
45  * @brief Get the state of the csi rx fe dlane.
46  * Get the state of the register set per dlane process.
47  *
48  * @param[in]	id			The global unique ID of the input-buffer controller.
49  * @param[in]	lane		The lane ID.
50  * @param[out]	state		Point to the dlane state.
51  */
52 void csi_rx_fe_ctrl_get_dlane_state(
53     const csi_rx_frontend_ID_t ID,
54     const u32 lane,
55     csi_rx_fe_ctrl_lane_t *dlane_state);
56 /**
57  * @brief Get the csi rx backend state.
58  * Get the state of the csi rx backend regiester-set.
59  *
60  * @param[in]	id	The global unique ID of the csi rx be controller.
61  * @param[out]	state	Point to the register-state.
62  */
63 void csi_rx_be_ctrl_get_state(
64     const csi_rx_backend_ID_t ID,
65     csi_rx_be_ctrl_state_t *state);
66 /**
67  * @brief Dump the csi rx backend state.
68  * Dump the state of the csi rx backend regiester-set.
69  *
70  * @param[in]	id	The global unique ID of the csi rx be controller.
71  * @param[in]	state	Point to the register-state.
72  */
73 void csi_rx_be_ctrl_dump_state(
74     const csi_rx_backend_ID_t ID,
75     csi_rx_be_ctrl_state_t *state);
76 /* end of NCI */
77 
78 /*****************************************************
79  *
80  * Device level interface (DLI).
81  *
82  *****************************************************/
83 /**
84  * @brief Load the register value.
85  * Load the value of the register of the csi rx fe.
86  *
87  * @param[in]	ID	The global unique ID for the ibuf-controller instance.
88  * @param[in]	reg	The offset address of the register.
89  *
90  * @return the value of the register.
91  */
92 hrt_data csi_rx_fe_ctrl_reg_load(
93     const csi_rx_frontend_ID_t ID,
94     const hrt_address reg);
95 /**
96  * @brief Store a value to the register.
97  * Store a value to the register of the csi rx fe.
98  *
99  * @param[in]	ID		The global unique ID for the ibuf-controller instance.
100  * @param[in]	reg		The offset address of the register.
101  * @param[in]	value	The value to be stored.
102  *
103  */
104 void csi_rx_fe_ctrl_reg_store(
105     const csi_rx_frontend_ID_t ID,
106     const hrt_address reg,
107     const hrt_data value);
108 /**
109  * @brief Load the register value.
110  * Load the value of the register of the csirx be.
111  *
112  * @param[in]	ID	The global unique ID for the ibuf-controller instance.
113  * @param[in]	reg	The offset address of the register.
114  *
115  * @return the value of the register.
116  */
117 hrt_data csi_rx_be_ctrl_reg_load(
118     const csi_rx_backend_ID_t ID,
119     const hrt_address reg);
120 /**
121  * @brief Store a value to the register.
122  * Store a value to the register of the csi rx be.
123  *
124  * @param[in]	ID		The global unique ID for the ibuf-controller instance.
125  * @param[in]	reg		The offset address of the register.
126  * @param[in]	value	The value to be stored.
127  *
128  */
129 void csi_rx_be_ctrl_reg_store(
130     const csi_rx_backend_ID_t ID,
131     const hrt_address reg,
132     const hrt_data value);
133 /* end of DLI */
134 #endif /* __CSI_RX_PUBLIC_H_INCLUDED__ */
135