aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/soc_button_array.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-01-21 11:14:14 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-01-21 11:46:52 -0800
commit5c4fa2a6da7fbc76290d1cb54a7e35633517a522 (patch)
tree632c3219f8ba561580053e58656fadf84cc23b3c /drivers/input/misc/soc_button_array.c
parentInput: tm2-touchkey - add touchkey driver support for TM2 (diff)
downloadlinux-dev-5c4fa2a6da7fbc76290d1cb54a7e35633517a522.tar.xz
linux-dev-5c4fa2a6da7fbc76290d1cb54a7e35633517a522.zip
Input: soc_button_array - debounce the buttons
The soc_button_array driver was initializing (kzalloc) the debounce_interval value to 0, leading to no debouncing at all, while the buttons are simple mechanical switches. This commit sets debounce_interval to 50ms to avoid spurious button press reports both on press and release of the button. Note 50ms may seem like a lot but soc_button_array is typically used with cheap tablets, with not so great buttons. I tried 10ms on my tablet and it is not enough, where as 50ms works well. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/input/misc/soc_button_array.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c
index fb3219a8d3c0..ddb2f22fca7a 100644
--- a/drivers/input/misc/soc_button_array.c
+++ b/drivers/input/misc/soc_button_array.c
@@ -102,6 +102,8 @@ soc_button_device_create(struct platform_device *pdev,
gpio_keys[n_buttons].active_low = 1;
gpio_keys[n_buttons].desc = info->name;
gpio_keys[n_buttons].wakeup = info->wakeup;
+ /* These devices often use cheap buttons, use 50 ms debounce */
+ gpio_keys[n_buttons].debounce_interval = 50;
n_buttons++;
}