From c8e15ff25a48a4b81168a7ba26cf14599dab6a57 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman 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 --- 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