Lines Matching +full:row +full:- +full:size
4 * SPDX-License-Identifier: Apache-2.0
62 LOG_INF("input event: dev=%-16s %3s type=%2x code=%3d value=%d", in input_dump_cb()
63 evt->dev ? evt->dev->name : "NULL", in input_dump_cb()
64 evt->sync ? "SYN" : "", in input_dump_cb()
65 evt->type, in input_dump_cb()
66 evt->code, in input_dump_cb()
67 evt->value); in input_dump_cb()
96 return -EINVAL; in input_cmd_report()
106 return -EINVAL; in input_cmd_report()
133 const struct input_kbd_matrix_common_config *cfg = kbd_matrix_state_dev->config; in kbd_matrix_state_log_entry()
135 int size = sizeof(kbd_matrix_buf); in kbd_matrix_state_log_entry() local
140 memset(blank, '-', sizeof(blank) - 1); in kbd_matrix_state_log_entry()
141 blank[sizeof(blank) - 1] = '\0'; in kbd_matrix_state_log_entry()
143 for (int i = 0; i < cfg->col_size; i++) { in kbd_matrix_state_log_entry()
144 char *sep = (i + 1) < cfg->col_size ? " " : ""; in kbd_matrix_state_log_entry()
147 ret = snprintf(buf, size, "%" PRIkbdrow "%s", data[i], sep); in kbd_matrix_state_log_entry()
149 ret = snprintf(buf, size, "%s%s", blank, sep); in kbd_matrix_state_log_entry()
151 size -= ret; in kbd_matrix_state_log_entry()
157 if (size < 1) { in kbd_matrix_state_log_entry()
164 kbd_matrix_state_dev->name, header, kbd_matrix_buf, count); in kbd_matrix_state_log_entry()
170 static uint32_t row, col; in kbd_matrix_state_log() local
175 if (kbd_matrix_state_dev == NULL || kbd_matrix_state_dev != evt->dev) { in kbd_matrix_state_log()
179 cfg = kbd_matrix_state_dev->config; in kbd_matrix_state_log()
181 switch (evt->code) { in kbd_matrix_state_log()
183 col = evt->value; in kbd_matrix_state_log()
186 row = evt->value; in kbd_matrix_state_log()
189 val = evt->value; in kbd_matrix_state_log()
193 if (!evt->sync) { in kbd_matrix_state_log()
197 if (col > (CONFIG_INPUT_SHELL_KBD_MATRIX_STATE_MAX_COLS - 1)) { in kbd_matrix_state_log()
202 if (col > (cfg->col_size - 1)) { in kbd_matrix_state_log()
207 if (row > (cfg->row_size - 1)) { in kbd_matrix_state_log()
208 LOG_ERR("invalid row index: %d", row); in kbd_matrix_state_log()
212 WRITE_BIT(kbd_matrix_state[col], row, val); in kbd_matrix_state_log()
214 WRITE_BIT(kbd_matrix_key_mask[col], row, 1); in kbd_matrix_state_log()
228 kbd_matrix_state_log_entry("key-mask", in input_cmd_kbd_matrix_state_dump()
240 return -ENODEV; in input_cmd_kbd_matrix_state_dump()
245 kbd_matrix_state_dev->name); in input_cmd_kbd_matrix_state_dump()
246 return -EINVAL; in input_cmd_kbd_matrix_state_dump()
253 shell_info(sh, "Keyboard state logging enabled for %s", dev->name); in input_cmd_kbd_matrix_state_dump()
262 entry->syntax = (dev != NULL) ? dev->name : NULL; in device_name_get()
263 entry->handler = NULL; in device_name_get()
264 entry->help = NULL; in device_name_get()
265 entry->subcmd = NULL; in device_name_get()