summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorSiarhei Volkau <lis8215@gmail.com>2022-11-03 23:40:02 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2022-11-03 23:41:03 +0300
commit01c84b03d80aab9f04c4e3e1f9085f4202ff7c29 (patch)
treee487049d76341c2332e6a7b5fa608f3b086594f8 /drivers/input/keyboard
parent5b0c03e24a061f9c9e8b28fa157b80990c559a37 (diff)
downloadlinux-01c84b03d80aab9f04c4e3e1f9085f4202ff7c29.tar.xz
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: Siarhei Volkau <lis8215@gmail.com> Link: https://lore.kernel.org/r/20221102165747.1528988-1-lis8215@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/matrix_keypad.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 7dd3f3eda834..b4c0325bbf1a 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -127,6 +127,9 @@ static void matrix_keypad_scan(struct work_struct *work)
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 */
for (col = 0; col < pdata->num_col_gpios; col++) {