Lines Matching +full:girq +full:- +full:bit
4 * SPDX-License-Identifier: Apache-2.0
33 uint8_t girq; member
49 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_clear_girq_status()
52 mchp_xec_ecia_girq_src_clr(cfg->girq, cfg->girq_pos); in xec_kbd_clear_girq_status()
54 MCHP_GIRQ_SRC(cfg->girq) = BIT(cfg->girq_pos); in xec_kbd_clear_girq_status()
60 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_configure_girq()
63 mchp_xec_ecia_enable(cfg->girq, cfg->girq_pos); in xec_kbd_configure_girq()
65 MCHP_GIRQ_ENSET(cfg->girq) = BIT(cfg->girq_pos); in xec_kbd_configure_girq()
72 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_clr_slp_en()
74 z_mchp_xec_pcr_periph_sleep(cfg->pcr_idx, cfg->pcr_pos, 0); in xec_kbd_clr_slp_en()
83 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_drive_column()
84 struct kscan_regs *regs = cfg->regs; in xec_kbd_drive_column()
88 regs->KSO_SEL = MCHP_KSCAN_KSO_ALL; in xec_kbd_drive_column()
91 regs->KSO_SEL = MCHP_KSCAN_KSO_EN; in xec_kbd_drive_column()
94 regs->KSO_SEL = data; in xec_kbd_drive_column()
100 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_read_row()
101 struct kscan_regs *regs = cfg->regs; in xec_kbd_read_row()
104 return ~(regs->KSI_IN & 0xff); in xec_kbd_read_row()
117 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_set_detect_mode()
118 struct xec_kbd_data *data = dev->data; in xec_kbd_set_detect_mode()
119 struct kscan_regs *regs = cfg->regs; in xec_kbd_set_detect_mode()
122 if (data->pm_lock_taken) { in xec_kbd_set_detect_mode()
127 regs->KSI_STS = MCHP_KSCAN_KSO_SEL_REG_MASK; in xec_kbd_set_detect_mode()
135 data->pm_lock_taken = true; in xec_kbd_set_detect_mode()
142 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_pm_action()
143 struct kscan_regs *regs = cfg->regs; in xec_kbd_pm_action()
151 if (cfg->wakeup_source) { in xec_kbd_pm_action()
157 ret = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_DEFAULT); in xec_kbd_pm_action()
163 regs->KSO_SEL &= ~BIT(MCHP_KSCAN_KSO_EN_POS); in xec_kbd_pm_action()
165 regs->KSI_STS = MCHP_KSCAN_KSO_SEL_REG_MASK; in xec_kbd_pm_action()
166 regs->KSI_IEN = MCHP_KSCAN_KSI_IEN_REG_MASK; in xec_kbd_pm_action()
170 regs->KSO_SEL |= BIT(MCHP_KSCAN_KSO_EN_POS); in xec_kbd_pm_action()
171 regs->KSI_IEN = (~MCHP_KSCAN_KSI_IEN_REG_MASK); in xec_kbd_pm_action()
172 ret = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP); in xec_kbd_pm_action()
173 if (ret != -ENOENT) { in xec_kbd_pm_action()
174 /* pinctrl-1 does not exist */ in xec_kbd_pm_action()
180 return -ENOTSUP; in xec_kbd_pm_action()
189 struct xec_kbd_config const *cfg = dev->config; in xec_kbd_init()
190 struct kscan_regs *regs = cfg->regs; in xec_kbd_init()
193 ret = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_DEFAULT); in xec_kbd_init()
202 regs->KSO_SEL |= BIT(MCHP_KSCAN_KSO_EN_POS); in xec_kbd_init()
203 regs->EXT_CTRL = MCHP_KSCAN_EXT_CTRL_PREDRV_EN; in xec_kbd_init()
204 regs->KSO_SEL &= ~BIT(MCHP_KSCAN_KSO_EN_POS); in xec_kbd_init()
205 regs->KSI_IEN = MCHP_KSCAN_KSI_IEN_REG_MASK; in xec_kbd_init()
229 /* To enable wakeup, set the "wakeup-source" on the keyboard scanning device
235 .girq = DT_INST_PROP_BY_IDX(0, girqs, 0),
252 "only one microchip,xec-kbd compatible node can be supported");
253 BUILD_ASSERT(IN_RANGE(DT_INST_PROP(0, row_size), 1, 8), "invalid row-size");
254 BUILD_ASSERT(IN_RANGE(DT_INST_PROP(0, col_size), 1, 18), "invalid col-size");