Input: mt6779-keypad - implement row/column selection
authorMattijs Korpershoek <mkorpershoek@baylibre.com>
Fri, 8 Jul 2022 21:57:43 +0000 (14:57 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 8 Jul 2022 21:58:38 +0000 (14:58 -0700)
commit31789f35f80c582cf3eb90f7eb8aa48eb96c27c5
treec5fb63075af39c079ab54e9d326b93a25855a3d1
parentd6ed52583034f9d2e39dead7c18e03380fd4edf2
Input: mt6779-keypad - implement row/column selection

The MediaTek keypad has a total of 6 input rows and 6 input columns.
By default, rows/columns 0-2 are enabled.

This is controlled by the KP_SEL register:
- bits[9:4]   control row selection
- bits[15:10] control column selection

Each bit enables the corresponding row/column number (e.g KP_SEL[4]
enables ROW0)

Depending on how the keypad is wired, this may result in wrong readings
of the keypad state.

Program the KP_SEL register to limit the key detection to n_rows,
n_cols we retrieve from the device tree.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20220707075236.126631-3-mkorpershoek@baylibre.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/mt6779-keypad.c