Commit 01c84b03 authored by Siarhei Volkau's avatar Siarhei Volkau Committed by Dmitry Torokhov

Input: matrix_keypad - force switch rows to input mode

Some Pin/GPIO controllers can't get current GPIO status when interrupt
mode is set. Specifically Ingenic's JZ4755 always returns status at the
moment of interrupt.

The patch tries to fix that by forcibly setting pin mode to GPIO input
prior to reading actual row status. enable_row_irqs seems to set
interrupt mode back as it should be.
Signed-off-by: default avatarSiarhei Volkau <lis8215@gmail.com>
Link: https://lore.kernel.org/r/20221102165747.1528988-1-lis8215@gmail.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 5b0c03e2
...@@ -127,6 +127,9 @@ static void matrix_keypad_scan(struct work_struct *work) ...@@ -127,6 +127,9 @@ static void matrix_keypad_scan(struct work_struct *work)
memset(new_state, 0, sizeof(new_state)); memset(new_state, 0, sizeof(new_state));
for (row = 0; row < pdata->num_row_gpios; row++)
gpio_direction_input(pdata->row_gpios[row]);
/* assert each column and read the row status out */ /* assert each column and read the row status out */
for (col = 0; col < pdata->num_col_gpios; col++) { for (col = 0; col < pdata->num_col_gpios; col++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment