Lines Matching refs:cfg
31 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_ghosting() local
32 const kbd_row_t *state = cfg->matrix_new_state; in input_kbd_matrix_ghosting()
48 for (int c = 0; c < cfg->col_size; c++) { in input_kbd_matrix_ghosting()
53 for (int c_next = c + 1; c_next < cfg->col_size; c_next++) { in input_kbd_matrix_ghosting()
76 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_drive_column() local
77 const struct input_kbd_matrix_api *api = cfg->api; in input_kbd_matrix_drive_column()
99 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_scan() local
100 const struct input_kbd_matrix_api *api = cfg->api; in input_kbd_matrix_scan()
104 for (int col = 0; col < cfg->col_size; col++) { in input_kbd_matrix_scan()
105 if (cfg->actual_key_mask != NULL && in input_kbd_matrix_scan()
106 cfg->actual_key_mask[col] == 0) { in input_kbd_matrix_scan()
111 cfg->matrix_new_state[col] = 0; in input_kbd_matrix_scan()
118 k_busy_wait(cfg->settle_time_us); in input_kbd_matrix_scan()
122 if (cfg->actual_key_mask != NULL) { in input_kbd_matrix_scan()
123 row &= cfg->actual_key_mask[col]; in input_kbd_matrix_scan()
126 cfg->matrix_new_state[col] = row; in input_kbd_matrix_scan()
137 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_update_state() local
139 kbd_row_t *matrix_new_state = cfg->matrix_new_state; in input_kbd_matrix_update_state()
152 for (int c = 0; c < cfg->col_size; c++) { in input_kbd_matrix_update_state()
154 row_changed = matrix_new_state[c] ^ cfg->matrix_previous_state[c]; in input_kbd_matrix_update_state()
160 for (int r = 0; r < cfg->row_size; r++) { in input_kbd_matrix_update_state()
161 uint8_t cyc_idx = c * cfg->row_size + r; in input_kbd_matrix_update_state()
168 cfg->scan_cycle_idx[cyc_idx] = data->scan_cycles_idx; in input_kbd_matrix_update_state()
172 cfg->matrix_unstable_state[c] |= row_changed; in input_kbd_matrix_update_state()
173 cfg->matrix_previous_state[c] = matrix_new_state[c]; in input_kbd_matrix_update_state()
176 for (int c = 0; c < cfg->col_size; c++) { in input_kbd_matrix_update_state()
177 deb_col = cfg->matrix_unstable_state[c]; in input_kbd_matrix_update_state()
184 for (int r = 0; r < cfg->row_size; r++) { in input_kbd_matrix_update_state()
193 uint8_t cyc_idx = c * cfg->row_size + r; in input_kbd_matrix_update_state()
194 uint8_t scan_cyc_idx = cfg->scan_cycle_idx[cyc_idx]; in input_kbd_matrix_update_state()
201 if (deb_t_us < (row_bit ? cfg->debounce_down_us : cfg->debounce_up_us)) { in input_kbd_matrix_update_state()
206 cfg->matrix_unstable_state[c] &= ~mask; in input_kbd_matrix_update_state()
209 if ((cfg->matrix_stable_state[c] & mask) == row_bit) { in input_kbd_matrix_update_state()
219 cfg->matrix_stable_state[c] ^= mask; in input_kbd_matrix_update_state()
232 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_check_key_events() local
238 for (int c = 0; c < cfg->col_size; c++) { in input_kbd_matrix_check_key_events()
241 cfg->matrix_unstable_state[c], in input_kbd_matrix_check_key_events()
242 cfg->matrix_previous_state[c], in input_kbd_matrix_check_key_events()
243 cfg->matrix_new_state[c]); in input_kbd_matrix_check_key_events()
247 if (cfg->ghostkey_check && input_kbd_matrix_ghosting(dev)) { in input_kbd_matrix_check_key_events()
258 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_poll_timeout() local
260 if (cfg->poll_timeout_ms == 0) { in input_kbd_matrix_poll_timeout()
264 return sys_timepoint_calc(K_MSEC(cfg->poll_timeout_ms)); in input_kbd_matrix_poll_timeout()
269 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_is_unstable() local
271 for (uint8_t c = 0; c < cfg->col_size; c++) { in input_kbd_matrix_is_unstable()
272 if (cfg->matrix_unstable_state[c] != 0) { in input_kbd_matrix_is_unstable()
282 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_poll() local
308 poll_period_us = cfg->poll_period_us; in input_kbd_matrix_poll()
310 poll_period_us = cfg->stable_poll_period_us; in input_kbd_matrix_poll()
325 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_polling_thread() local
326 const struct input_kbd_matrix_api *api = cfg->api; in input_kbd_matrix_polling_thread()
405 const struct input_kbd_matrix_common_config *cfg = dev->config; in input_kbd_matrix_actual_key_mask_set() local
407 if (row >= cfg->row_size || col >= cfg->col_size) { in input_kbd_matrix_actual_key_mask_set()
411 if (cfg->actual_key_mask == NULL) { in input_kbd_matrix_actual_key_mask_set()
416 WRITE_BIT(cfg->actual_key_mask[col], row, enabled); in input_kbd_matrix_actual_key_mask_set()