Lines Matching refs:base

69 int mec_hal_kbc_init(struct mec_kbc_regs *base, uint32_t flags)  in mec_hal_kbc_init()  argument
73 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_init()
81 base->ACTV &= (uint8_t)~MEC_BIT(MEC_KBC_ACTV_ENABLE_Pos); in mec_hal_kbc_init()
84 mec_hal_kbc_girq_dis(base, MEC_KBC_IBF_IRQ | MEC_KBC_OBE_IRQ); in mec_hal_kbc_init()
85 mec_hal_kbc_girq_clr(base, MEC_KBC_IBF_IRQ | MEC_KBC_OBE_IRQ); in mec_hal_kbc_init()
151 base->KESTATUS = (base->KESTATUS & ~msk) | val; in mec_hal_kbc_init()
154 base->KECR = ctrl; in mec_hal_kbc_init()
155 base->ACTV |= MEC_BIT(MEC_KBC_ACTV_ENABLE_Pos); in mec_hal_kbc_init()
156 mec_hal_kbc_girq_en(base, flags); in mec_hal_kbc_init()
161 int mec_hal_kbc_activate(struct mec_kbc_regs *base, uint8_t enable, uint8_t flags) in mec_hal_kbc_activate() argument
164 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_activate()
175 base->ACTV |= MEC_BIT(MEC_KBC_ACTV_ENABLE_Pos); in mec_hal_kbc_activate()
177 base->ACTV &= (uint8_t)~MEC_BIT(MEC_KBC_ACTV_ENABLE_Pos); in mec_hal_kbc_activate()
199 int mec_hal_kbc_girq_en(struct mec_kbc_regs *base, uint32_t flags) in mec_hal_kbc_girq_en() argument
202 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_girq_en()
206 (void)base; in mec_hal_kbc_girq_en()
216 int mec_hal_kbc_girq_dis(struct mec_kbc_regs *base, uint32_t flags) in mec_hal_kbc_girq_dis() argument
219 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_girq_dis()
223 (void)base; in mec_hal_kbc_girq_dis()
233 int mec_hal_kbc_girq_clr(struct mec_kbc_regs *base, uint32_t flags) in mec_hal_kbc_girq_clr() argument
236 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_girq_clr()
240 (void)base; in mec_hal_kbc_girq_clr()
250 uint32_t mec_kbc_girq_result(struct mec_kbc_regs *base) in mec_kbc_girq_result() argument
255 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_kbc_girq_result()
259 (void)base; in mec_kbc_girq_result()
273 int mec_hal_kbc_is_enabled(struct mec_kbc_regs *base) in mec_hal_kbc_is_enabled() argument
276 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_is_enabled()
281 if (base->ACTV & MEC_BIT(MEC_KBC_ACTV_ENABLE_Pos)) { in mec_hal_kbc_is_enabled()
288 int mec_hal_kbc_is_irq_gen_enabled(struct mec_kbc_regs *base) in mec_hal_kbc_is_irq_gen_enabled() argument
291 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_is_irq_gen_enabled()
296 if (base->KECR & MEC_BIT(MEC_KBC_KECR_OBFEN_Pos)) { in mec_hal_kbc_is_irq_gen_enabled()
303 uint8_t mec_hal_kbc_status(struct mec_kbc_regs *base) in mec_hal_kbc_status() argument
306 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_status()
311 return base->KESTATUS; in mec_hal_kbc_status()
314 void mec_hal_kbc_status_wr(struct mec_kbc_regs *base, uint8_t val, uint8_t msk) in mec_hal_kbc_status_wr() argument
317 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_status_wr()
322 base->KESTATUS = (base->KESTATUS & ~msk) | (val & msk); in mec_hal_kbc_status_wr()
325 void mec_hal_kbc_status_set(struct mec_kbc_regs *base, uint8_t msk) in mec_hal_kbc_status_set() argument
328 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_status_set()
333 base->KESTATUS |= msk; in mec_hal_kbc_status_set()
336 void mec_hal_kbc_status_clear(struct mec_kbc_regs *base, uint8_t msk) in mec_hal_kbc_status_clear() argument
339 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_status_clear()
344 base->KESTATUS &= (uint8_t)~msk; in mec_hal_kbc_status_clear()
347 void mec_hal_kbc_wr_data(struct mec_kbc_regs *base, uint8_t data, uint8_t data_is_aux) in mec_hal_kbc_wr_data() argument
350 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_wr_data()
356 base->KEAUXD = data; in mec_hal_kbc_wr_data()
358 base->KHECD = data; in mec_hal_kbc_wr_data()
362 uint8_t mec_hal_kbc_rd_host_data(struct mec_kbc_regs *base, uint8_t is_host_data_reg) in mec_hal_kbc_rd_host_data() argument
365 if ((uintptr_t)base != (uintptr_t)MEC_KBC0_BASE) { in mec_hal_kbc_rd_host_data()
371 return base->KHECD; in mec_hal_kbc_rd_host_data()
373 return base->KHDATA; in mec_hal_kbc_rd_host_data()