armbian_build/patch/kernel/archive/sunxi-5.17/patches.megous/input-kb151-Allow-to-disable-FN-layer-handling.patch
The-going 0f7200c793
Sunxi 5.17 (#3613)
* The initial state of a series of patches for sunxi-5.17

tag orange-pi-5.17-20220323-1423

* DEBUG for sunxi-5.17

* Add Armbian patches to 5.17

* Fix duplicate nodes for sun50i-h5-orangepi-pc2

* Fix reg_ahci_5v to status okay for bananapro board

* Remove an unused patch for an unsupported sun50i-h6-tanix-tx6 board
2022-03-31 20:32:04 +03:00

42 lines
1.5 KiB
Diff

From ce0155f7c168626d83be538ab95feb76881bfcc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= <megi@xff.cz>
Date: Fri, 28 Jan 2022 16:53:46 +0100
Subject: [PATCH 403/456] input: kb151: Allow to disable FN layer handling
This is temporary patch to ease transition for handling Fn+... via
keymaps in userspace. Fn layer support may be removed from the
driver in the future.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/input/keyboard/kb151.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/kb151.c b/drivers/input/keyboard/kb151.c
index 491c01dfd194..453eee2736f6 100644
--- a/drivers/input/keyboard/kb151.c
+++ b/drivers/input/keyboard/kb151.c
@@ -86,6 +86,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_layer;
+module_param(disable_fn_layer, bool, 0644);
+MODULE_PARM_DESC(disable_fn_layer, "Disable the keyboard's Fn key layer map");
+
static const u32 kb151_default_keymap[] = {
MATRIX_KEY(0, 0, KEY_ESC),
MATRIX_KEY(0, 1, KEY_1),
@@ -237,7 +241,7 @@ static void kb151_update(struct i2c_client *client)
dev_dbg(&client->dev, "row %u col %u %sed\n",
map_row, col, pressed ? "press" : "releas");
- if (keymap[code] == KEY_FN) {
+ if (keymap[code] == KEY_FN && !disable_fn_layer) {
dev_dbg(&client->dev, "FN is now %s\n",
pressed ? "pressed" : "released");
kb151->fn_state = pressed;
--
2.34.1