input: kbd_matrix: add actual-key-mask support

Add an optional actual-key-mask property to filter out key combinations
that are not implemented in the actual keyboard matrix.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-11-23 17:36:53 +00:00 committed by Fabio Baltieri
commit 808c0f1f78
4 changed files with 24 additions and 0 deletions

View file

@ -94,6 +94,11 @@ static bool input_kbd_matrix_scan(const struct device *dev)
k_busy_wait(cfg->settle_time_us);
row = api->read_row(dev);
if (cfg->actual_key_mask != NULL) {
row &= cfg->actual_key_mask[col];
}
cfg->matrix_new_state[col] = row;
key_event |= row;
}