Lines Matching refs:ctx

25 int mec_hal_htimer_init(struct mec_htmr_regs *regs, struct mec_htimer_context *ctx,  in mec_hal_htimer_init()  argument
31 if (!ctx) { in mec_hal_htimer_init()
37 ctx->regs = regs; in mec_hal_htimer_init()
38 ctx->devi = MEC_HTMR0_ECIA_INFO; in mec_hal_htimer_init()
42 ctx->regs = regs; in mec_hal_htimer_init()
43 ctx->devi = MEC_HTMR1_ECIA_INFO; in mec_hal_htimer_init()
55 mec_hal_girq_ctrl(ctx->devi, 0); in mec_hal_htimer_init()
65 mec_hal_girq_clr_src(ctx->devi); in mec_hal_htimer_init()
66 mec_hal_girq_ctrl(ctx->devi, irq_en); in mec_hal_htimer_init()
71 ctx->count = ctx->preload; in mec_hal_htimer_init()
72 regs->PRELOAD = ctx->preload; in mec_hal_htimer_init()
77 void mec_hal_htimer_intr_ctrl(struct mec_htimer_context *ctx, uint8_t enable) in mec_hal_htimer_intr_ctrl() argument
79 mec_hal_girq_ctrl(ctx->devi, (int)enable); in mec_hal_htimer_intr_ctrl()
82 uint32_t mec_hal_htimer_status(struct mec_htimer_context *ctx) in mec_hal_htimer_status() argument
84 if (mec_hal_girq_src(ctx->devi)) { in mec_hal_htimer_status()
91 void mec_hal_htimer_status_clear(struct mec_htimer_context *ctx) in mec_hal_htimer_status_clear() argument
93 mec_hal_girq_clr_src(ctx->devi); in mec_hal_htimer_status_clear()
107 void mec_hal_htimer_halt(struct mec_htimer_context *ctx) in mec_hal_htimer_halt() argument
109 struct mec_htmr_regs *regs = ctx->regs; in mec_hal_htimer_halt()
111 ctx->count = (uint16_t)(regs->COUNT & 0xffffu); in mec_hal_htimer_halt()
118 void mec_hal_htimer_unhalt(struct mec_htimer_context *ctx) in mec_hal_htimer_unhalt() argument
120 struct mec_htmr_regs *regs = ctx->regs; in mec_hal_htimer_unhalt()
122 regs->PRELOAD = ctx->count; in mec_hal_htimer_unhalt()
126 void mec_hal_htimer_restart(struct mec_htimer_context *ctx, uint16_t new_count) in mec_hal_htimer_restart() argument
128 struct mec_htmr_regs *regs = ctx->regs; in mec_hal_htimer_restart()