Lines Matching +full:keyboard +full:- +full:controller

4  * SPDX-License-Identifier: Apache-2.0
29 /* IT8801 controller dev */
37 /* Keyboard scan out mode control register */
39 /* Keyboard scan in data register */
41 /* Keyboard scan in edge event register */
43 /* Keyboard scan in interrupt enable register */
56 const struct kbd_it8801_config *config = dev->config; in kbd_it8801_drive_column()
61 /* Tri-state all outputs. KSO[22:11, 6:0] output high */ in kbd_it8801_drive_column()
68 kso_val = config->kso_mapping[col]; in kbd_it8801_drive_column()
71 ret = i2c_reg_write_byte_dt(&config->i2c_dev, config->reg_ksomcr, kso_val); in kbd_it8801_drive_column()
80 const struct kbd_it8801_config *const config = dev->config; in kbd_it8801_read_row()
84 ret = i2c_reg_read_byte_dt(&config->i2c_dev, config->reg_ksidr, &value); in kbd_it8801_read_row()
89 /* Bits are active-low, so invert returned levels */ in kbd_it8801_read_row()
95 const struct kbd_it8801_config *const config = dev->config; in it8801_input_alert_handler()
99 ret = i2c_reg_read_byte_dt(&config->i2c_dev, config->reg_ksieer, &ksieer_val); in it8801_input_alert_handler()
106 ret = i2c_reg_write_byte_dt(&config->i2c_dev, config->reg_ksieer, GENMASK(7, 0)); in it8801_input_alert_handler()
117 const struct kbd_it8801_config *const config = dev->config; in kbd_it8801_set_detect_mode()
122 ret = i2c_reg_write_byte_dt(&config->i2c_dev, config->reg_ksieer, GENMASK(7, 0)); in kbd_it8801_set_detect_mode()
128 ret = i2c_reg_write_byte_dt(&config->i2c_dev, config->reg_ksiier, GENMASK(7, 0)); in kbd_it8801_set_detect_mode()
135 ret = i2c_reg_write_byte_dt(&config->i2c_dev, config->reg_ksiier, 0x00); in kbd_it8801_set_detect_mode()
145 const struct kbd_it8801_config *const config = dev->config; in kbd_it8801_init()
146 struct kbd_it8801_data *data = dev->data; in kbd_it8801_init()
149 /* Verify multi-function parent is ready */ in kbd_it8801_init()
150 if (!device_is_ready(config->mfd)) { in kbd_it8801_init()
151 LOG_ERR("(input)%s is not ready", config->mfd->name); in kbd_it8801_init()
152 return -ENODEV; in kbd_it8801_init()
155 for (int i = 0; i < config->mfdctrl_len; i++) { in kbd_it8801_init()
157 status = mfd_it8801_configure_pins(&config->i2c_dev, config->altctrl[i].gpiocr, in kbd_it8801_init()
158 config->altctrl[i].pin, in kbd_it8801_init()
159 config->altctrl[i].alt_func); in kbd_it8801_init()
170 ret = i2c_reg_write_byte_dt(&config->i2c_dev, config->reg_ksomcr, IT8801_REG_MASK_AKSOSC); in kbd_it8801_init()
176 ret = i2c_reg_write_byte_dt(&config->i2c_dev, IT8801_REG_GIECR, IT8801_REG_MASK_GKSIIE); in kbd_it8801_init()
182 ret = i2c_reg_write_byte_dt(&config->i2c_dev, IT8801_REG_SMBCR, IT8801_REG_MASK_ARE); in kbd_it8801_init()
189 data->it8801_kbd_callback.cb = it8801_input_alert_handler; in kbd_it8801_init()
190 data->it8801_kbd_callback.dev = dev; in kbd_it8801_init()
191 mfd_it8801_register_interrupt_callback(config->mfd, &data->it8801_kbd_callback); in kbd_it8801_init()
225 BUILD_ASSERT(IN_RANGE(DT_INST_PROP(inst, row_size), 1, 8), "invalid row-size"); \
226 BUILD_ASSERT(IN_RANGE(DT_INST_PROP(inst, col_size), 1, 19), "invalid col-size");