armbian_build/patch/kernel/archive/sunxi-5.16/patches.megous/input-kb151-Allow-to-disable-the-keyboard-input-processing.patch
The-going f80117f21c
Recycling of megous v5.16.4 patches (#3449)
* Recycling of megous v5.16.4 patches

The patches were sorted as far as possible. Some patches are renamed
according to their place of application. The length of the patch name
has been changed to improve readability using
the `git format-patch --filename-max-length=75` method.

The folder containing the patches will have the name `patches.name`
and the corresponding file `series.name` for the convenience
of processing and moving them upstream. But the control file remains
`series.conf`.


Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Add a series of armbian patches for 5.16

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Remove patches whose fixes are already in the kernel

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
2022-02-02 11:03:44 +01:00

54 lines
1.6 KiB
Diff

From c8e15ff25a48a4b81168a7ba26cf14599dab6a57 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sat, 22 Jan 2022 01:56:54 +0100
Subject: [PATCH 318/446] input: kb151: Allow to disable the keyboard input
processing
This allows the user to add kb151.disable_input to kernel boot
arguments (or module parameters), and they'll be able to use
the ppkb-i2c-inputd with their keyboard.
Charger part remains handled by the kernel.
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
drivers/input/keyboard/kb151.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/input/keyboard/kb151.c b/drivers/input/keyboard/kb151.c
index 898a25d06..491c01dfd 100644
--- a/drivers/input/keyboard/kb151.c
+++ b/drivers/input/keyboard/kb151.c
@@ -82,6 +82,10 @@
#define DEFAULT_MAP_ROWS 12
#define DEFAULT_MAP_COLS 12
+static bool disable_input;
+module_param(disable_input, bool, S_IRUGO);
+MODULE_PARM_DESC(disable_input, "Disable the keyboard part of the driver");
+
static const u32 kb151_default_keymap[] = {
MATRIX_KEY(0, 0, KEY_ESC),
MATRIX_KEY(0, 1, KEY_1),
@@ -492,6 +496,9 @@ static int kb151_probe(struct i2c_client *client)
kb151->rows = kb_rows;
kb151->cols = kb_cols;
+ if (disable_input)
+ goto charger;
+
kb151->input = devm_input_allocate_device(dev);
if (!kb151->input)
return -ENOMEM;
@@ -523,6 +530,7 @@ static int kb151_probe(struct i2c_client *client)
if (ret)
return dev_err_probe(dev, ret, "Failed to register input\n");
+charger:
#ifdef CONFIG_IP5XXX_POWER
// we need to create a custom regmap_bus that will proxy
// charger register reads/writes via a keyboard MCU
--
2.31.1