From 27ba277c1f13820453dfae882d407a285d634fbc Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Sat, 29 Oct 2022 00:45:55 +0200 Subject: [PATCH 492/492] input: pinephone-keyboard: Allow to disable Fn layer processing Sometimes it's more flexible to handle Fn key as additional modifier that can be configured from userspace. Signed-off-by: Ondrej Jirman --- drivers/input/keyboard/pinephone-keyboard.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/input/keyboard/pinephone-keyboard.c b/drivers/input/keyboard/pinephone-keyboard.c index d74ae97ed3cf..671642857d0c 100644 --- a/drivers/input/keyboard/pinephone-keyboard.c +++ b/drivers/input/keyboard/pinephone-keyboard.c @@ -14,6 +14,10 @@ static bool disable_input; module_param(disable_input, bool, S_IRUGO); MODULE_PARM_DESC(disable_input, "Disable the keyboard part of the driver"); +static bool disable_fn; +module_param(disable_fn, bool, S_IRUGO); +MODULE_PARM_DESC(disable_fn, "Disable the FN layer special handling"); + #define DRV_NAME "pinephone-keyboard" #define PPKB_CRC8_POLYNOMIAL 0x07 @@ -276,7 +280,8 @@ static void ppkb_update(struct i2c_client *client) dev_dbg(dev, "row %u col %u %sed\n", row, col, value ? "press" : "releas"); - if (keymap[code] == KEY_FN) { + + if (!disable_fn && keymap[code] == KEY_FN) { dev_dbg(dev, "FN is now %sed\n", value ? "press" : "releas"); keymap = value ? ppkb->fn_keymap -- 2.35.3