armbian_build/patch/kernel/archive/sunxi-5.17/patches.megous/input-pinephone-keyboard-Allow-disabling-the-keyboard-input.patch
The-going 9ebd3600c6
Sunxi 5.17 (#3687)
* Add 88 new patches to series. tag: orange-pi-5.17-20220409-0454

* Fix the applicability of patches.megous to the v5.17.3 kernel

* Fix series.conf. Disable the patch that is not being applied

* Add support for sun50i-h6-orangepi-3-lts

* Check the applicability in the series

* Move to a patches.armbian folder

* Bananapro: add AXP209 regulators

* fix-gpio-kconfig remove if EXPERT to allow normal build

* sunxi-5.17: Remove unused patches
2022-04-16 18:20:04 +03:00

50 lines
1.5 KiB
Diff

From ec0f8fdc30ddf2e0ddcad82b64fb2838c364820f Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sun, 3 Apr 2022 16:25:59 +0200
Subject: [PATCH 542/544] input: pinephone-keyboard: Allow disabling the
keyboard input
This is useful when the user wants to use a userspace implementation.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/input/keyboard/pinephone-keyboard.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/input/keyboard/pinephone-keyboard.c b/drivers/input/keyboard/pinephone-keyboard.c
index b1e951cbb925..d74ae97ed3cf 100644
--- a/drivers/input/keyboard/pinephone-keyboard.c
+++ b/drivers/input/keyboard/pinephone-keyboard.c
@@ -10,6 +10,10 @@
#include <linux/module.h>
#include <linux/regulator/consumer.h>
+static bool disable_input;
+module_param(disable_input, bool, S_IRUGO);
+MODULE_PARM_DESC(disable_input, "Disable the keyboard part of the driver");
+
#define DRV_NAME "pinephone-keyboard"
#define PPKB_CRC8_POLYNOMIAL 0x07
@@ -397,6 +401,9 @@ static int ppkb_probe(struct i2c_client *client)
ppkb->rows = map_rows;
ppkb->cols = map_cols;
+ if (disable_input)
+ goto enable_regulator;
+
ppkb->input = devm_input_allocate_device(dev);
if (!ppkb->input)
return -ENOMEM;
@@ -433,6 +440,7 @@ static int ppkb_probe(struct i2c_client *client)
if (ret)
return dev_err_probe(dev, ret, "Failed to request IRQ\n");
+enable_regulator:
ret = regulator_enable(ppkb->vbat_supply);
if (ret)
return dev_err_probe(dev, ret,
--
2.34.1