armbian_build/patch/kernel/archive/sunxi-5.19/patches.megous/input-pinephone-keyboard-Allow-disabling-the-keyboard-input.patch
The-going 97c6e5e9dd
sunxi-5.19: Initial state for megous patches (#4048)
* sunxi-5.19: Initial state for megous patches

* Add the ability to do 5.19

* Move to 5.19

- tested both
- removed broken Opi Zero xradio driver https://armbian.atlassian.net/browse/AR-1280

* sunxi-5.19: fix tag for switch

* sunxi-5.19: Initial state for armbian patches

* sunxi-5.19: Add armbian patches to series.conf file

* sanxi-5.19: Add other 2 patches

* sunxi-5.19: Limit to use the 'wireless/xradio' module

Limit the kernel version to less than 5.19 to use
the 'wireless/xradio' module

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
2022-08-05 21:23:49 +03:00

50 lines
1.5 KiB
Diff

From c61da7da9a6b4390cb6f8ed2bf73af9e9c6bcd5b Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sun, 3 Apr 2022 16:25:59 +0200
Subject: [PATCH 391/417] 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 b1e951cbb..d74ae97ed 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.35.3