Commit fe4586ca authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8d4af310
...@@ -17,18 +17,100 @@ ...@@ -17,18 +17,100 @@
#include "rx_csi_defs.h" #include "rx_csi_defs.h"
#include "mipi_backend_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 */ #include "device_access.h" /* ia_css_device_load_uint32 */
#include "assert_support.h" /* assert */ #include "assert_support.h" /* assert */
#include "print_support.h" /* print */ #include "print_support.h" /* print */
/*****************************************************
*
* 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). * 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. * @brief Get the csi rx fe state.
* Refer to "csi_rx_public.h" for details. * Refer to "csi_rx_public.h" for details.
...@@ -68,21 +150,6 @@ static inline void csi_rx_fe_ctrl_get_state( ...@@ -68,21 +150,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. * @brief dump the csi rx fe state.
* Refer to "csi_rx_public.h" for details. * Refer to "csi_rx_public.h" for details.
...@@ -234,71 +301,5 @@ static inline void csi_rx_be_ctrl_dump_state( ...@@ -234,71 +301,5 @@ static inline void csi_rx_be_ctrl_dump_state(
} }
/* end of NCI */ /* 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__ */ #endif /* __CSI_RX_PRIVATE_H_INCLUDED__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment