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