Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: matrix_keypad - add function for reading row state

Move the evaluation of a row state into separate function.
It will be also used by a change later in this series.

Signed-off-by: Markus Burri <markus.burri@mt.com>
Reviewed-by: Manuel Traut <manuel.traut@mt.com>
Link: https://lore.kernel.org/r/20250226152843.43932-2-markus.burri@mt.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Markus Burri and committed by
Dmitry Torokhov
a37af8e8 4d395cb0

+11 -3
+11 -3
drivers/input/keyboard/matrix_keypad.c
··· 104 104 disable_irq_nosync(keypad->row_irqs[i]); 105 105 } 106 106 107 + static uint32_t read_row_state(struct matrix_keypad *keypad) 108 + { 109 + int row; 110 + u32 row_state = 0; 111 + 112 + for (row = 0; row < keypad->num_row_gpios; row++) 113 + row_state |= row_asserted(keypad, row) ? BIT(row) : 0; 114 + return row_state; 115 + } 116 + 107 117 /* 108 118 * This gets the keys from keyboard and reports it to input subsystem 109 119 */ ··· 139 129 140 130 activate_col(keypad, col, true); 141 131 142 - for (row = 0; row < keypad->num_row_gpios; row++) 143 - new_state[col] |= 144 - row_asserted(keypad, row) ? BIT(row) : 0; 132 + new_state[col] = read_row_state(keypad); 145 133 146 134 activate_col(keypad, col, false); 147 135 }