Lines Matching refs:regs

36 static void kscan_default(struct mec_kscan_regs *regs)  in kscan_default()  argument
38 regs->KSI_INT_EN = 0; in kscan_default()
39 regs->KSO_SEL = MEC_KSCAN_KSO_SEL_DLFT; in kscan_default()
40 regs->EXT_CTRL = 0; in kscan_default()
41 regs->KSI_STS = 0xffu; in kscan_default()
53 int mec_hal_kscan_init(struct mec_kscan_regs *regs, uint32_t flags, uint8_t ksi_in_intr_mask) in mec_hal_kscan_init() argument
56 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_init()
65 kscan_default(regs); in mec_hal_kscan_init()
71 regs->EXT_CTRL |= MEC_BIT(MEC_KSCAN_EXT_CTRL_PREDRIVE_Pos); in mec_hal_kscan_init()
78 regs->KSO_SEL |= MEC_BIT(MEC_KSCAN_KSO_SEL_KSO_INVERT_Pos); in mec_hal_kscan_init()
81 regs->KSI_INT_EN = ksi_in_intr_mask; in mec_hal_kscan_init()
82 regs->KSI_STS = 0xffu; in mec_hal_kscan_init()
89 regs->KSO_SEL &= (uint8_t)~MEC_BIT(MEC_KSCAN_KSO_SEL_KSCAN_DIS_Pos); in mec_hal_kscan_init()
95 int mec_hal_kscan_enable(struct mec_kscan_regs *regs, uint8_t enable) in mec_hal_kscan_enable() argument
98 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_enable()
104 regs->KSO_SEL &= (uint8_t)~MEC_BIT(MEC_KSCAN_KSO_SEL_KSCAN_DIS_Pos); in mec_hal_kscan_enable()
106 regs->KSO_SEL |= MEC_BIT(MEC_KSCAN_KSO_SEL_KSCAN_DIS_Pos); in mec_hal_kscan_enable()
112 bool mec_hal_kscan_is_enabled(struct mec_kscan_regs *regs) in mec_hal_kscan_is_enabled() argument
115 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_is_enabled()
120 if (regs->KSO_SEL & MEC_BIT(MEC_KSCAN_KSO_SEL_KSCAN_DIS_Pos)) { in mec_hal_kscan_is_enabled()
127 int mec_hal_kscan_kso_pre_drive_enable(struct mec_kscan_regs *regs, uint8_t enable) in mec_hal_kscan_kso_pre_drive_enable() argument
130 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_kso_pre_drive_enable()
136 regs->EXT_CTRL |= MEC_BIT(MEC_KSCAN_EXT_CTRL_PREDRIVE_Pos); in mec_hal_kscan_kso_pre_drive_enable()
138 regs->EXT_CTRL &= (uint8_t)~MEC_BIT(MEC_KSCAN_EXT_CTRL_PREDRIVE_Pos); in mec_hal_kscan_kso_pre_drive_enable()
144 int mec_hal_kscan_girq_en(struct mec_kscan_regs *regs) in mec_hal_kscan_girq_en() argument
147 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_girq_en()
151 (void)regs; in mec_hal_kscan_girq_en()
159 int mec_hal_kscan_girq_dis(struct mec_kscan_regs *regs) in mec_hal_kscan_girq_dis() argument
162 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_girq_dis()
166 (void)regs; in mec_hal_kscan_girq_dis()
174 int mec_hal_kscan_girq_clr(struct mec_kscan_regs *regs) in mec_hal_kscan_girq_clr() argument
177 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_girq_clr()
181 (void)regs; in mec_hal_kscan_girq_clr()
189 uint32_t mec_hal_kscan_girq_result(struct mec_kscan_regs *regs) in mec_hal_kscan_girq_result() argument
192 if ((uintptr_t)regs != (uintptr_t)MEC_KSCAN0_BASE) { in mec_hal_kscan_girq_result()
196 (void)regs; in mec_hal_kscan_girq_result()