mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-17 04:51:31 +03:00
61 lines
2.5 KiB
Diff
61 lines
2.5 KiB
Diff
From 6b688f0cc0068c63c84ea3357ea9375262144aae Mon Sep 17 00:00:00 2001
|
|
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
|
|
Date: Thu, 9 Apr 2020 01:56:19 -0400
|
|
Subject: [PATCH 1/3] gpio_keys: shut up!
|
|
|
|
---
|
|
drivers/input/keyboard/gpio_keys.c | 14 ++++++++++----
|
|
1 file changed, 10 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
|
|
index 793e5cf3508ec..3728b349fc2b0 100644
|
|
--- a/drivers/input/keyboard/gpio_keys.c
|
|
+++ b/drivers/input/keyboard/gpio_keys.c
|
|
@@ -31,6 +31,12 @@
|
|
#include <linux/spinlock.h>
|
|
#include <linux/pinctrl/consumer.h>
|
|
|
|
+#if 0
|
|
+#define GPIO_KEYS_DBG(...) printk(KERN_INFO __VA_ARGS__);
|
|
+#else
|
|
+#define GPIO_KEYS_DBG(...) pr_debug(KERN_INFO __VA_ARGS__);
|
|
+#endif
|
|
+
|
|
//ASUS BSP: workround for DoubleClickVolumeKey sometimes can't bring up panel
|
|
#include <linux/wakelock.h>
|
|
static struct wake_lock volume_key_wake_lock;
|
|
@@ -335,7 +341,7 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
|
|
struct input_dev *input = bdata->input;
|
|
unsigned int type = button->type ?: EV_KEY;
|
|
int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low;
|
|
- printk("[Gpio_keys] %s:keycode=%d state=%s \n",__func__,
|
|
+ GPIO_KEYS_DBG("[Gpio_keys] %s:keycode=%d state=%s \n",__func__,
|
|
button->code,state ? "press" : "release");
|
|
if (type == EV_ABS) {
|
|
if (state)
|
|
@@ -344,10 +350,10 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
|
|
input_event(input, type, button->code, !!state);
|
|
if (state) {//ASUS BSP : workround for DoubleClickVolumeKey sometimes can't bring up panel
|
|
if ((button->code == KEY_VOLUMEUP) || (button->code == KEY_VOLUMEDOWN)) {
|
|
- printk("[Gpio_keys]vol_key:%x\r\n", state);
|
|
+ GPIO_KEYS_DBG("[Gpio_keys]vol_key:%x\r\n", state);
|
|
if (NULL != (&(volume_key_wake_lock.ws))->name) {
|
|
wake_lock_timeout(&volume_key_wake_lock, 3 * HZ);
|
|
- printk("[Gpio_keys]Wakelock 3 sec for vol_key \n");
|
|
+ GPIO_KEYS_DBG("[Gpio_keys]Wakelock 3 sec for vol_key \n");
|
|
}
|
|
}
|
|
}//ASUS BSP : workround for DoubleClickVolumeKey sometimes can't bring up panel
|
|
@@ -824,7 +830,7 @@ static int gpio_keys_probe(struct platform_device *pdev)
|
|
|
|
device_init_wakeup(&pdev->dev, wakeup);
|
|
wake_lock_init(&volume_key_wake_lock, WAKE_LOCK_SUSPEND, "pwr_key_lock");
|
|
- printk(KERN_INFO "[Gpio_keys]Initialize a wakelock for gpio_key\r\n");
|
|
+ GPIO_KEYS_DBG(KERN_INFO "[Gpio_keys]Initialize a wakelock for gpio_key\r\n");
|
|
|
|
error = input_register_device(input);
|
|
if (error) {
|
|
--
|
|
2.23.1
|
|
|