summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-04-30 13:30:07 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-20 13:32:19 +0300
commitfe4586ca23ae68e307b75a8d7d7ee248e1a59949 (patch)
tree59d877dcb0c443f49ad20b07ffd1285fc3f315b8
parent8d4af3102d648df0d3d8e9ee8a36f7137b2e9a1c (diff)
downloadlinux-fe4586ca23ae68e307b75a8d7d7ee248e1a59949.tar.xz
media: atomisp: change function worders and fix include
With the current way, it will produce lots of errors because the public header contains wrong definitions and the private one has functions defined at the wrong order. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/staging/media/atomisp/pci/css_2401_csi2p_system/host/csi_rx_private.h165
1 files changed, 83 insertions, 82 deletions
diff --git a/drivers/staging/media/atomisp/pci/css_2401_csi2p_system/host/csi_rx_private.h b/drivers/staging/media/atomisp/pci/css_2401_csi2p_system/host/csi_rx_private.h
index 940e79c7e337..3fa3c3a487ab 100644
--- a/drivers/staging/media/atomisp/pci/css_2401_csi2p_system/host/csi_rx_private.h
+++ b/drivers/staging/media/atomisp/pci/css_2401_csi2p_system/host/csi_rx_private.h
@@ -17,7 +17,7 @@
#include "rx_csi_defs.h"
#include "mipi_backend_defs.h"
-#include "csi_rx_public.h"
+#include "csi_rx.h"
#include "device_access.h" /* ia_css_device_load_uint32 */
@@ -26,10 +26,92 @@
/*****************************************************
*
+ * Device level interface (DLI).
+ *
+ *****************************************************/
+/**
+ * @brief Load the register value.
+ * Refer to "csi_rx_public.h" for details.
+ */
+static inline hrt_data csi_rx_fe_ctrl_reg_load(
+ const csi_rx_frontend_ID_t ID,
+ const hrt_address reg)
+{
+ assert(ID < N_CSI_RX_FRONTEND_ID);
+ assert(CSI_RX_FE_CTRL_BASE[ID] != (hrt_address)-1);
+ return ia_css_device_load_uint32(CSI_RX_FE_CTRL_BASE[ID] + reg * sizeof(
+ hrt_data));
+}
+
+/**
+ * @brief Store a value to the register.
+ * Refer to "ibuf_ctrl_public.h" for details.
+ */
+static inline void csi_rx_fe_ctrl_reg_store(
+ const csi_rx_frontend_ID_t ID,
+ const hrt_address reg,
+ const hrt_data value)
+{
+ assert(ID < N_CSI_RX_FRONTEND_ID);
+ assert(CSI_RX_FE_CTRL_BASE[ID] != (hrt_address)-1);
+
+ ia_css_device_store_uint32(CSI_RX_FE_CTRL_BASE[ID] + reg * sizeof(hrt_data),
+ value);
+}
+
+/**
+ * @brief Load the register value.
+ * Refer to "csi_rx_public.h" for details.
+ */
+static inline hrt_data csi_rx_be_ctrl_reg_load(
+ const csi_rx_backend_ID_t ID,
+ const hrt_address reg)
+{
+ assert(ID < N_CSI_RX_BACKEND_ID);
+ assert(CSI_RX_BE_CTRL_BASE[ID] != (hrt_address)-1);
+ return ia_css_device_load_uint32(CSI_RX_BE_CTRL_BASE[ID] + reg * sizeof(
+ hrt_data));
+}
+
+/**
+ * @brief Store a value to the register.
+ * Refer to "ibuf_ctrl_public.h" for details.
+ */
+static inline void csi_rx_be_ctrl_reg_store(
+ const csi_rx_backend_ID_t ID,
+ const hrt_address reg,
+ const hrt_data value)
+{
+ assert(ID < N_CSI_RX_BACKEND_ID);
+ assert(CSI_RX_BE_CTRL_BASE[ID] != (hrt_address)-1);
+
+ ia_css_device_store_uint32(CSI_RX_BE_CTRL_BASE[ID] + reg * sizeof(hrt_data),
+ value);
+}
+
+/* end of DLI */
+
+/*****************************************************
+ *
* Native command interface (NCI).
*
*****************************************************/
/**
+ * @brief Get the state of the csi rx fe dlane process.
+ * Refer to "csi_rx_public.h" for details.
+ */
+static inline void csi_rx_fe_ctrl_get_dlane_state(
+ const csi_rx_frontend_ID_t ID,
+ const u32 lane,
+ csi_rx_fe_ctrl_lane_t *dlane_state)
+{
+ dlane_state->termen =
+ csi_rx_fe_ctrl_reg_load(ID, _HRT_CSI_RX_DLY_CNT_TERMEN_DLANE_REG_IDX(lane));
+ dlane_state->settle =
+ csi_rx_fe_ctrl_reg_load(ID, _HRT_CSI_RX_DLY_CNT_SETTLE_DLANE_REG_IDX(lane));
+}
+
+/**
* @brief Get the csi rx fe state.
* Refer to "csi_rx_public.h" for details.
*/
@@ -69,21 +151,6 @@ static inline void csi_rx_fe_ctrl_get_state(
}
/**
- * @brief Get the state of the csi rx fe dlane process.
- * Refer to "csi_rx_public.h" for details.
- */
-static inline void csi_rx_fe_ctrl_get_dlane_state(
- const csi_rx_frontend_ID_t ID,
- const u32 lane,
- csi_rx_fe_ctrl_lane_t *dlane_state)
-{
- dlane_state->termen =
- csi_rx_fe_ctrl_reg_load(ID, _HRT_CSI_RX_DLY_CNT_TERMEN_DLANE_REG_IDX(lane));
- dlane_state->settle =
- csi_rx_fe_ctrl_reg_load(ID, _HRT_CSI_RX_DLY_CNT_SETTLE_DLANE_REG_IDX(lane));
-}
-
-/**
* @brief dump the csi rx fe state.
* Refer to "csi_rx_public.h" for details.
*/
@@ -234,71 +301,5 @@ static inline void csi_rx_be_ctrl_dump_state(
}
/* end of NCI */
-/*****************************************************
- *
- * Device level interface (DLI).
- *
- *****************************************************/
-/**
- * @brief Load the register value.
- * Refer to "csi_rx_public.h" for details.
- */
-static inline hrt_data csi_rx_fe_ctrl_reg_load(
- const csi_rx_frontend_ID_t ID,
- const hrt_address reg)
-{
- assert(ID < N_CSI_RX_FRONTEND_ID);
- assert(CSI_RX_FE_CTRL_BASE[ID] != (hrt_address)-1);
- return ia_css_device_load_uint32(CSI_RX_FE_CTRL_BASE[ID] + reg * sizeof(
- hrt_data));
-}
-
-/**
- * @brief Store a value to the register.
- * Refer to "ibuf_ctrl_public.h" for details.
- */
-static inline void csi_rx_fe_ctrl_reg_store(
- const csi_rx_frontend_ID_t ID,
- const hrt_address reg,
- const hrt_data value)
-{
- assert(ID < N_CSI_RX_FRONTEND_ID);
- assert(CSI_RX_FE_CTRL_BASE[ID] != (hrt_address)-1);
-
- ia_css_device_store_uint32(CSI_RX_FE_CTRL_BASE[ID] + reg * sizeof(hrt_data),
- value);
-}
-
-/**
- * @brief Load the register value.
- * Refer to "csi_rx_public.h" for details.
- */
-static inline hrt_data csi_rx_be_ctrl_reg_load(
- const csi_rx_backend_ID_t ID,
- const hrt_address reg)
-{
- assert(ID < N_CSI_RX_BACKEND_ID);
- assert(CSI_RX_BE_CTRL_BASE[ID] != (hrt_address)-1);
- return ia_css_device_load_uint32(CSI_RX_BE_CTRL_BASE[ID] + reg * sizeof(
- hrt_data));
-}
-
-/**
- * @brief Store a value to the register.
- * Refer to "ibuf_ctrl_public.h" for details.
- */
-static inline void csi_rx_be_ctrl_reg_store(
- const csi_rx_backend_ID_t ID,
- const hrt_address reg,
- const hrt_data value)
-{
- assert(ID < N_CSI_RX_BACKEND_ID);
- assert(CSI_RX_BE_CTRL_BASE[ID] != (hrt_address)-1);
-
- ia_css_device_store_uint32(CSI_RX_BE_CTRL_BASE[ID] + reg * sizeof(hrt_data),
- value);
-}
-
-/* end of DLI */
#endif /* __CSI_RX_PRIVATE_H_INCLUDED__ */