4 #include <soc/pmic_wrap.h>
16 reg_rdata =
read32((wacs_register));
23 write32(wacs_vldclr_register, 1);
24 pwrap_err(
"WACS_FSM = PMIC_WRAP_WACS_VLDCLR\n");
54 reg_rdata =
read32((wacs_register));
57 pwrap_err(
"timeout when waiting for idle\n");
60 }
while (fp(reg_rdata));
111 if (
CONFIG(SOC_MEDIATEK_MT8186))
117 pwrap_err(
"Pwrap initialization isn't finished\n");
127 if (wait_result != 0) {
128 pwrap_err(
"wait_for_fsm_idle fail,wait_result=%d\n",
132 wacs_write = write << 31;
133 wacs_addr = (
addr >> 1) << 16;
134 wacs_cmd = wacs_write | wacs_addr | wdata;
146 if (wait_result != 0) {
147 pwrap_err(
"wait_for_fsm_vldclr fail,wait_result=%d\n",
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
s32 pwrap_reset_spislv(void)
u32 wait_for_state_ready(loop_condition_fp fp, u32 timeout_us, void *wacs_register, u32 *read_reg)
u32 wait_for_state_idle(u32 timeout_us, void *wacs_register, void *wacs_vldclr_register, u32 *read_reg)
s32 pwrap_wacs2(u32 write, u16 addr, u16 wdata, u16 *rdata, u32 init_check)
static int stopwatch_expired(struct stopwatch *sw)
static void stopwatch_init_usecs_expire(struct stopwatch *sw, long us)
static struct mt8173_pwrap_regs *const mtk_pwrap
static u32 wait_for_sync(u32 x)
#define pwrap_err(fmt, arg ...)
u32(* loop_condition_fp)(u32)
@ RDATA_INIT_DONE_V2_SHIFT
@ RDATA_INIT_DONE_V1_SHIFT
static u32 wait_for_fsm_vldclr(u32 x)
@ E_PWR_WAIT_IDLE_TIMEOUT_READ
@ E_PWR_WAIT_IDLE_TIMEOUT
static void read_reg(const void *src, void *value, uint32_t size)