3 #ifndef SOC_MEDIATEK_PMIC_WRAP_COMMON_H
4 #define SOC_MEDIATEK_PMIC_WRAP_COMMON_H
8 #define PWRAPTAG "[PWRAP] "
9 #define pwrap_err(fmt, arg ...) printk(BIOS_ERR, PWRAPTAG "ERROR,line=%d" fmt, \
30 rdata &= (
mask << shift);
31 rdata = (rdata >> shift);
41 new = old & ~(
mask << shift);
42 new |= (
val << shift);
static s32 pwrap_write_nochk(u16 addr, u16 wdata)
static u32 wait_for_sync(u32 x)
s32 pwrap_reset_spislv(void)
u32(* loop_condition_fp)(u32)
static u32 wait_for_idle_and_sync(u32 x)
@ RDATA_SYS_IDLE_V2_SHIFT
@ RDATA_INIT_DONE_V2_SHIFT
@ DEFAULT_VALUE_READ_TEST
u32 wait_for_state_ready(loop_condition_fp fp, u32 timeout_us, void *wacs_register, u32 *read_reg)
static s32 pwrap_read_nochk(u16 addr, u16 *rdata)
u32 wait_for_state_idle(u32 timeout_us, void *wacs_register, void *wacs_vldclr_register, u32 *read_reg)
@ RDATA_INIT_DONE_V1_SHIFT
@ RDATA_SYS_IDLE_V1_SHIFT
s32 pwrap_wacs2(u32 write, u16 adr, u16 wdata, u16 *rdata, u32 init_check)
static s32 pwrap_read(u16 addr, u16 *rdata)
static u32 wait_for_cipher_ready(u32 x)
static u32 wait_for_fsm_vldclr(u32 x)
@ E_PWR_WAIT_IDLE_TIMEOUT_READ
@ E_PWR_INVALID_OP_MANUAL
@ E_PWR_WAIT_IDLE_TIMEOUT
@ E_PWR_NOT_INIT_DONE_READ
@ E_PWR_INIT_ENABLE_EVENT
@ E_PWR_INIT_ENABLE_DEWRAP
static u16 pwrap_read_field(u16 reg, u16 mask, u16 shift)
static s32 pwrap_write(u16 addr, u16 wdata)
static void pwrap_write_field(u16 reg, u16 val, u16 mask, u16 shift)
static void read_reg(const void *src, void *value, uint32_t size)